flushed my rust code into a gist https://gist.github.com/mraleph/11093692 … tl;dr: have to write obj.ptr().td.handle().lookup() want to write obj.td.lookup
@mraleph I think you want to return &T in your Deref instead of &mut T—remember multiple &mut references to the same data are invalid.
-
-
@pcwalton now it looks like I am misunderstanding Rust type system - I assumed ptr: &T means "*nobody* can modify what ptr points to" -
@mraleph Yes, that's what it means generally, but Cell/RefCell are a way to circumvent that with dynamic checks. Like "mutable" in C++. - 1 more reply
New conversation -
-
-
@pcwalton where should I look for formal semantics of &mut T vs &T? can't find much in manual. -
@mraleph Here's the most formal description of it: http://static.rust-lang.org/doc/master/rustc/middle/borrowck/doc/index.html … - 1 more reply
New conversation -
-
-
@pcwalton [hence my reasoning for having &mut Root<T> and &mut T everywhere]Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.