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
use std::cell::Cell;structA;implA{fnid<'a>(&'amutself) -> &'amutA{self}fnbar(&mutself){println!("oh no!");}}fnfoo(f:&fn()){f()}fnmain(){let c = Cell::new_empty();letmut a = A;let d = Cell::new(&mut a);
do d.with_mut_ref |this| {
c.put_back(this.id());}
do d.with_mut_ref |this1| {
do c.with_mut_ref |this2| {
this1.bar();
this2.bar();}}}
Near the end this and this2 are two mutable pointers to the same object, which I believe is unsound.