Open
Description
You can set (which we may rename to override
) the value of a tracked function for a tracked struct, if you created it:
#[tracked]
struct S { }
#[tracked]
fn foo(db: &dyn Db, s: S) -> u32 {
23
}
#[tracked]
fn bar(db: &dyn Db) {
let s = S::new(db);
foo::set(db, s, 22);
}
This is cool, but we should prevent if it you have "exposed" the struct to another tracked function (which may have read this value...)
#[tracked]
struct S { }
#[tracked]
fn foo(db: &dyn Db, s: S) -> u32 {
23
}
#[tracked]
fn bar(db: &dyn Db) {
let s = S::new(db);
baz(s);
foo::set(db, s, 22);
}
#[tracked]
fn baz(db: &dyn Db, s: S) -> u32 {
...
}