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
Note: if the shared mutation is a part of the design, and you can prove that the shared mutation never overlaps with any reads, the way to avoid that UB is to store lxr etc as UnsafeCell<LXR<...>> and use the UnsafeCell methods to get mutable references. Rust does allow for the C model of shared mutation using cell types, however there is still UB possible with UnsafeCell.
I recommend trying to refactor it such that unsafe is not needed.
(or slap a RefCell on everything you want to mutate here and pay the runtime cost)
Transmuting a const ptr to a mutable ptr has become a hard compile error since rustc 1.72 rust-lang/rust#111567
We need to consider refactoring and removing all the
cast_ref_to_mut
related code before upgrading to 1.72.The text was updated successfully, but these errors were encountered: