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
cc @nikomatsakis
cc @nikomatsakis