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: opaque type with non-universal region substs #84919

Closed
chengniansun opened this issue May 4, 2021 · 1 comment · Fixed by #87383
Closed

ICE: opaque type with non-universal region substs #84919

chengniansun opened this issue May 4, 2021 · 1 comment · Fixed by #87383
Labels
C-bug Category: This is a bug. F-impl_trait_in_bindings `#![feature(impl_trait_in_bindings)]` 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

@chengniansun
Copy link

Code

#![feature(impl_trait_in_bindings)]
struct A<'a>(&'a ());
trait Trait<T> {}
impl<T> Trait<T> for () {}
fn foo<'a: 'a>() {
    let _x: impl Trait<A<'a>> = ();
}

Meta

rustc --version --verbose:

rustc 1.54.0-nightly (716394d65 2021-05-03)
binary: rustc
commit-hash: 716394d6581b60c75cfdd88b8e5b876f2db88b62
commit-date: 2021-05-03
host: x86_64-unknown-linux-gnu
release: 1.54.0-nightly
LLVM version: 12.0.0

Error output

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

warning: struct is never constructed: `A`
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:2:8
  |
2 | struct A<'a>(&'a ());
  |        ^
  |
  = note: `#[warn(dead_code)]` on by default

warning: function is never used: `foo`
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:5:4
  |
5 | fn foo<'a: 'a>() {
  |    ^^^

warning: 3 warnings emitted

error: internal compiler error: opaque type with non-universal region substs
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:5:1
  |
5 | / fn foo<'a: 'a>() {
6 | |     let _x: impl Trait<A<'a>> = ();
7 | | }
  | |_^
  |
  = note: delayed at compiler/rustc_mir/src/borrow_check/region_infer/opaque_types.rs:68:48

thread 'rustc' panicked at 'no errors encountered even though `delay_span_bug` issued', compiler/rustc_errors/src/lib.rs:1018:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

error: internal compiler error: unexpected panic

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.54.0-nightly (716394d65 2021-05-03) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type staticlib

query stack during panic:
end of query stack
Backtrace

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

warning: struct is never constructed: `A`
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:2:8
  |
2 | struct A<'a>(&'a ());
  |        ^
  |
  = note: `#[warn(dead_code)]` on by default

warning: function is never used: `foo`
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:5:4
  |
5 | fn foo<'a: 'a>() {
  |    ^^^

warning: 3 warnings emitted

error: internal compiler error: opaque type with non-universal region substs
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:5:1
  |
5 | / fn foo<'a: 'a>() {
6 | |     let _x: impl Trait<A<'a>> = ();
7 | | }
  | |_^
  |
  = note: delayed at compiler/rustc_mir/src/borrow_check/region_infer/opaque_types.rs:68:48

thread 'rustc' panicked at 'no errors encountered even though `delay_span_bug` issued', compiler/rustc_errors/src/lib.rs:1018:13
stack backtrace:
   0: rust_begin_unwind
             at /rustc/716394d6581b60c75cfdd88b8e5b876f2db88b62/library/std/src/panicking.rs:493:5
   1: std::panicking::begin_panic_fmt
             at /rustc/716394d6581b60c75cfdd88b8e5b876f2db88b62/library/std/src/panicking.rs:435:5
   2: rustc_errors::HandlerInner::flush_delayed
   3: <rustc_errors::HandlerInner as core::ops::drop::Drop>::drop
   4: core::ptr::drop_in_place<rustc_session::parse::ParseSess>
   5: <alloc::rc::Rc<T> as core::ops::drop::Drop>::drop
   6: core::ptr::drop_in_place<rustc_interface::interface::Compiler>
   7: rustc_span::with_source_map
   8: rustc_interface::interface::create_compiler_and_run
   9: scoped_tls::ScopedKey<T>::set
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: internal compiler error: unexpected panic

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.54.0-nightly (716394d65 2021-05-03) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type staticlib

query stack during panic:
end of query stack

@chengniansun chengniansun 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 May 4, 2021
@jonas-schievink jonas-schievink added the F-impl_trait_in_bindings `#![feature(impl_trait_in_bindings)]` label May 4, 2021
@jyn514
Copy link
Member

jyn514 commented May 4, 2021

Slightly smaller:

#![feature(impl_trait_in_bindings)]

trait Trait {}
impl Trait for () {}

fn foo<'a: 'a>() {
    let _x: impl Trait = ();
}

@rust-lang-glacier-bot rust-lang-glacier-bot added the glacier ICE tracked in rust-lang/glacier. label May 13, 2021
JohnTitor added a commit to JohnTitor/rust that referenced this issue Jul 23, 2021
…sts, r=oli-obk

Add regression tests for the impl_trait_in_bindings ICEs

Closes rust-lang#54600, closes rust-lang#54840, closes rust-lang#58504, closes rust-lang#58956, closes rust-lang#70971, closes rust-lang#79099, closes rust-lang#84919, closes rust-lang#86201, closes rust-lang#86642, closes rust-lang#87295

r? `@oli-obk`
@bors bors closed this as completed in 7c0c329 Jul 23, 2021
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. F-impl_trait_in_bindings `#![feature(impl_trait_in_bindings)]` 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.

4 participants