Closed
Description
trait Foo {
fn foo<T>(self) -> u64;
}
impl Foo for () {
fn foo<T: 'static>(self) -> u64 {
// ^^^^^^^ this should cause an error, the bound is missing from the
// method definition in the trait, and calls are checked against that.
std::intrinsics::TypeId::of::<&'static T>().hash()
}
}
fn main() {
println!("{}", ().foo::<&()>());
}
// error: internal compiler error: non-static region found when hashing a type
Metadata
Metadata
Assignees
Labels
Area: Trait systemArea: Type systemCall for participation: Hard difficulty. Experience needed to fix: A lot.Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessHigh priorityRelevant to the compiler team, which will review and decide on the PR/issue.