Skip to content

Commit 12928d5

Browse files
committed
---
yaml --- r: 60087 b: refs/heads/master c: 625e518 h: refs/heads/master i: 60085: a785583 60083: de608c1 60079: 94c874d v: v3
1 parent 775c7a5 commit 12928d5

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 86500fbb134032ed28129272ef9fb3873934dd1b
2+
refs/heads/master: 625e518ffefaacb95c9bdc0544bc5771cc7a0928
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 2d28d645422c1617be58c8ca7ad9a457264ca850
55
refs/heads/try: c50a9d5b664478e533ba1d1d353213d70c8ad589

trunk/src/libstd/arc.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@ struct RWARCInner<T> { lock: RWlock, failed: bool, data: T }
252252
*
253253
* Unlike mutex_arcs, rw_arcs are safe, because they cannot be nested.
254254
*/
255+
#[mutable]
255256
struct RWARC<T> {
256257
x: SharedMutableState<RWARCInner<T>>,
257258
cant_nest: ()

trunk/src/libstd/rc.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ struct RcBox<T> {
2424
}
2525

2626
/// Immutable reference counted pointer type
27+
#[non_owned]
2728
pub struct Rc<T> {
2829
priv ptr: *mut RcBox<T>,
29-
priv non_owned: Option<@()> // FIXME: #5601: replace with `#[non_owned]`
3030
}
3131

3232
pub impl<'self, T: Owned> Rc<T> {
@@ -35,7 +35,7 @@ pub impl<'self, T: Owned> Rc<T> {
3535
let ptr = malloc(sys::size_of::<RcBox<T>>() as size_t) as *mut RcBox<T>;
3636
assert!(!ptr::is_null(ptr));
3737
intrinsics::move_val_init(&mut *ptr, RcBox{value: value, count: 1});
38-
Rc{ptr: ptr, non_owned: None}
38+
Rc{ptr: ptr}
3939
}
4040
}
4141

@@ -64,7 +64,7 @@ impl<T: Owned> Clone for Rc<T> {
6464
fn clone(&self) -> Rc<T> {
6565
unsafe {
6666
(*self.ptr).count += 1;
67-
Rc{ptr: self.ptr, non_owned: None}
67+
Rc{ptr: self.ptr}
6868
}
6969
}
7070
}
@@ -113,9 +113,10 @@ struct RcMutBox<T> {
113113
}
114114

115115
/// Mutable reference counted pointer type
116+
#[non_owned]
117+
#[mutable]
116118
pub struct RcMut<T> {
117119
priv ptr: *mut RcMutBox<T>,
118-
priv non_owned: Option<@mut ()> // FIXME: #5601: replace with `#[non_owned]` and `#[non_const]`
119120
}
120121

121122
pub impl<'self, T: Owned> RcMut<T> {
@@ -124,7 +125,7 @@ pub impl<'self, T: Owned> RcMut<T> {
124125
let ptr = malloc(sys::size_of::<RcMutBox<T>>() as size_t) as *mut RcMutBox<T>;
125126
assert!(!ptr::is_null(ptr));
126127
intrinsics::move_val_init(&mut *ptr, RcMutBox{value: value, count: 1, borrow: Nothing});
127-
RcMut{ptr: ptr, non_owned: None}
128+
RcMut{ptr: ptr}
128129
}
129130
}
130131

@@ -171,7 +172,7 @@ impl<T: Owned> Clone for RcMut<T> {
171172
fn clone(&self) -> RcMut<T> {
172173
unsafe {
173174
(*self.ptr).count += 1;
174-
RcMut{ptr: self.ptr, non_owned: None}
175+
RcMut{ptr: self.ptr}
175176
}
176177
}
177178
}

0 commit comments

Comments
 (0)