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 #118934

Closed
bend-n opened this issue Dec 14, 2023 · 1 comment
Closed

ICE #118934

bend-n opened this issue Dec 14, 2023 · 1 comment
Labels
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.

Comments

@bend-n
Copy link
Contributor

bend-n commented Dec 14, 2023

Code

pub fn b() {
    #[cfg(target_feature = "cpu")]
    a
    #[cfg(not(target_feature = "cpu"))]
}

Meta

rustc --version --verbose:

rustc 1.76.0-nightly (21cce21d8 2023-12-11)
binary: rustc
commit-hash: 21cce21d8c012f14cf74d5afddd795d324600dac
commit-date: 2023-12-11
host: x86_64-unknown-linux-gnu
release: 1.76.0-nightly
LLVM version: 17.0.5

Error output

error: internal compiler error: the following error was constructed but not emitted

error: expected expression, found `}`
 --> src/lib.rs:5:1
  |
5 | }
  | ^ expected expression

thread 'rustc' panicked at compiler/rustc_errors/src/diagnostic_builder.rs:650:21:
error was constructed but not emitted
stack backtrace:
   0: rust_begin_unwind
             at /rustc/21cce21d8c012f14cf74d5afddd795d324600dac/library/std/src/panicking.rs:645:5
   1: core::panicking::panic_fmt
             at /rustc/21cce21d8c012f14cf74d5afddd795d324600dac/library/core/src/panicking.rs:72:14
   2: <rustc_errors::diagnostic_builder::DiagnosticBuilderInner as core::ops::drop::Drop>::drop
   3: core::ptr::drop_in_place::<rustc_errors::diagnostic_builder::DiagnosticBuilderInner>
   4: <rustc_parse::parser::Parser>::attr_on_non_tail_expr
   5: <rustc_parse::parser::Parser>::parse_block_tail
   6: <rustc_parse::parser::Parser>::parse_fn
   7: <rustc_parse::parser::Parser>::parse_item_kind
   8: <rustc_parse::parser::Parser>::parse_item_common
   9: <rustc_parse::parser::Parser>::parse_mod
  10: rustc_interface::passes::parse
  11: <rustc_interface::queries::Queries>::parse
  12: rustc_interface::interface::run_compiler::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

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 attach the file at `/home/bendn/ice/rustc-ice-2023-12-14T07_49_36-684820.txt` to your bug report

note: compiler flags: --crate-type lib -C embed-bitcode=no -C debuginfo=2 -C incremental=[REDACTED] -C target-cpu=native

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
end of query stack
Backtrace

thread 'rustc' panicked at compiler/rustc_errors/src/diagnostic_builder.rs:650:21:
error was constructed but not emitted
stack backtrace:
   0:     0x7f10bd3d9da1 - std::backtrace_rs::backtrace::libunwind::trace::h4f2e2566beda338b
                               at /rustc/21cce21d8c012f14cf74d5afddd795d324600dac/library/std/src/../../backtrace/src/backtrace/libunwind.rs:104:5
   1:     0x7f10bd3d9da1 - std::backtrace_rs::backtrace::trace_unsynchronized::h6abedcf085db84db
                               at /rustc/21cce21d8c012f14cf74d5afddd795d324600dac/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f10bd3d9da1 - std::backtrace::Backtrace::create::hd16c0afea63fc084
                               at /rustc/21cce21d8c012f14cf74d5afddd795d324600dac/library/std/src/backtrace.rs:331:13
   3:     0x7f10bd3d9cf0 - std::backtrace::Backtrace::force_capture::h65c23895fcce40ee
                               at /rustc/21cce21d8c012f14cf74d5afddd795d324600dac/library/std/src/backtrace.rs:312:9
   4:     0x7f10ba13328c - std[f551778c0f27cc6d]::panicking::update_hook::<alloc[dc008c177c6f77ab]::boxed::Box<rustc_driver_impl[6e9cf9b4eddc1f9a]::install_ice_hook::{closure#0}>>::{closure#0}
   5:     0x7f10bd3f5688 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::hcd18a368e1cefb08
                               at /rustc/21cce21d8c012f14cf74d5afddd795d324600dac/library/alloc/src/boxed.rs:2029:9
   6:     0x7f10bd3f5688 - std::panicking::rust_panic_with_hook::h321aae92a11b5eba
                               at /rustc/21cce21d8c012f14cf74d5afddd795d324600dac/library/std/src/panicking.rs:783:13
   7:     0x7f10bd3f53a9 - std::panicking::begin_panic_handler::{{closure}}::h8ecc59ab740042e4
                               at /rustc/21cce21d8c012f14cf74d5afddd795d324600dac/library/std/src/panicking.rs:649:13
   8:     0x7f10bd3f2926 - std::sys_common::backtrace::__rust_end_short_backtrace::hbc1b3ac8c89dfffa
                               at /rustc/21cce21d8c012f14cf74d5afddd795d324600dac/library/std/src/sys_common/backtrace.rs:171:18
   9:     0x7f10bd3f5142 - rust_begin_unwind
                               at /rustc/21cce21d8c012f14cf74d5afddd795d324600dac/library/std/src/panicking.rs:645:5
  10:     0x7f10bd441bd5 - core::panicking::panic_fmt::hb0d8a0f6fec1d8af
                               at /rustc/21cce21d8c012f14cf74d5afddd795d324600dac/library/core/src/panicking.rs:72:14
  11:     0x7f10bbca62a9 - <rustc_errors[6f2fa450043bd5e]::diagnostic_builder::DiagnosticBuilderInner as core[d7d4a658e83ad6ec]::ops::drop::Drop>::drop
  12:     0x7f10bbca62d6 - core[d7d4a658e83ad6ec]::ptr::drop_in_place::<rustc_errors[6f2fa450043bd5e]::diagnostic_builder::DiagnosticBuilderInner>
  13:     0x7f10b8dde469 - <rustc_parse[4a17385e886b1063]::parser::Parser>::attr_on_non_tail_expr
  14:     0x7f10bbbfc378 - <rustc_parse[4a17385e886b1063]::parser::Parser>::parse_block_tail
  15:     0x7f10bb78edba - <rustc_parse[4a17385e886b1063]::parser::Parser>::parse_fn
  16:     0x7f10bbcb9a74 - <rustc_parse[4a17385e886b1063]::parser::Parser>::parse_item_kind
  17:     0x7f10bb7a7409 - <rustc_parse[4a17385e886b1063]::parser::Parser>::parse_item_common
  18:     0x7f10bb7a4a08 - <rustc_parse[4a17385e886b1063]::parser::Parser>::parse_mod
  19:     0x7f10bc31ef50 - rustc_interface[b13791352229774c]::passes::parse
  20:     0x7f10bc31ecdc - <rustc_interface[b13791352229774c]::queries::Queries>::parse
  21:     0x7f10bc4359d6 - rustc_interface[b13791352229774c]::interface::run_compiler::<core[d7d4a658e83ad6ec]::result::Result<(), rustc_span[7dad7e8a9e9d3081]::ErrorGuaranteed>, rustc_driver_impl[6e9cf9b4eddc1f9a]::run_compiler::{closure#0}>::{closure#0}
  22:     0x7f10bc3aff4a - std[f551778c0f27cc6d]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[b13791352229774c]::util::run_in_thread_with_globals<rustc_interface[b13791352229774c]::util::run_in_thread_pool_with_globals<rustc_interface[b13791352229774c]::interface::run_compiler<core[d7d4a658e83ad6ec]::result::Result<(), rustc_span[7dad7e8a9e9d3081]::ErrorGuaranteed>, rustc_driver_impl[6e9cf9b4eddc1f9a]::run_compiler::{closure#0}>::{closure#0}, core[d7d4a658e83ad6ec]::result::Result<(), rustc_span[7dad7e8a9e9d3081]::ErrorGuaranteed>>::{closure#0}, core[d7d4a658e83ad6ec]::result::Result<(), rustc_span[7dad7e8a9e9d3081]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[d7d4a658e83ad6ec]::result::Result<(), rustc_span[7dad7e8a9e9d3081]::ErrorGuaranteed>>
  23:     0x7f10bc3afd73 - <<std[f551778c0f27cc6d]::thread::Builder>::spawn_unchecked_<rustc_interface[b13791352229774c]::util::run_in_thread_with_globals<rustc_interface[b13791352229774c]::util::run_in_thread_pool_with_globals<rustc_interface[b13791352229774c]::interface::run_compiler<core[d7d4a658e83ad6ec]::result::Result<(), rustc_span[7dad7e8a9e9d3081]::ErrorGuaranteed>, rustc_driver_impl[6e9cf9b4eddc1f9a]::run_compiler::{closure#0}>::{closure#0}, core[d7d4a658e83ad6ec]::result::Result<(), rustc_span[7dad7e8a9e9d3081]::ErrorGuaranteed>>::{closure#0}, core[d7d4a658e83ad6ec]::result::Result<(), rustc_span[7dad7e8a9e9d3081]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[d7d4a658e83ad6ec]::result::Result<(), rustc_span[7dad7e8a9e9d3081]::ErrorGuaranteed>>::{closure#1} as core[d7d4a658e83ad6ec]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  24:     0x7f10bd3ff515 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hb577b19a12e09868
                               at /rustc/21cce21d8c012f14cf74d5afddd795d324600dac/library/alloc/src/boxed.rs:2015:9
  25:     0x7f10bd3ff515 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h8a3cf55554903b8d
                               at /rustc/21cce21d8c012f14cf74d5afddd795d324600dac/library/alloc/src/boxed.rs:2015:9
  26:     0x7f10bd3ff515 - std::sys::unix::thread::Thread::new::thread_start::hc928c4ba1b883694
                               at /rustc/21cce21d8c012f14cf74d5afddd795d324600dac/library/std/src/sys/unix/thread.rs:108:17
  27:     0x7f10b72aa9eb - <unknown>
  28:     0x7f10b732e7cc - <unknown>
  29:                0x0 - <unknown>


rustc version: 1.76.0-nightly (21cce21d8 2023-12-11)
platform: x86_64-unknown-linux-gnu

@bend-n bend-n 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 Dec 14, 2023
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Dec 14, 2023
@matthiaskrgr
Copy link
Member

Probably duplicate of #118575

@bend-n bend-n closed this as not planned Won't fix, can't repro, duplicate, stale Dec 14, 2023
@fmease fmease removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Dec 15, 2023
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. 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
Development

No branches or pull requests

4 participants