-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
C-bugCategory: This is a bug.Category: This is a bug.F-type_alias_impl_trait`#[feature(type_alias_impl_trait)]``#[feature(type_alias_impl_trait)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.glacierICE tracked in rust-lang/glacier.ICE tracked in rust-lang/glacier.requires-nightlyThis issue requires a nightly compiler in some way.This issue requires a nightly compiler in some way.
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
C-bugCategory: This is a bug.Category: This is a bug.F-type_alias_impl_trait`#[feature(type_alias_impl_trait)]``#[feature(type_alias_impl_trait)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.glacierICE tracked in rust-lang/glacier.ICE tracked in rust-lang/glacier.requires-nightlyThis issue requires a nightly compiler in some way.This issue requires a nightly compiler in some way.
Type
Projects
Status
Done