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
auto-deref has been added but I'm still interested in a more uniform behavior of custom pointers (meaning the ones that exist by trait implementation) and native ones (like the dying ~T).
use std::rc::Rc;structBar{x:int}fnfoo(p:&int){println!("{}", p);}fnbaz(p:&Bar){println!("{}", p.x);}fnmain(){let pi = box 10;let pb = Rc::new(Bar{x:3});foo(pi);// this still doesn't auto borrow://baz(pb);// although this works:println!("{}", pb.x);}
I've looked in #7141, #12491, #13542, #5527, #12825, #12610 and RFC 59 but could not grasp whether any would be addressing this or whether it's desirable, sorry if it's a duplicate.
The text was updated successfully, but these errors were encountered:
auto-deref has been added but I'm still interested in a more uniform behavior of custom pointers (meaning the ones that exist by trait implementation) and native ones (like the dying
~T
).An example situation:
I've looked in #7141, #12491, #13542, #5527, #12825, #12610 and RFC 59 but could not grasp whether any would be addressing this or whether it's desirable, sorry if it's a duplicate.
The text was updated successfully, but these errors were encountered: