Skip to content

ICE ForceWarning != Error | Warning | Allow | Expect #142144

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

Closed
matthiaskrgr opened this issue Jun 7, 2025 · 0 comments · Fixed by #142148
Closed

ICE ForceWarning != Error | Warning | Allow | Expect #142144

matthiaskrgr opened this issue Jun 7, 2025 · 0 comments · Fixed by #142148
Labels
A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@matthiaskrgr
Copy link
Member

Code

rustc a.rs --force-warn pub_use_of_private_extern_crate

extern crate core;
pub use core as reexported_core;

fn main() {}

Meta

rustc --version --verbose:

rustc 1.89.0-nightly (44f415c1d 2025-06-06)
binary: rustc
commit-hash: 44f415c1d617ebc7b931a243b7b321ef8a6ca47c
commit-date: 2025-06-06
host: x86_64-unknown-linux-gnu
release: 1.89.0-nightly
LLVM version: 20.1.5

Error output

<output>
Backtrace

thread 'rustc' panicked at compiler/rustc_errors/src/lib.rs:1532:13:
assertion `left matches right` failed
  left: ForceWarning
 right: Error | Warning | Allow | Expect
stack backtrace:
   0:     0x7a427a70d493 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::ha891fbe7876a9c28
   1:     0x7a427ae02cf7 - core::fmt::write::hb5ee2653f290f031
   2:     0x7a427a7030f3 - std::io::Write::write_fmt::h672a3de6ab1cdb45
   3:     0x7a427a70d2f2 - std::sys::backtrace::BacktraceLock::print::h9fd0bbed52d45e92
   4:     0x7a427a710eea - std::panicking::default_hook::{{closure}}::h8a1e8d4cf47a692c
   5:     0x7a427a710a6f - std::panicking::default_hook::hf31cfaaca3a607a2
   6:     0x7a42798169b3 - std[bcad9b04b3b952e4]::panicking::update_hook::<alloc[f0dc799087a75c16]::boxed::Box<rustc_driver_impl[2ceea16ddf85e8fa]::install_ice_hook::{closure#1}>>::{closure#0}
   7:     0x7a427a711763 - std::panicking::rust_panic_with_hook::hc041d3eaddc8a252
   8:     0x7a427a71145a - std::panicking::begin_panic_handler::{{closure}}::h1789b60696483c65
   9:     0x7a427a70d959 - std::sys::backtrace::__rust_end_short_backtrace::h65c778548f450cf2
  10:     0x7a427a71111d - __rustc[8b86f73cc16cac0]::rust_begin_unwind
  11:     0x7a4276e796c0 - core::panicking::panic_fmt::h3a9b0eb4e514e696
  12:     0x7a427921cb3a - core::panicking::assert_failed_inner::hf28f417ea60d2519
  13:     0x7a4279847cb1 - core[1684b382b3cb289c]::panicking::assert_matches_failed::<rustc_errors[83246f4268492b91]::Level>
  14:     0x7a427c385d6e - <rustc_errors[83246f4268492b91]::DiagCtxtInner>::emit_diagnostic
  15:     0x7a427c385239 - <rustc_errors[83246f4268492b91]::DiagCtxtHandle>::emit_diagnostic
  16:     0x7a427c3850d5 - <() as rustc_errors[83246f4268492b91]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
  17:     0x7a427b6b9645 - rustc_middle[73808c43a936ddaa]::lint::lint_level::lint_level_impl
  18:     0x7a427af32325 - <rustc_lint[3921f83589c15283]::early::EarlyContextAndPass<rustc_lint[3921f83589c15283]::BuiltinCombinedEarlyLintPass> as rustc_ast[97ec933858ce6ae7]::visit::Visitor>::visit_item
  19:     0x7a427bea6761 - rustc_interface[ab47e915ec4db7a9]::passes::early_lint_checks
  20:     0x7a427bea600d - rustc_query_impl[8584cea66e475d6d]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[8584cea66e475d6d]::query_impl::early_lint_checks::dynamic_query::{closure#2}::{closure#0}, rustc_middle[73808c43a936ddaa]::query::erase::Erased<[u8; 0usize]>>
  21:     0x7a427bf2640e - rustc_query_system[5c2810be960c7739]::query::plumbing::try_execute_query::<rustc_query_impl[8584cea66e475d6d]::DynamicConfig<rustc_query_system[5c2810be960c7739]::query::caches::SingleCache<rustc_middle[73808c43a936ddaa]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[8584cea66e475d6d]::plumbing::QueryCtxt, false>
  22:     0x7a427bf2620e - rustc_query_impl[8584cea66e475d6d]::query_impl::early_lint_checks::get_query_non_incr::__rust_end_short_backtrace
  23:     0x7a427bb57beb - rustc_ast_lowering[5880676878ca1506]::lower_to_hir
  24:     0x7a427bf25aba - rustc_query_impl[8584cea66e475d6d]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[8584cea66e475d6d]::query_impl::hir_crate::dynamic_query::{closure#2}::{closure#0}, rustc_middle[73808c43a936ddaa]::query::erase::Erased<[u8; 8usize]>>
  25:     0x7a427bf28681 - rustc_query_system[5c2810be960c7739]::query::plumbing::try_execute_query::<rustc_query_impl[8584cea66e475d6d]::DynamicConfig<rustc_query_system[5c2810be960c7739]::query::caches::SingleCache<rustc_middle[73808c43a936ddaa]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[8584cea66e475d6d]::plumbing::QueryCtxt, false>
  26:     0x7a427bf27e80 - rustc_query_impl[8584cea66e475d6d]::query_impl::hir_crate::get_query_non_incr::__rust_end_short_backtrace
  27:     0x7a427b14db66 - rustc_interface[ab47e915ec4db7a9]::passes::analysis
  28:     0x7a427b14daf5 - rustc_query_impl[8584cea66e475d6d]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[8584cea66e475d6d]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[73808c43a936ddaa]::query::erase::Erased<[u8; 0usize]>>
  29:     0x7a427bf2640e - rustc_query_system[5c2810be960c7739]::query::plumbing::try_execute_query::<rustc_query_impl[8584cea66e475d6d]::DynamicConfig<rustc_query_system[5c2810be960c7739]::query::caches::SingleCache<rustc_middle[73808c43a936ddaa]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[8584cea66e475d6d]::plumbing::QueryCtxt, false>
  30:     0x7a427bf25ff6 - rustc_query_impl[8584cea66e475d6d]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  31:     0x7a427c155b3f - rustc_interface[ab47e915ec4db7a9]::passes::create_and_enter_global_ctxt::<core[1684b382b3cb289c]::option::Option<rustc_interface[ab47e915ec4db7a9]::queries::Linker>, rustc_driver_impl[2ceea16ddf85e8fa]::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}
  32:     0x7a427c145e30 - rustc_interface[ab47e915ec4db7a9]::interface::run_compiler::<(), rustc_driver_impl[2ceea16ddf85e8fa]::run_compiler::{closure#0}>::{closure#1}
  33:     0x7a427bee25be - std[bcad9b04b3b952e4]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[ab47e915ec4db7a9]::util::run_in_thread_with_globals<rustc_interface[ab47e915ec4db7a9]::util::run_in_thread_pool_with_globals<rustc_interface[ab47e915ec4db7a9]::interface::run_compiler<(), rustc_driver_impl[2ceea16ddf85e8fa]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
  34:     0x7a427bee2296 - <<std[bcad9b04b3b952e4]::thread::Builder>::spawn_unchecked_<rustc_interface[ab47e915ec4db7a9]::util::run_in_thread_with_globals<rustc_interface[ab47e915ec4db7a9]::util::run_in_thread_pool_with_globals<rustc_interface[ab47e915ec4db7a9]::interface::run_compiler<(), rustc_driver_impl[2ceea16ddf85e8fa]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[1684b382b3cb289c]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  35:     0x7a427c09abfd - std::sys::pal::unix::thread::Thread::new::thread_start::h0cca23f6750922f6
  36:     0x7a4275aa57eb - <unknown>
  37:     0x7a4275b2918c - <unknown>
  38:                0x0 - <unknown>

error: 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: please make sure that you have updated to the latest nightly

note: please attach the file at `/tmp/im/rustc-ice-2025-06-07T06_51_22-2442283.txt` to your bug report

query stack during panic:
#0 [early_lint_checks] perform lints prior to AST lowering
#1 [hir_crate] getting the crate HIR
#2 [analysis] running analysis passes on this crate
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 Jun 7, 2025
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jun 7, 2025
@matthiaskrgr matthiaskrgr added the A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. label Jun 7, 2025
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue Jun 7, 2025
…arn, r=Urgau

compiler: Treat ForceWarning as a Warning for diagnostic level

This silences an ICE.

No idea if this is the correct solution though tbh.

r? `@oli-obk`

Fixes rust-lang#142144
workingjubilee added a commit to workingjubilee/rustc that referenced this issue Jun 7, 2025
…arn, r=Urgau

compiler: Treat ForceWarning as a Warning for diagnostic level

This silences an ICE.

No idea if this is the correct solution though tbh.

Fixes rust-lang#142144
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue Jun 7, 2025
…arn, r=Urgau

compiler: Treat ForceWarning as a Warning for diagnostic level

This silences an ICE.

No idea if this is the correct solution though tbh.

Fixes rust-lang#142144
@bors bors closed this as completed in 3c860e3 Jun 8, 2025
rust-timer added a commit that referenced this issue Jun 8, 2025
Rollup merge of #142148 - workingjubilee:dont-ice-on-force-warn, r=Urgau

compiler: Treat ForceWarning as a Warning for diagnostic level

This silences an ICE.

No idea if this is the correct solution though tbh.

Fixes #142144
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. 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.

2 participants