Skip to content

Support tracked methods without self #585

Open
@nikomatsakis

Description

@nikomatsakis

This is an error today:

#[salsa::tracked]
struct SymTy<'db> {
    ...
}

#[salsa::tracked]
impl<'db> SymTy<'db> {
    #[salsa::tracked]
    pub fn unit(db: &'db dyn Db) -> Self {}
}

...but why? I can still desugar this relatively easily to a regular function calling __unit (see below), so why can't the macro do it?

#[salsa::tracked]
fn __unit(db: &'db dyn Db) -> SymTy<'db> { ... }

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions