File tree 2 files changed +5
-4
lines changed
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> {
137
137
message : & str ,
138
138
lint_root : Option < hir:: HirId > ,
139
139
) -> Result < DiagnosticBuilder < ' tcx > , ErrorHandled > {
140
+ let mut must_error = false ;
140
141
match self . error {
141
142
err_inval ! ( Layout ( LayoutError :: Unknown ( _) ) ) |
142
143
err_inval ! ( TooGeneric ) =>
143
144
return Err ( ErrorHandled :: TooGeneric ) ,
144
145
err_inval ! ( TypeckError ) =>
145
146
return Err ( ErrorHandled :: Reported ) ,
147
+ err_inval ! ( LayoutError :: SizeOverflow ( _) ) => must_error = true ,
146
148
_ => { } ,
147
149
}
148
150
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 ) {
150
152
let hir_id = self . stacktrace
151
153
. iter ( )
152
154
. 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
2
2
--> $SRC_DIR/libcore/mem/mod.rs:LL:COL
3
3
|
4
4
LL | intrinsics::size_of::<T>()
@@ -8,8 +8,7 @@ LL | intrinsics::size_of::<T>()
8
8
|
9
9
LL | println!("Size: {}", std::mem::size_of::<[u8; std::u64::MAX as usize]>());
10
10
| ---------------------------------------------------
11
- |
12
- = note: `#[deny(const_err)]` on by default
13
11
14
12
error: aborting due to previous error
15
13
14
+ For more information about this error, try `rustc --explain E0080`.
You can’t perform that action at this time.
0 commit comments