File tree Expand file tree Collapse file tree 2 files changed +17
-3
lines changed
branches/auto/src/liballoc Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
10
10
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
11
11
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
12
12
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
13
- refs/heads/auto: a729a404945de10f99e2530a5c28952996532b29
13
+ refs/heads/auto: 9bbfd681c9fa47f462a89e8f5eedd3fa2a5de2e7
14
14
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
15
15
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
16
16
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336
Original file line number Diff line number Diff line change @@ -933,12 +933,26 @@ trait RcBoxPtr<T> {
933
933
934
934
impl < T > RcBoxPtr < T > for Rc < T > {
935
935
#[ inline( always) ]
936
- fn inner ( & self ) -> & RcBox < T > { unsafe { & ( * * self . _ptr ) } }
936
+ fn inner ( & self ) -> & RcBox < T > {
937
+ unsafe {
938
+ // Safe to assume this here, as if it weren't true, we'd be breaking
939
+ // the contract anyway
940
+ assume ( !self . _ptr . is_null ( ) ) ;
941
+ & ( * * self . _ptr )
942
+ }
943
+ }
937
944
}
938
945
939
946
impl < T > RcBoxPtr < T > for Weak < T > {
940
947
#[ inline( always) ]
941
- fn inner ( & self ) -> & RcBox < T > { unsafe { & ( * * self . _ptr ) } }
948
+ fn inner ( & self ) -> & RcBox < T > {
949
+ unsafe {
950
+ // Safe to assume this here, as if it weren't true, we'd be breaking
951
+ // the contract anyway
952
+ assume ( !self . _ptr . is_null ( ) ) ;
953
+ & ( * * self . _ptr )
954
+ }
955
+ }
942
956
}
943
957
944
958
#[ cfg( test) ]
You can’t perform that action at this time.
0 commit comments