-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-impl-traitArea: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.C-bugCategory: This is a bug.Category: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-highHigh priorityHigh priorityT-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.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
Description
all of the following examples result in the same ICE and should imo all be added as test cases once this is fixed:
this one should pass
fn foo<'a: 'a>() -> impl Sized {
let _: () = foo::<'a>();
loop {}
}
this one should error afaik
fn foo<'a: 'a>() -> impl Sized {
let _: *mut &'a () = foo::<'a>();
loop {}
}
this one should pass
fn foo<'a: 'a>() -> impl Sized + 'a {
let _: *mut &'a () = foo::<'a>();
loop {}
}
this one should error
trait Trait<'a, 'b> {}
impl<'a, 'b, T> Trait<'a, 'b> for T {}
fn foo<'a: 'a, 'b: 'b>() -> impl Trait<'a, 'b> {
let _: *mut &'a () = foo::<'a, 'b>();
let _: *mut &'b () = foo::<'a, 'b>();
loop {}
}
they all ICE with
rror: internal compiler error: no errors encountered even though `delay_span_bug` issued
error: internal compiler error: opaque type with non-universal region substs
--> src/lib.rs:2:12
|
2 | let _: () = foo::<'a>();
| ^^
|
= note: delayed at compiler/rustc_borrowck/src/region_infer/opaque_types.rs:94:35
Metadata
Metadata
Assignees
Labels
A-impl-traitArea: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.C-bugCategory: This is a bug.Category: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-highHigh priorityHigh priorityT-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.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.