Closed
Description
This code:
pub trait Foo {
fn foo(self) -> u32;
}
impl<T> Foo for T {
fn foo(self) -> u32 {
fn bar<T>() { loop {} }
bar::<T> as u32
}
}
when compiled yields:
$ rustc +nightly foo.rs --crate-type lib
error: this expression will panic at runtime
--> foo.rs:8:9
|
8 | bar::<T> as u32
| ^^^^^^^^^^^^^^^ a raw memory access tried to access part of a pointer value as raw bytes
|
= note: #[deny(const_err)] on by default
error: aborting due to previous error
but it compiles on stable/beta!
cc @oli-obk, you may know where this is coming from?