File tree Expand file tree Collapse file tree 2 files changed +17
-3
lines changed
branches/beta/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 @@ -31,7 +31,7 @@ refs/heads/automation-fail: 1bf06495443584539b958873e04cc2f864ab10e4
31
31
refs/heads/issue-18208-method-dispatch-3-quick-reject: 2009f85b9f99dedcec4404418eda9ddba90258a2
32
32
refs/heads/batch: b7fd822592a4fb577552d93010c4a4e14f314346
33
33
refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
34
- refs/heads/beta: a729a404945de10f99e2530a5c28952996532b29
34
+ refs/heads/beta: 9bbfd681c9fa47f462a89e8f5eedd3fa2a5de2e7
35
35
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
36
36
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
37
37
refs/heads/tmp: eb836bf767aa1d8d4cba488a9091cde3c0ab4b2f
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