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: TyKind::Error constructed but no error reported, broken MIR in DefId #83630

Closed
chengniansun opened this issue Mar 29, 2021 · 5 comments
Closed
Labels
C-bug Category: This is a bug. glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-medium Medium priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@chengniansun
Copy link

Code

static DATA: Iterator<Item = _> = "my string";

Meta

rustc --version --verbose:

rustc 1.53.0-nightly (4a20eb6a9 2021-03-28)
binary: rustc
commit-hash: 4a20eb6a9da36c88ee929826c4f1eb8d7ea393b2
commit-date: 2021-03-28
host: x86_64-unknown-linux-gnu
release: 1.53.0-nightly
LLVM version: 12.0.0

Error output

warning: trait objects without an explicit `dyn` are deprecated
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:1:14
  |
1 | static DATA: Iterator<Item = _> = "my string";
  |              ^^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn Iterator<Item = _>`
  |
  = note: `#[warn(bare_trait_objects)]` on by default

warning: static is never used: `DATA`
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:1:1
  |
1 | static DATA: Iterator<Item = _> = "my string";
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(dead_code)]` on by default

warning: 2 warnings emitted

error: internal compiler error: bad_placeholder_type
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:1:30
  |
1 | static DATA: Iterator<Item = _> = "my string";
  |                              ^
  |
  = note: delayed at compiler/rustc_typeck/src/collect.rs:370:20

error: internal compiler error: TyKind::Error constructed but no error reported
  |
  = note: delayed at /rustc/4a20eb6a9da36c88ee929826c4f1eb8d7ea393b2/compiler/rustc_trait_selection/src/opaque_types.rs:1007:32

error: internal compiler error: TyKind::Error constructed but no error reported
  |
  = note: delayed at compiler/rustc_typeck/src/check/coercion.rs:154:49

error: internal compiler error: TyKind::Error constructed but no error reported
  |
  = note: delayed at compiler/rustc_mir_build/src/build/mod.rs:737:18

error: internal compiler error: mir_const_qualif: MIR had errors
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:1:1
  |
1 | static DATA: Iterator<Item = _> = "my string";
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: delayed at compiler/rustc_mir/src/transform/mod.rs:237:18

error: internal compiler error: PromoteTemps: MIR had errors
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:1:1
  |
1 | static DATA: Iterator<Item = _> = "my string";
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: delayed at compiler/rustc_mir/src/transform/promote_consts.rs:55:22

error: internal compiler error: broken MIR in DefId(0:3 ~ perses_node_priority_with_dfs_delta_reduced_mutant[8787]::DATA) ("return type"): bad type [type error]
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:1:1
  |
1 | static DATA: Iterator<Item = _> = "my string";
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: delayed at compiler/rustc_mir/src/borrow_check/type_check/mod.rs:252:27

error: internal compiler error: TyKind::Error constructed but no error reported
  |
  = note: delayed at compiler/rustc_mir/src/borrow_check/type_check/mod.rs:721:20

error: internal compiler error: broken MIR in DefId(0:3 ~ perses_node_priority_with_dfs_delta_reduced_mutant[8787]::DATA) (LocalDecl { mutability: Mut, local_info: None, internal: false, is_block_tail: None, ty: [type error], user_ty: None, source_info: SourceInfo { span: perses_node_priority_with_dfs_delta_reduced_mutant.rs:1:1: 1:47 (#0), scope: scope[0] } }): bad type [type error]
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:1:1
  |
1 | static DATA: Iterator<Item = _> = "my string";
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: delayed at compiler/rustc_mir/src/borrow_check/type_check/mod.rs:252:27

error: internal compiler error: TyKind::Error constructed but no error reported
  |
  = note: delayed at /rustc/4a20eb6a9da36c88ee929826c4f1eb8d7ea393b2/compiler/rustc_middle/src/ty/relate.rs:334:59

thread 'rustc' panicked at 'no errors encountered even though `delay_span_bug` issued', compiler/rustc_errors/src/lib.rs:1014: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.53.0-nightly (4a20eb6a9 2021-03-28) running on x86_64-unknown-linux-gnu

note: compiler flags: -C opt-level=3 --crate-type staticlib

query stack during panic:
end of query stack
Backtrace

warning: trait objects without an explicit `dyn` are deprecated
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:1:14
  |
1 | static DATA: Iterator<Item = _> = "my string";
  |              ^^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn Iterator<Item = _>`
  |
  = note: `#[warn(bare_trait_objects)]` on by default

warning: static is never used: `DATA`
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:1:1
  |
1 | static DATA: Iterator<Item = _> = "my string";
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(dead_code)]` on by default

warning: 2 warnings emitted

error: internal compiler error: bad_placeholder_type
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:1:30
  |
1 | static DATA: Iterator<Item = _> = "my string";
  |                              ^
  |
  = note: delayed at compiler/rustc_typeck/src/collect.rs:370:20

error: internal compiler error: TyKind::Error constructed but no error reported
  |
  = note: delayed at /rustc/4a20eb6a9da36c88ee929826c4f1eb8d7ea393b2/compiler/rustc_trait_selection/src/opaque_types.rs:1007:32

error: internal compiler error: TyKind::Error constructed but no error reported
  |
  = note: delayed at compiler/rustc_typeck/src/check/coercion.rs:154:49

error: internal compiler error: TyKind::Error constructed but no error reported
  |
  = note: delayed at compiler/rustc_mir_build/src/build/mod.rs:737:18

error: internal compiler error: mir_const_qualif: MIR had errors
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:1:1
  |
1 | static DATA: Iterator<Item = _> = "my string";
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: delayed at compiler/rustc_mir/src/transform/mod.rs:237:18

error: internal compiler error: PromoteTemps: MIR had errors
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:1:1
  |
1 | static DATA: Iterator<Item = _> = "my string";
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: delayed at compiler/rustc_mir/src/transform/promote_consts.rs:55:22

error: internal compiler error: broken MIR in DefId(0:3 ~ perses_node_priority_with_dfs_delta_reduced_mutant[8787]::DATA) ("return type"): bad type [type error]
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:1:1
  |
1 | static DATA: Iterator<Item = _> = "my string";
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: delayed at compiler/rustc_mir/src/borrow_check/type_check/mod.rs:252:27

error: internal compiler error: TyKind::Error constructed but no error reported
  |
  = note: delayed at compiler/rustc_mir/src/borrow_check/type_check/mod.rs:721:20

error: internal compiler error: broken MIR in DefId(0:3 ~ perses_node_priority_with_dfs_delta_reduced_mutant[8787]::DATA) (LocalDecl { mutability: Mut, local_info: None, internal: false, is_block_tail: None, ty: [type error], user_ty: None, source_info: SourceInfo { span: perses_node_priority_with_dfs_delta_reduced_mutant.rs:1:1: 1:47 (#0), scope: scope[0] } }): bad type [type error]
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:1:1
  |
1 | static DATA: Iterator<Item = _> = "my string";
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: delayed at compiler/rustc_mir/src/borrow_check/type_check/mod.rs:252:27

error: internal compiler error: TyKind::Error constructed but no error reported
  |
  = note: delayed at /rustc/4a20eb6a9da36c88ee929826c4f1eb8d7ea393b2/compiler/rustc_middle/src/ty/relate.rs:334:59

thread 'rustc' panicked at 'no errors encountered even though `delay_span_bug` issued', compiler/rustc_errors/src/lib.rs:1014:13
stack backtrace:
   0: rust_begin_unwind
             at /rustc/4a20eb6a9da36c88ee929826c4f1eb8d7ea393b2/library/std/src/panicking.rs:493:5
   1: std::panicking::begin_panic_fmt
             at /rustc/4a20eb6a9da36c88ee929826c4f1eb8d7ea393b2/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.53.0-nightly (4a20eb6a9 2021-03-28) running on x86_64-unknown-linux-gnu

note: compiler flags: -C opt-level=3 --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 Mar 29, 2021
@chengniansun
Copy link
Author

This might be a duplicate of #83628, though this bug requires the flag -C opt-level=3.

@jonas-schievink jonas-schievink added the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Mar 29, 2021
@jyn514
Copy link
Member

jyn514 commented Mar 29, 2021

This might be a duplicate of #83628, though this bug requires the flag -C opt-level=3.

I can reproduce without -C opt-level=3, although the error is different:

Global is external, but doesn't have external or weak linkage!
{}* @_ZN10playground4DATA17h640999b0687ef15dE
LLVM ERROR: Broken module found, compilation aborted!

@jyn514
Copy link
Member

jyn514 commented Mar 29, 2021

@apiraino
Copy link
Contributor

Assigning priority as discussed as part of the Prioritization Working Group procedure and removing I-prioritize.

@rustbot label -I-prioritize +P-medium

@rustbot rustbot added P-medium Medium priority and removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Mar 31, 2021
fanninpm added a commit to fanninpm/glacier that referenced this issue Apr 2, 2021
@rust-lang-glacier-bot rust-lang-glacier-bot added the glacier ICE tracked in rust-lang/glacier. label Apr 2, 2021
@JohnTitor
Copy link
Member

Fixed by #83739.

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. glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-medium Medium priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

7 participants