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
The interning in memory.rs is also fishy. It determines once, using is_freeze(), whether there is interior mutability, and then recursively uses that information when interning stuff behind references. However, is_freeze() does not say anything about what is behind references: It is guided by the Freeze marker trait, which has
unsafe impl<T: ?Sized> Freeze for *const T {}
unsafe impl<T: ?Sized> Freeze for *mut T {}
unsafe impl<'a, T: ?Sized> Freeze for &'a T {}
unsafe impl<'a, T: ?Sized> Freeze for &'a mut T {}
So really it has to check again after following any pointer indirection.
Of course, that doe snot work either because at that point we do not have type information...
I think right now this is not a problem because this does not compile
Ah and because I don't know there else to dump this: const_to_allocation is a strange beast; it seems to be called for statics only so the logic that copies is unnecessary (and it is non-recursive anyway which seems incomplete).
Likely we want a query for statics that just returns an allocation, or maybe an AllocId instead, done?
This is refactoring fallout during the miri merger.
First it is interned in
rust/src/librustc_mir/interpret/memory.rs
Line 604 in 1558ae7
rust/src/librustc_mir/interpret/const_eval.rs
Line 98 in 1558ae7
The second place is wholly unnecessary barring bugs in the first place
The text was updated successfully, but these errors were encountered: