opaque types, patterns and subtyping ICE: IndexMap: key not found
#104779
Closed
Description
struct Inv<'a>(&'a mut &'a ());
enum Foo<T> {
Bar,
Var(T),
}
type Subtype = Foo<for<'a, 'b> fn(Inv<'a>, Inv<'b>)>;
type Supertype = Foo<for<'a> fn(Inv<'a>, Inv<'a>)>;
fn foo() -> impl Sized {
loop {
match foo() {
Subtype::Bar => (),
Supertype::Var(x) => {}
}
}
}
results in the following ICE:
thread '<unnamed>' panicked at 'no entry found for key', compiler/rustc_borrowck/src/region_infer/mod.rs:2196:9
Metadata
Assignees
Labels
Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.Area: Variance (https://doc.rust-lang.org/nomicon/subtyping.html)Category: This is a bug.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Relevant to the types team, which will review and decide on the PR/issue.ICE tracked in rust-lang/glacier.