File tree Expand file tree Collapse file tree 3 files changed +8
-4
lines changed
librustc/middle/typeck/check Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -14,5 +14,5 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
14
14
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
15
15
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
16
16
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
17
- refs/heads/auto: e5f8026ebab867547514677bf9d7c7870a4345ad
17
+ refs/heads/auto: bbc4ca134900456ba2a00368ec1f19bc1a357528
18
18
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
Original file line number Diff line number Diff line change @@ -99,8 +99,12 @@ pub unsafe fn borrow_as_imm(a: *u8) {
99
99
#[ lang="return_to_mut" ]
100
100
#[ inline( always) ]
101
101
pub unsafe fn return_to_mut ( a : * u8 ) {
102
- let a: * mut BoxRepr = transmute ( a) ;
103
- ( * a) . header . ref_count &= !FROZEN_BIT ;
102
+ // Sometimes the box is null, if it is conditionally frozen.
103
+ // See e.g. #4904.
104
+ if !a. is_null ( ) {
105
+ let a: * mut BoxRepr = transmute ( a) ;
106
+ ( * a) . header . ref_count &= !FROZEN_BIT ;
107
+ }
104
108
}
105
109
106
110
#[ lang="check_not_borrowed" ]
Original file line number Diff line number Diff line change @@ -615,7 +615,7 @@ pub mod guarantor {
615
615
// expressions, both of which always yield a region variable, so
616
616
// mk_subr should never fail.
617
617
let rptr_ty = rcx. resolve_node_type( id) ;
618
- if !ty:: type_is_error( rptr_ty) {
618
+ if !ty:: type_is_error( rptr_ty) && !ty :: type_is_bot ( rptr_ty ) {
619
619
let tcx = rcx. fcx. ccx. tcx;
620
620
debug!( "rptr_ty=%s", ty_to_str( tcx, rptr_ty) ) ;
621
621
let r = ty:: ty_region( tcx, span, rptr_ty) ;
You can’t perform that action at this time.
0 commit comments