gracefully handle type-too-large layout errors
This commit is contained in:
parent
cf5e75389d
commit
a0ac13d8a1
@ -182,10 +182,8 @@ pub fn report_error<'tcx, 'mir>(
|
||||
"Undefined Behavior",
|
||||
ResourceExhaustion(_) =>
|
||||
"resource exhaustion",
|
||||
InvalidProgram(InvalidProgramInfo::ReferencedConstant) =>
|
||||
InvalidProgram(InvalidProgramInfo::AlreadyReported(_) | InvalidProgramInfo::Layout(..)) =>
|
||||
"post-monomorphization error",
|
||||
InvalidProgram(InvalidProgramInfo::AlreadyReported(_)) =>
|
||||
"error occurred",
|
||||
kind =>
|
||||
bug!("This error should be impossible in Miri: {:?}", kind),
|
||||
};
|
||||
|
@ -12,7 +12,7 @@ impl<T> PrintName<T> {
|
||||
|
||||
fn no_codegen<T>() {
|
||||
if false {
|
||||
let _ = PrintName::<T>::VOID; //~ERROR error occurred: encountered constant
|
||||
let _ = PrintName::<T>::VOID; //~ERROR post-monomorphization error
|
||||
}
|
||||
}
|
||||
fn main() {
|
||||
|
6
tests/compile-fail/type-too-large.rs
Normal file
6
tests/compile-fail/type-too-large.rs
Normal file
@ -0,0 +1,6 @@
|
||||
// ignore-32bit
|
||||
|
||||
fn main() {
|
||||
let _fat: [u8; (1<<61)+(1<<31)] =
|
||||
[0; (1u64<<61) as usize +(1u64<<31) as usize]; //~ ERROR post-monomorphization error
|
||||
}
|
Loading…
Reference in New Issue
Block a user