File tree 2 files changed +17
-9
lines changed
2 files changed +17
-9
lines changed Original file line number Diff line number Diff line change @@ -3042,15 +3042,17 @@ pub fn adjust_ty(cx: ctxt,
3042
3042
Some ( @AutoDerefRef ( ref adj) ) => {
3043
3043
let mut adjusted_ty = unadjusted_ty;
3044
3044
3045
- for uint:: range( 0 , adj. autoderefs) |i| {
3046
- match ty:: deref ( cx, adjusted_ty, true ) {
3047
- Some ( mt) => { adjusted_ty = mt. ty ; }
3048
- None => {
3049
- cx. sess . span_bug (
3050
- span,
3051
- fmt ! ( "The %uth autoderef failed: %s" ,
3052
- i, ty_to_str( cx,
3053
- adjusted_ty) ) ) ;
3045
+ if ( !ty:: type_is_error ( adjusted_ty) ) {
3046
+ for uint:: range( 0 , adj. autoderefs) |i| {
3047
+ match ty:: deref ( cx, adjusted_ty, true ) {
3048
+ Some ( mt) => { adjusted_ty = mt. ty ; }
3049
+ None => {
3050
+ cx. sess . span_bug (
3051
+ span,
3052
+ fmt ! ( "The %uth autoderef failed: %s" ,
3053
+ i, ty_to_str( cx,
3054
+ adjusted_ty) ) ) ;
3055
+ }
3054
3056
}
3055
3057
}
3056
3058
}
Original file line number Diff line number Diff line change @@ -1108,6 +1108,12 @@ pub mod guarantor {
1108
1108
-> ExprCategorizationType {
1109
1109
let mut ct = ct;
1110
1110
let tcx = rcx. fcx . ccx . tcx ;
1111
+
1112
+ if ( ty:: type_is_error ( ct. ty ) ) {
1113
+ ct. cat . pointer = NotPointer ;
1114
+ return ct;
1115
+ }
1116
+
1111
1117
for uint:: range( 0 , autoderefs) |_| {
1112
1118
ct. cat . guarantor = guarantor_of_deref ( & ct. cat ) ;
1113
1119
You can’t perform that action at this time.
0 commit comments