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

Stable 1.34.0 compiler panic unexpected const parent in type_of_def_id() #60704

Closed
pantaloons opened this issue May 10, 2019 · 3 comments · Fixed by #60710
Closed

Stable 1.34.0 compiler panic unexpected const parent in type_of_def_id() #60704

pantaloons opened this issue May 10, 2019 · 3 comments · Fixed by #60710
Assignees
Labels
A-const-generics Area: const generics (parameters and arguments) 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.

Comments

@pantaloons
Copy link

pantaloons commented May 10, 2019

Following code sample causes a compiler panic. <32> should be <u32>.

use std::convert::TryInto;

fn main() {
    let x: u32 = 5i32.try_into::<32>().unwrap();
}
error: internal compiler error: src/librustc_typeck/collect.rs:1320: unexpected const parent in type_of_def_id(): Expr(expr(2289: entry.portfolio_id.try_into::<>()))

thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:620:9
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
error: aborting due to previous error


note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.34.0 (91856ed52 2019-04-10) running on x86_64-unknown-linux-gnu

note: compiler flags: -C opt-level=3 -C debuginfo=2 -C linker=external/ts_cc/gcc5/bin/x86_64-unknown-linux-gnu-gcc -C link-args=-lstdc++ -lm -Wl,-no-as-needed -Wl,-z,relro,-z,now -pass-exit-codes -Wl,-fuse-ld=gold -L/usr/lib/x86_64-linux-gnu -L/lib/x86_64-linux-gnu -Wl,--gc-sections -static-libgcc --crate-type rlib
@jonas-schievink jonas-schievink added A-const-generics Area: const generics (parameters and arguments) 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 May 10, 2019
@jonas-schievink
Copy link
Contributor

jonas-schievink commented May 10, 2019

Also happens on nightly. Likely due to const generics changes (cc @varkor).

@Centril
Copy link
Contributor

Centril commented May 10, 2019

Minimal reproduction:

struct S;

fn main() {
    S.f::<0>();
}

@Centril
Copy link
Contributor

Centril commented May 10, 2019

Another case:

struct S;

fn main() {
    S::<0>;
}

Centril added a commit to Centril/rust that referenced this issue May 13, 2019
… r=matthewjasper

Use `delay_span_bug` for error cases when checking `AnonConst` parent

Fixes rust-lang#60704.
Fixes rust-lang#60650.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-const-generics Area: const generics (parameters and arguments) 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.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants