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
It seems that in Rust ~Trait are Const but that seems wrong, because the implementation of Trait can contain non-Const structs, such as those annotated "mutable", like RcMut.
This seems allows to create an RcMut pointing to itself, like this.
externmod std;use std::rc::*;traitFoo{fnset(&mutself,v:RcMut<A>);}structB{v:Option<RcMut<A>>}implFooforB{fnset(&mutself,v:RcMut<A>){self.v = Some(v);}}structA{v: ~Foo,}fnmain(){let a = A{v: ~B{v:None}as ~Foo};let v = rc_mut_from_const(a);let w = v.clone();
v.with_mut_borrow(|p| {p.v.set(w.clone());})}
The text was updated successfully, but these errors were encountered:
It seems that in Rust ~Trait are Const but that seems wrong, because the implementation of Trait can contain non-Const structs, such as those annotated "mutable", like RcMut.
This seems allows to create an RcMut pointing to itself, like this.
The text was updated successfully, but these errors were encountered: