Open
Description
trait Trait {
type Assoc;
}
struct Inv<'a>(&'a mut &'a ());
impl<'a, 'b: 'a> Trait for Inv<'a> {
// This must error as normalization has to be a function.
//
// Normalizing to two different types, even if they only differ
// by regions, is unsound.
type Assoc = &'b str;
}
fn identity<T: Trait<Assoc = &'static str>>(x: T::Assoc) -> &'static str {
x
}
fn dangle() -> &'static str {
let temp = String::from("temporary");
identity::<Inv<'_>>(temp.as_str())
}
fn main() {
println!("{:?}", dangle());
}
Metadata
Metadata
Assignees
Labels
No labels