Skip to content

dtorck encountered internal error #89574

Closed
@rusty-snake

Description

@rusty-snake

Code

fn main() {
    const EMPTY_ARRAY = [];
}

Meta

Reproducible with stable and nightly compilers.

rustc --version --verbose:

rustc 1.55.0 (c8dfcfe04 2021-09-06)
binary: rustc
commit-hash: c8dfcfe046a7680554bf4eb612bad840e7631c4b
commit-date: 2021-09-06
host: x86_64-unknown-linux-gnu
release: 1.55.0
LLVM version: 12.0.1

rustc +nightly --version --verbose:

rustc 1.57.0-nightly (003d8d3f5 2021-10-04)
binary: rustc
commit-hash: 003d8d3f56848b6f3833340e859b089a09aea36a
commit-date: 2021-10-04
host: x86_64-unknown-linux-gnu
release: 1.57.0-nightly
LLVM version: 13.0.0

Maybe this is a duplicated of #72821 but I'm not sure as the example there is more complex.

Error output

rustc --edition=2018 -O ice.rs:

error: internal compiler error: dtorck encountered internal error
 --> ice.rs:2:25
  |
2 |     const EMPTY_ARRAY = [];
  |                         ^^
  |
  = note: delayed at compiler/rustc_trait_selection/src/traits/query/dropck_outlives.rs:67:18

error: internal compiler error: TyKind::Error constructed but no error reported
  |
  = note: delayed at compiler/rustc_infer/src/infer/resolve.rs:201:32

error: internal compiler error: TyKind::Error constructed but no error reported
  |
  = note: delayed at compiler/rustc_typeck/src/check/writeback.rs:753:28

error: internal compiler error: missing type for `const` item
 --> ice.rs:2:11
  |
2 |     const EMPTY_ARRAY = [];
  |           ^^^^^^^^^^^ help: provide a type for the constant: `EMPTY_ARRAY: [type error]`

thread 'rustc' panicked at 'no errors encountered even though `delay_span_bug` issued', compiler/rustc_errors/src/lib.rs:1050: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.55.0 (c8dfcfe04 2021-09-06) running on x86_64-unknown-linux-gnu

query stack during panic:
end of query stack
Backtrace

thread 'rustc' panicked at 'no errors encountered even though `delay_span_bug` issued', compiler/rustc_errors/src/lib.rs:1050:13
stack backtrace:
   0: rust_begin_unwind
             at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:515:5
   1: std::panicking::begin_panic_fmt
             at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:457: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.

Metadata

Metadata

Assignees

Labels

A-destructorsArea: Destructors (`Drop`, …)C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-highHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions