File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -137,16 +137,18 @@ impl<'tcx> ConstEvalErr<'tcx> {
137137 message : & str ,
138138 lint_root : Option < hir:: HirId > ,
139139 ) -> Result < DiagnosticBuilder < ' tcx > , ErrorHandled > {
140+ let mut must_error = false ;
140141 match self . error {
141142 err_inval ! ( Layout ( LayoutError :: Unknown ( _) ) ) |
142143 err_inval ! ( TooGeneric ) =>
143144 return Err ( ErrorHandled :: TooGeneric ) ,
144145 err_inval ! ( TypeckError ) =>
145146 return Err ( ErrorHandled :: Reported ) ,
147+ err_inval ! ( LayoutError :: SizeOverflow ( _) ) => must_error = true ,
146148 _ => { } ,
147149 }
148150 trace ! ( "reporting const eval failure at {:?}" , self . span) ;
149- let mut err = if let Some ( lint_root) = lint_root {
151+ let mut err = if let ( Some ( lint_root) , false ) = ( lint_root, must_error ) {
150152 let hir_id = self . stacktrace
151153 . iter ( )
152154 . rev ( )
Original file line number Diff line number Diff line change 1- error: reaching this expression at runtime will panic or abort
1+ error[E0080] : reaching this expression at runtime will panic or abort
22 --> $SRC_DIR/libcore/mem/mod.rs:LL:COL
33 |
44LL | intrinsics::size_of::<T>()
@@ -8,8 +8,7 @@ LL | intrinsics::size_of::<T>()
88 |
99LL | println!("Size: {}", std::mem::size_of::<[u8; std::u64::MAX as usize]>());
1010 | ---------------------------------------------------
11- |
12- = note: `#[deny(const_err)]` on by default
1311
1412error: aborting due to previous error
1513
14+ For more information about this error, try `rustc --explain E0080`.
You can’t perform that action at this time.
0 commit comments