about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorKevin Ballard <kevin@sb.org>2014-07-02 17:06:03 -0700
committerKevin Ballard <kevin@sb.org>2014-08-01 01:20:20 -0700
commit192a8a5db75802d10a6f3a63ab28600df75ec3d8 (patch)
tree59821304067831cb91fd559df22cdab620fc9daf /src/rustllvm/RustWrapper.cpp
parent9f0b91985fb99730f145b62f2d3b4c10f54e27f0 (diff)
downloadrust-192a8a5db75802d10a6f3a63ab28600df75ec3d8.tar.gz
rust-192a8a5db75802d10a6f3a63ab28600df75ec3d8.zip
Add is_unique(), try_unwrap(), get_mut() to alloc::rc
Add a few new free functions to alloc::rc for manipulating
uniquely-owned Rc values. is_unique() can be used to test if the Rc is
uniquely-owned, try_unwrap() can remove the value from a uniquely-owned
Rc, and get_mut() can return a &mut for a uniquely-owned Rc.

These are all free functions, because smart pointers should avoid having
methods when possible. They can't be static methods because UFCS will
remove that distinction. I think we should probably change downgrade()
and make_unique() into free functions as well, but that's out of scope.
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions