You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#[derive(Debug)]enumThing{// variant A has interior mutabilityA(std::cell::Cell<bool>),// variant B clearly does notB,}implThing{// declare_interior_mutable_const triggers herepubconstBB:Thing = Thing::B;}fnmain(){// borrow_interior_mutable_const triggers hereprintln!("Thing::BB = {:?}",Thing::BB);}
I realize that it isn't possible to know if the thing on the rhs of a const declaration is interior mutable or not without full const evaluation, but trivial cases such as the example shouldn't be too difficult.