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

type_name ICE #61894

Closed
quininer opened this issue Jun 16, 2019 · 3 comments · Fixed by #61998
Closed

type_name ICE #61894

quininer opened this issue Jun 16, 2019 · 3 comments · Fixed by #61998
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-high High priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@quininer
Copy link
Contributor

struct Bar<M>(M);

impl<M> Bar<M> {
    fn foo(&self) {
        fn f() {}
        fn type_name_of<T>(_: T) -> &'static str {
            unsafe { type_name::<T>() }
        }
        type_name_of(f);
    }
}

https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=c27b41def12af0276d04e418f0e50b07

I believe this happened after #60166.

@jonas-schievink jonas-schievink added C-bug Category: This is a bug. 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. I-nominated labels Jun 16, 2019
@pnkfelix
Copy link
Member

triage: P-high because it blocks presumed stabilization of type_name (#60066). Removing nomination tag.

@eddyb
Copy link
Member

eddyb commented Jun 20, 2019

@oli-obk you can have parameterization in scope that's not part of monomorphization (like the M above).
For name mangling (with the new scheme) we produce something that demangles to _ in that case.
We could use _ in this case too.

@pnkfelix pnkfelix added P-high High priority and removed I-nominated labels Jun 20, 2019
@eddyb
Copy link
Member

eddyb commented Jun 20, 2019

I'm working on a fix that uses _.

bors added a commit that referenced this issue Jun 20, 2019
rustc_mir: support type parameters by printing them as `_`.

Fixes #61894.
r? @oli-obk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-high High priority 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