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: panicked at 'no errors encountered even though delay_span_bug issued', compiler/rustc_errors/src/lib.rs:958:13 #78652

Closed
chengniansun opened this issue Nov 2, 2020 · 1 comment
Labels
A-const-fn Area: const fn foo(..) {..}. Pure functions which can be applied at compile time. A-stability Area: `#[stable]`, `#[unstable]` etc. 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) ❄️ requires-nightly This issue requires a nightly compiler in some way. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@chengniansun
Copy link

Code

#![unstable(feature = "humans", issue = "none")]
#![feature(staged_api)]
struct Foo;
impl Foo {
    #[stable(feature = "rust1", since = "1.0.0")]
    const fn gated() -> u32 {
        42
    }
}

Meta

rustc --version --verbose:

rustc 1.49.0-nightly (4f7612ac1 2020-10-31)
binary: rustc
commit-hash: 4f7612ac1499258025077f1fd05d2f429f9accfb
commit-date: 2020-10-31
host: x86_64-unknown-linux-gnu
release: 1.49.0-nightly

Error output

warning: struct is never constructed: `Foo`
 --> reduced_mutant.rs:3:8
  |
3 | struct Foo;
  |        ^^^
  |
  = note: `#[warn(dead_code)]` on by default

warning: associated function is never used: `gated`
 --> reduced_mutant.rs:6:14
  |
6 |     const fn gated() -> u32 {
  |              ^^^^^

warning: 2 warnings emitted

error: internal compiler error: stable const functions must have either `rustc_const_stable` or `rustc_const_unstable` attribute
 --> reduced_mutant.rs:6:5
  |
6 |     const fn gated() -> u32 {
  |     ^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: delayed at compiler/rustc_mir/src/const_eval/fn_queries.rs:53:34

thread 'rustc' panicked at 'no errors encountered even though `delay_span_bug` issued', compiler/rustc_errors/src/lib.rs:958: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.49.0-nightly (4f7612ac1 2020-10-31) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type staticlib

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:958:13
stack backtrace:
   0: rust_begin_unwind
             at /rustc/4f7612ac1499258025077f1fd05d2f429f9accfb/library/std/src/panicking.rs:495:5
   1: std::panicking::begin_panic_fmt
             at /rustc/4f7612ac1499258025077f1fd05d2f429f9accfb/library/std/src/panicking.rs:437:5
   2: rustc_errors::HandlerInner::flush_delayed
   3: <rustc_errors::HandlerInner as core::ops::drop::Drop>::drop
   4: core::ptr::drop_in_place
   5: <alloc::rc::Rc<T> as core::ops::drop::Drop>::drop
   6: core::ptr::drop_in_place
   7: rustc_span::with_source_map
   8: scoped_tls::ScopedKey<T>::set

NOTE: The bug is found by our work-in-progress compiler testing tool Kira, and the test program is reduced/minimized by Perses

@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 Nov 2, 2020
@jonas-schievink jonas-schievink added A-const-fn Area: const fn foo(..) {..}. Pure functions which can be applied at compile time. A-stability Area: `#[stable]`, `#[unstable]` etc. requires-nightly This issue requires a nightly compiler in some way. labels Nov 2, 2020
@rust-lang-glacier-bot rust-lang-glacier-bot added the glacier ICE tracked in rust-lang/glacier. label Nov 8, 2020
@JohnTitor
Copy link
Member

Panicking has been removed by #84547. I'm going to just close this as it's an internal attribute hence a regression test doesn't make much sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-const-fn Area: const fn foo(..) {..}. Pure functions which can be applied at compile time. A-stability Area: `#[stable]`, `#[unstable]` etc. 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) ❄️ requires-nightly This issue requires a nightly compiler in some way. 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

4 participants