Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unknown annotations in salsa::tracked structs do not lead to an error #728

Open
sharkdp opened this issue Feb 25, 2025 · 1 comment · May be fixed by #729
Open

Unknown annotations in salsa::tracked structs do not lead to an error #728

sharkdp opened this issue Feb 25, 2025 · 1 comment · May be fixed by #729
Labels
good first issue Good for newcomers

Comments

@sharkdp
Copy link

sharkdp commented Feb 25, 2025

Tracked struct fields that are annotated with unknown attributes are just silently ignored. For example, when changing ParsedFile in examples/lazy-input/main.rs to this …

#[salsa::tracked]
struct ParsedFile<'db> {
    value: u32,
    #[returns_ref]  // oops, should be 'return_ref'!
    links: Vec<ParsedFile<'db>>,
}

… everything still compiles without any errors, but parsed_file.links(db) returns a clone of the vector now.

It looks to me like the developer experience could possibly be improved here.

@MichaReiser MichaReiser added the good first issue Good for newcomers label Feb 25, 2025
@MichaReiser
Copy link
Contributor

I think what we have to do here is to preserve any unknown attributes and carry them along so that Rust can complain if it is indeed an unknown attribute. Unless we don't want to support custom attributes altogether (e.g. allow?) in which case we can just error early

@sharkdp sharkdp linked a pull request Feb 25, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants