Russell Johnston
Russell Johnston
That seems like something that would work better as a `static V` than a const, or else as something like `const V: &Vec = &allocates(); V.clone()`, or even `const V:...
@joshtriplett The reference in the const does not exist "ambiently" the way the static does. It only exists at the points where the const is used- in one sense it...
I just hit a use case where some way for a `const` to refer to a `static` would be extremely valuable: My goal was to convert a string interner from...
Yes, I could write it such that computing the value of a constant does not read from a static and only takes its address (or the address of one of...
Wait, if we can allow reads from truly-immutable statics then couldn't we just *always* allow that, even around the generic cases? The results of "does this reference a `!Freeze` static"...
I would love to try implementing this, even just the conservative type-based version.
@oli-obk Thanks! I should be able to try that out soon. @RalfJung Right, the string interning case doesn't use interior mutability or raw pointers anywhere in the types of statics....
Sounds good to me, I was holding off on updating rust-lang/rust#71332 until I could better understand those anyway.
If I understand this correctly, the "new" constraint here is that using a const in a pattern *recursively* dereferences all references it contains, const-ly. Or in other words, this is...
Well, yes, but I'm not using references in patterns. My `Symbol` type contains a raw pointer instead (though I realize that only works in patterns somewhat accidentally). 😅 Anything I've...