Skip to content

Add "volatile" flag for untracked reads again? #346

Open
@nikomatsakis

Description

@nikomatsakis

We used to have a "volatile" flag that we placed on functions which may consume untracked inputs. At some point it was removed. Unfortunately, we don't seem to have authored an RFC at the time, so I don't remember the reasoning -- probably we could find a PR. The current method for signalling an untracked input is to invoke report_untracked_read on the runtime. It's a kind of "out of the way" API that most users will not find.

I think we should go back to the volatile flag, so that this...

#[tracked(volatile)]
fn foo(db: &dyn crate::Db) { }

...would be the way to signal an untracked read (and the public report_untracked_read function would be removed). There is no loss of expressiveness, as one can easily make a function (like foo above) that does nothing but report an untracked read, and decide dynamically whether to call it.

The reason that I think a flag is better:

Metadata

Metadata

Assignees

No one assigned

    Labels

    salsa-2022Tracking issue for new salsa

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions