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

const generics lifetime ICE #74447

Closed
lcnr opened this issue Jul 17, 2020 · 2 comments · Fixed by #76739
Closed

const generics lifetime ICE #74447

lcnr opened this issue Jul 17, 2020 · 2 comments · Fixed by #76739
Assignees
Labels
A-const-generics Area: const generics (parameters and arguments) C-bug Category: This is a bug. F-const_generics `#![feature(const_generics)]` glacier ICE tracked in rust-lang/glacier. 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

@lcnr
Copy link
Contributor

lcnr commented Jul 17, 2020

#![feature(const_generics)]

fn test<const N: usize>() {}

fn wow<'a>() {
    test::<{
        let _: &'a ();
        3
    }>();
}

results in

warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
 --> src/lib.rs:1:12
  |
1 | #![feature(const_generics)]
  |            ^^^^^^^^^^^^^^
  |
  = note: `#[warn(incomplete_features)]` on by default
  = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information

error: internal compiler error: src/librustc_mir/borrow_check/universal_regions.rs:768:36: cannot convert `ReFree(DefId(0:5 ~ playground[38a3]::wow[0]), BrNamed(DefId(0:6 ~ playground[38a3]::wow[0]::'a[0]), 'a))` to a region vid

thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:916:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

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

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.46.0-nightly (5c9e5df3a 2020-07-16) running on x86_64-unknown-linux-gnu

note: compiler flags: -C embed-bitcode=no -C codegen-units=1 -C debuginfo=2 --crate-type lib

note: some of the compiler flags provided by cargo are hidden

error: aborting due to previous error; 1 warning emitted
@lcnr lcnr added A-const-generics Area: const generics (parameters and arguments) F-const_generics `#![feature(const_generics)]` labels Jul 17, 2020
@lcnr lcnr changed the title const generics lt ICE const generics lifetime ICE Jul 17, 2020
@matthiaskrgr
Copy link
Member

Could this be a duplicate of #73375 ?

@lcnr
Copy link
Contributor Author

lcnr commented Jul 17, 2020

👍 This probably has the same fix. I do think that the issues are different enough to keep this one open though

@JohnTitor JohnTitor 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. labels Jul 18, 2020
@rust-lang-glacier-bot rust-lang-glacier-bot added the glacier ICE tracked in rust-lang/glacier. label Jul 18, 2020
@davidtwco davidtwco self-assigned this Sep 15, 2020
@bors bors closed this as completed in c8eb205 Oct 2, 2020
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. F-const_generics `#![feature(const_generics)]` glacier ICE tracked in rust-lang/glacier. 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.

6 participants