Closed
Description
The following code runs and prints random values:
#![feature(type_alias_impl_trait)]
type X<'a> = impl Into<&'static str> + From<&'a str>;
fn f<'a: 'static>(t: &'a str) -> X<'a> {
t
}
fn extend_lt<'a>(o: &'a str) -> &'static str {
X::<'_>::from(o).into()
}
fn main() {
let r =
{
let s = "abcdef".to_string();
extend_lt(&s)
};
println!("{}", r);
}
ICE using the same issue
#![feature(type_alias_impl_trait)]
type X<T> = impl Clone;
fn f<T: Clone>(t: T) -> X<T> {
t
}
fn g<T>(o : Option<X<T>>) -> Option<X<T>> {
o.clone()
}
fn main() {
g(None::<X<&mut ()>>);
}
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done