diff options
| author | Kevin Ballard <kevin@sb.org> | 2014-07-02 17:06:03 -0700 |
|---|---|---|
| committer | Kevin Ballard <kevin@sb.org> | 2014-08-01 01:20:20 -0700 |
| commit | 192a8a5db75802d10a6f3a63ab28600df75ec3d8 (patch) | |
| tree | 59821304067831cb91fd559df22cdab620fc9daf /src/rustllvm/RustWrapper.cpp | |
| parent | 9f0b91985fb99730f145b62f2d3b4c10f54e27f0 (diff) | |
| download | rust-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
