Closed
Description
Consider:
#![allow(const_err)]
union Trans { i: usize, o: &'static u32 }
const C: () = unsafe { let _val = *Trans { i: 4 }.o; () };
fn main() {
println!("{:?}", C);
}
This deref's a dangling pointer, but due to allow(const_err)
the only diagnostic we get is
error[E0080]: evaluation of constant expression failed
--> src/main.rs:8:22
|
8 | println!("{:?}", C);
| ^ referenced constant has errors
error: aborting due to previous error
Making this an allowable lint is not very helpful when later follow-on errors are hard errors.