Skip to content

Commit 456e12e

Browse files
committed
mir-borrowck: Panic when trying to print a field access on a non-box type that is neither Adt nor tuple
1 parent 7bdf177 commit 456e12e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/librustc_mir/borrow_check.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1178,8 +1178,10 @@ impl<'c, 'b, 'a: 'b+'c, 'gcx, 'tcx: 'a> MirBorrowckCtxt<'c, 'b, 'a, 'gcx, 'tcx>
11781178
format!("{}", field_index)
11791179
},
11801180
_ => {
1181-
debug!("End-user description not implemented for field of type {:?}", ty.sty);
1182-
format!("<ty>{}", field_index)
1181+
// Might need a revision when the fields in trait RFC is implemented
1182+
// (https://github.com/rust-lang/rfcs/pull/1546)
1183+
bug!("Field access unsupported for non-box types that are neither Adt (struct, \
1184+
enum, union) nor tuples");
11831185
}
11841186
}
11851187
}

0 commit comments

Comments
 (0)