Skip to content

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

Closed
@matthiaskrgr

Description

@matthiaskrgr

auto-reduced (treereduce-rust):

struct S0<T>();

impl<T> S0<T> {
    fn foo() {
        fn bar<T2>() -> S0<T2> {
            Self()
        }
    }
}

original:

code from #117246

use std::marker::PhantomData;

struct S0<T>(PhantomData<T>);

impl<T> S0<T> {
    fn foo() {
        fn bar<T2>() -> S0<T2> {
            Self(PhantomData) // <~ this constructs S0<T> not S0<T2> :(
        }
    }
}

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.requires-debug-assertionsThis issue requires a build of rustc or tooling with debug-assertions in some way

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions