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

ICE: param types with same index differ in name #121314

Closed
matthiaskrgr opened this issue Feb 19, 2024 · 2 comments · Fixed by #121323
Closed

ICE: param types with same index differ in name #121314

matthiaskrgr opened this issue Feb 19, 2024 · 2 comments · Fixed by #121323
Assignees
Labels
A-type-system Area: Type system C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ requires-debug-assertions This issue requires a build of rustc or tooling with debug-assertions in some way T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@matthiaskrgr
Copy link
Member

auto-reduced (treereduce-rust):

use std::collections::VecDeque;

pub fn yes_vecdeque_partial_eq_ref_mut_array<'a, A, B>() -> impl PartialEq {
    VecDeque::<A>::q_user()
}

original:

//@ check-pass

pub fn yes_vec_partial_eq_array<A, B>() -> impl PartialEq<[B; 32]>
where
    A: PartialEq<B>,
{
    Vec::<A>::new()
}

pub fn yes_vec_partial_eq_ref_array<'a, A, B>() -> impl PartialEq<&'a [B; 32]>
where
        Inner2: Default,
{
    Vec::<A>::new()
}

pub fn yes_array_into_vec<T>() -> Vec<T> {
    [].into()
}

pub fn yes_array_into_box<T>() -> Box<[T]> {
    [].into()
}

use std::collections::VecDeque;

pub fn yes_vecdeque_partial_eq_array<A, B>() -> impl PartialEq<[B; 32]>
where
    A: PartialEq<B>,
{
    VecDeque::<A>::new()
}

pub fn yes_vecdeque_partial_eq_ref_array<'a, A, B>() -> impl PartialEq<&'a [B; 32]>
where
    A: PartialEq<B>,
{
    VecDeque::<A>::new()
}

pub fn yes_vecdeque_partial_eq_ref_mut_array<'a, A, B>() -> impl PartialEq<&'writes_to_path mut [B; tokenize]>
where
    A: PartialEq<B>,
{
    VecDeque::<A>::q_user()
}

fn main() {}

Version information

rustc 1.78.0-dev
binary: rustc
commit-hash: unknown
commit-date: unknown
host: x86_64-unknown-linux-gnu
release: 1.78.0-dev
LLVM version: 18.1.0

Command:
/home/matthias/.rustup/toolchains/local-debug-assertions/bin/rustc

@matthiaskrgr matthiaskrgr added I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. C-bug Category: This is a bug. requires-debug-assertions This issue requires a build of rustc or tooling with debug-assertions in some way labels Feb 19, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Feb 19, 2024
@matthiaskrgr
Copy link
Member Author

stacktrace.txt

@jieyouxu jieyouxu added A-type-system Area: Type system and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Feb 19, 2024
@compiler-errors compiler-errors self-assigned this Feb 20, 2024
@compiler-errors
Copy link
Member

thanks for the stack trace @matthiaskrgr. for this class of ICEs, it's just the right thing that I need.

Minimal:

fn hello<Q>() -> Vec<Q> {
    Vec::<Q>::nex()
}

@bors bors closed this as completed in e3ff2a8 Feb 21, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Feb 21, 2024
Rollup merge of rust-lang#121323 - compiler-errors:raw-param-types, r=oli-obk

Don't use raw parameter types in `find_builder_fn`

We shouldn't really ever be using `EarlyBinder::skip_binder` then performing type equality, since param types will never be equal to other types. When checking compatibility with the signature, we instead create some fresh args.

Fixes rust-lang#121314
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-type-system Area: Type system C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ requires-debug-assertions This issue requires a build of rustc or tooling with debug-assertions in some way T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants