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: all diagnostics with unstable expectations should have been converted, compiler/rustc_errors/src/lib.rs: Zunpretty=expanded #94953

Closed
matthiaskrgr opened this issue Mar 15, 2022 · 3 comments · Fixed by #95542
Assignees
Labels
C-bug Category: This is a bug. F-lint_reasons `#![feature(lint_reasons)]` 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

@matthiaskrgr
Copy link
Member

matthiaskrgr commented Mar 15, 2022

Code

code reduced from ./src/test/ui/lint/rfc-2383-lint-reason/catch_multiple_lint_triggers.rs

#![feature(lint_reasons)]
#![warn(unused)]

// This expect attribute should catch all lint triggers
#[expect(while_true)]
fn check_multiple_lints_3() {
    // `while_true` is an early lint
    while true {}
}

fn main() {
    check_multiple_lints_3();
}

Meta

rustc --version --verbose:

rustc 1.61.0-nightly (984204814 2022-03-15)
binary: rustc
commit-hash: 984204814e00f60c5e1ec99e2e184f326782a586
commit-date: 2022-03-15
host: x86_64-unknown-linux-gnu
release: 1.61.0-nightly
LLVM version: 14.0.0

Error output

rustc ./src/test/ui/lint/rfc-2383-lint-reason/catch_multiple_lint_triggers.rs -Zunpretty=expanded

#![feature(prelude_import)]
#![no_std]
#![feature(lint_reasons)]
#![warn(unused)]
#[prelude_import]
use ::std::prelude::rust_2015::*;
#[macro_use]
extern crate std;

// This expect attribute should catch all lint triggers
#[expect(while_true)]
fn check_multiple_lints_3() {
    // `while_true` is an early lint
    while true {}
}

fn main() { check_multiple_lints_3(); }
thread 'rustc' panicked at 'all diagnostics with unstable expectations should have been converted', compiler/rustc_errors/src/lib.rs:526:9
Backtrace

thread 'rustc' panicked at 'all diagnostics with unstable expectations should have been converted', compiler/rustc_errors/src/lib.rs:526:9
stack backtrace:
   0:     0x7f286389d9bd - std::backtrace_rs::backtrace::libunwind::trace::h54886a1164a7b8fb
                               at /rustc/984204814e00f60c5e1ec99e2e184f326782a586/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f286389d9bd - std::backtrace_rs::backtrace::trace_unsynchronized::he854c2b32e77ff7e
                               at /rustc/984204814e00f60c5e1ec99e2e184f326782a586/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f286389d9bd - std::sys_common::backtrace::_print_fmt::hd8bb5f879f142dc0
                               at /rustc/984204814e00f60c5e1ec99e2e184f326782a586/library/std/src/sys_common/backtrace.rs:66:5
   3:     0x7f286389d9bd - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hd3783bf6865fe700
                               at /rustc/984204814e00f60c5e1ec99e2e184f326782a586/library/std/src/sys_common/backtrace.rs:45:22
   4:     0x7f28638f749c - core::fmt::write::h0fa4e88310144d54
                               at /rustc/984204814e00f60c5e1ec99e2e184f326782a586/library/core/src/fmt/mod.rs:1190:17
   5:     0x7f286388ef41 - std::io::Write::write_fmt::h472eaf13ee1972d3
                               at /rustc/984204814e00f60c5e1ec99e2e184f326782a586/library/std/src/io/mod.rs:1655:15
   6:     0x7f28638a0a35 - std::sys_common::backtrace::_print::hc85703a6308b862d
                               at /rustc/984204814e00f60c5e1ec99e2e184f326782a586/library/std/src/sys_common/backtrace.rs:48:5
   7:     0x7f28638a0a35 - std::sys_common::backtrace::print::h6bcb363532ec1b51
                               at /rustc/984204814e00f60c5e1ec99e2e184f326782a586/library/std/src/sys_common/backtrace.rs:35:9
   8:     0x7f28638a0a35 - std::panicking::default_hook::{{closure}}::h891429645691f6ae
                               at /rustc/984204814e00f60c5e1ec99e2e184f326782a586/library/std/src/panicking.rs:295:22
   9:     0x7f28638a06e9 - std::panicking::default_hook::hd27e62e5b1c07288
                               at /rustc/984204814e00f60c5e1ec99e2e184f326782a586/library/std/src/panicking.rs:314:9
  10:     0x7f28640c9751 - rustc_driver[7399fb507d3e2f76]::DEFAULT_HOOK::{closure#0}::{closure#0}
  11:     0x7f28638a1180 - std::panicking::rust_panic_with_hook::hd570d8c27288e13c
                               at /rustc/984204814e00f60c5e1ec99e2e184f326782a586/library/std/src/panicking.rs:702:17
  12:     0x7f28638a0f79 - std::panicking::begin_panic_handler::{{closure}}::h52fa45cffa332e47
                               at /rustc/984204814e00f60c5e1ec99e2e184f326782a586/library/std/src/panicking.rs:586:13
  13:     0x7f286389de74 - std::sys_common::backtrace::__rust_end_short_backtrace::h370700b7201336e9
                               at /rustc/984204814e00f60c5e1ec99e2e184f326782a586/library/std/src/sys_common/backtrace.rs:138:18
  14:     0x7f28638a0ce9 - rust_begin_unwind
                               at /rustc/984204814e00f60c5e1ec99e2e184f326782a586/library/std/src/panicking.rs:584:5
  15:     0x7f2863864c73 - core::panicking::panic_fmt::h09426d21deeed102
                               at /rustc/984204814e00f60c5e1ec99e2e184f326782a586/library/core/src/panicking.rs:143:14
  16:     0x7f28667f82e9 - <rustc_errors[2bc643ca97700ab3]::HandlerInner as core[77d6d5013934e084]::ops::drop::Drop>::drop
  17:     0x7f2865f35f38 - core[77d6d5013934e084]::ptr::drop_in_place::<rustc_session[559b814172b908a0]::parse::ParseSess>
  18:     0x7f2865f386ca - <alloc[9e28cf12ff38ca95]::rc::Rc<rustc_session[559b814172b908a0]::session::Session> as core[77d6d5013934e084]::ops::drop::Drop>::drop
  19:     0x7f2865f2107d - core[77d6d5013934e084]::ptr::drop_in_place::<rustc_interface[3d8c97f4ae674e37]::interface::Compiler>
  20:     0x7f2865f20644 - rustc_span[32181fe9296ff921]::with_source_map::<core[77d6d5013934e084]::result::Result<(), rustc_errors[2bc643ca97700ab3]::ErrorGuaranteed>, rustc_interface[3d8c97f4ae674e37]::interface::create_compiler_and_run<core[77d6d5013934e084]::result::Result<(), rustc_errors[2bc643ca97700ab3]::ErrorGuaranteed>, rustc_driver[7399fb507d3e2f76]::run_compiler::{closure#1}>::{closure#1}>
  21:     0x7f2865f0e064 - rustc_interface[3d8c97f4ae674e37]::interface::create_compiler_and_run::<core[77d6d5013934e084]::result::Result<(), rustc_errors[2bc643ca97700ab3]::ErrorGuaranteed>, rustc_driver[7399fb507d3e2f76]::run_compiler::{closure#1}>
  22:     0x7f2865f0c552 - <scoped_tls[dac9345909c415b5]::ScopedKey<rustc_span[32181fe9296ff921]::SessionGlobals>>::set::<rustc_interface[3d8c97f4ae674e37]::interface::run_compiler<core[77d6d5013934e084]::result::Result<(), rustc_errors[2bc643ca97700ab3]::ErrorGuaranteed>, rustc_driver[7399fb507d3e2f76]::run_compiler::{closure#1}>::{closure#0}, core[77d6d5013934e084]::result::Result<(), rustc_errors[2bc643ca97700ab3]::ErrorGuaranteed>>
  23:     0x7f2865f092af - std[15c12ade071c6b1f]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[3d8c97f4ae674e37]::util::run_in_thread_pool_with_globals<rustc_interface[3d8c97f4ae674e37]::interface::run_compiler<core[77d6d5013934e084]::result::Result<(), rustc_errors[2bc643ca97700ab3]::ErrorGuaranteed>, rustc_driver[7399fb507d3e2f76]::run_compiler::{closure#1}>::{closure#0}, core[77d6d5013934e084]::result::Result<(), rustc_errors[2bc643ca97700ab3]::ErrorGuaranteed>>::{closure#0}, core[77d6d5013934e084]::result::Result<(), rustc_errors[2bc643ca97700ab3]::ErrorGuaranteed>>
  24:     0x7f2865f213f2 - <<std[15c12ade071c6b1f]::thread::Builder>::spawn_unchecked_<rustc_interface[3d8c97f4ae674e37]::util::run_in_thread_pool_with_globals<rustc_interface[3d8c97f4ae674e37]::interface::run_compiler<core[77d6d5013934e084]::result::Result<(), rustc_errors[2bc643ca97700ab3]::ErrorGuaranteed>, rustc_driver[7399fb507d3e2f76]::run_compiler::{closure#1}>::{closure#0}, core[77d6d5013934e084]::result::Result<(), rustc_errors[2bc643ca97700ab3]::ErrorGuaranteed>>::{closure#0}, core[77d6d5013934e084]::result::Result<(), rustc_errors[2bc643ca97700ab3]::ErrorGuaranteed>>::{closure#1} as core[77d6d5013934e084]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  25:     0x7f28638ab313 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hd82f330334252eb3
                               at /rustc/984204814e00f60c5e1ec99e2e184f326782a586/library/alloc/src/boxed.rs:1853:9
  26:     0x7f28638ab313 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h338760e36879fa6b
                               at /rustc/984204814e00f60c5e1ec99e2e184f326782a586/library/alloc/src/boxed.rs:1853:9
  27:     0x7f28638ab313 - std::sys::unix::thread::Thread::new::thread_start::hd4c1bf1e9d99c60a
                               at /rustc/984204814e00f60c5e1ec99e2e184f326782a586/library/std/src/sys/unix/thread.rs:108:17
  28:     0x7f28636835c2 - start_thread
  29:     0x7f2863708584 - __clone
  30:                0x0 - <unknown>

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.61.0-nightly (984204814 2022-03-15) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z unpretty=expanded

query stack during panic:
end of query stack

@matthiaskrgr matthiaskrgr added 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. C-bug Category: This is a bug. labels Mar 15, 2022
@matthiaskrgr
Copy link
Member Author

cc @xFrednet ?
looks like it might be related to #94670

@xFrednet xFrednet added the F-lint_reasons `#![feature(lint_reasons)]` label Mar 15, 2022
@xFrednet
Copy link
Member

xFrednet commented Mar 15, 2022

Mehh, I have a rough idea were this comes from. Thank you for the ping 🙃

@rustbot claim


For context/as a side note, this can only happen if lint_reasons are enabled. Therefore, we don't have to revert that PR :)

@xFrednet
Copy link
Member

I think I just have to remove that assert all together. I'm guessing that the comment only runs part of the compiler, but not the query used to update the unstable ids. The next step will require some refactorings. For now, I'll remove the assert and look back into this after the refactorings. Thank you for the report!

@rust-lang-glacier-bot rust-lang-glacier-bot added the glacier ICE tracked in rust-lang/glacier. label Mar 18, 2022
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue May 6, 2022
…esleywiser

Support tool lints with the `#[expect]` attribute (RFC 2383)

This PR fixes the ICE rust-lang#94953 by making the assert for converted expectation IDs conditional.

Additionally, it moves the lint expectation check into a separate query to support rustdoc and other tools. On the way, I've also added some tests to ensure that the attribute works for Clippy and rustdoc lints.

The number of changes comes from the long test file. This may look like a monster PR, this may smell like a monster PR and this may be a monster PR, but it's a harmless monster. 🦕

---

Closes: rust-lang#94953

cc: rust-lang#85549

r? `@wesleywiser`

cc: `@rust-lang/rustdoc`
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue May 6, 2022
…esleywiser

Support tool lints with the `#[expect]` attribute (RFC 2383)

This PR fixes the ICE rust-lang#94953 by making the assert for converted expectation IDs conditional.

Additionally, it moves the lint expectation check into a separate query to support rustdoc and other tools. On the way, I've also added some tests to ensure that the attribute works for Clippy and rustdoc lints.

The number of changes comes from the long test file. This may look like a monster PR, this may smell like a monster PR and this may be a monster PR, but it's a harmless monster. 🦕

---

Closes: rust-lang#94953

cc: rust-lang#85549

r? ``@wesleywiser``

cc: ``@rust-lang/rustdoc``
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue May 7, 2022
…esleywiser

Support tool lints with the `#[expect]` attribute (RFC 2383)

This PR fixes the ICE rust-lang#94953 by making the assert for converted expectation IDs conditional.

Additionally, it moves the lint expectation check into a separate query to support rustdoc and other tools. On the way, I've also added some tests to ensure that the attribute works for Clippy and rustdoc lints.

The number of changes comes from the long test file. This may look like a monster PR, this may smell like a monster PR and this may be a monster PR, but it's a harmless monster. 🦕

---

Closes: rust-lang#94953

cc: rust-lang#85549

r? ```@wesleywiser```

cc: ```@rust-lang/rustdoc```
@bors bors closed this as completed in a571179 May 9, 2022
xFrednet pushed a commit to xFrednet/rust-clippy that referenced this issue May 15, 2022
Support tool lints with the `#[expect]` attribute (RFC 2383)

This PR fixes the ICE rust-lang/rust#94953 by making the assert for converted expectation IDs conditional.

Additionally, it moves the lint expectation check into a separate query to support rustdoc and other tools. On the way, I've also added some tests to ensure that the attribute works for Clippy and rustdoc lints.

The number of changes comes from the long test file. This may look like a monster PR, this may smell like a monster PR and this may be a monster PR, but it's a harmless monster. 🦕

---

Closes: rust-lang/rust#94953

cc: rust-lang/rust#85549

r? `@wesleywiser`

cc: `@rust-lang/rustdoc`
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-lint_reasons `#![feature(lint_reasons)]` 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
3 participants