We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 20033c9 commit efd965cCopy full SHA for efd965c
src/libstd/arc.rs
@@ -96,6 +96,11 @@ pub fn get<'a, T:Const + Owned>(rc: &'a ARC<T>) -> &'a T {
96
unsafe { &*rc.x.get_immut() }
97
}
98
99
+impl<T: Const + Owned> ARC<T> {
100
+ pub fn get<'a>(&'a self) -> &'a T {
101
+ get(self)
102
+ }
103
+}
104
/**
105
* Duplicate an atomically reference counted wrapper.
106
*
@@ -507,7 +512,8 @@ mod tests {
507
512
let c = p.recv();
508
513
c.send(arc::clone(&arc_v));
509
514
510
- assert!((*arc::get(&arc_v))[2] == 3);
515
+ assert_eq!((*arc::get(&arc_v))[2], 3);
516
+ assert_eq!(arc_v.get()[4], 5);
511
517
518
info!(arc_v);
519
0 commit comments