Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

opaque types, patterns and subtyping ICE: IndexMap: key not found #104779

Closed
lcnr opened this issue Nov 23, 2022 · 3 comments · Fixed by #122943
Closed

opaque types, patterns and subtyping ICE: IndexMap: key not found #104779

lcnr opened this issue Nov 23, 2022 · 3 comments · Fixed by #122943
Labels
A-impl-trait Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch. A-variance Area: Variance (https://doc.rust-lang.org/nomicon/subtyping.html) C-bug Category: This is a bug. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-types Relevant to the types team, which will review and decide on the PR/issue.

Comments

@lcnr
Copy link
Contributor

lcnr commented Nov 23, 2022

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

(playground)

@lcnr lcnr added I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ A-impl-trait Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch. C-bug Category: This is a bug. A-variance Area: Variance (https://doc.rust-lang.org/nomicon/subtyping.html) T-types Relevant to the types team, which will review and decide on the PR/issue. labels Nov 23, 2022
@ouz-a
Copy link
Contributor

ouz-a commented Dec 12, 2022

This gave error till 1.62 https://godbolt.org/z/b9M8s6vWb after that it started ICEing with different error message.

@rust-lang-glacier-bot rust-lang-glacier-bot added the glacier ICE tracked in rust-lang/glacier. label Dec 20, 2022
@matthiaskrgr
Copy link
Member

This now crashes with thread 'rustc' panicked at 'IndexMap: key not found', compiler/rustc_borrowck/src/region_infer/mod.rs:2227:9

@matthiaskrgr matthiaskrgr changed the title opaque types, patterns and subtyping ICE opaque types, patterns and subtyping ICE: IndexMap: key not found Apr 7, 2023
@JohnTitor
Copy link
Member

Triage: Fixed on the latest nightly, marked as E-needs-test
@rustbot labels: +E-needs-test

@rustbot rustbot added the E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. label Oct 10, 2023
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Mar 23, 2024
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Mar 23, 2024
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Mar 24, 2024
workingjubilee added a commit to workingjubilee/rustc that referenced this issue Mar 24, 2024
@bors bors closed this as completed in e54bff7 Mar 24, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Mar 24, 2024
Rollup merge of rust-lang#122943 - matthiaskrgr:ice-tests-9xxxx-to-12xxxx, r=fmease

add a couple more ice tests

Fixes rust-lang#104779
Fixes rust-lang#106423
Fixes rust-lang#106444
Fixes rust-lang#101852
Fixes rust-lang#106874
Fixes rust-lang#105047
Fixes rust-lang#107228
Fixes rust-lang#99945
RenjiSann pushed a commit to RenjiSann/rust that referenced this issue Mar 25, 2024
RenjiSann pushed a commit to RenjiSann/rust that referenced this issue Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-impl-trait Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch. A-variance Area: Variance (https://doc.rust-lang.org/nomicon/subtyping.html) C-bug Category: This is a bug. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-types Relevant to the types team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants