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: attrs: None at diagnostics.rs:804:30 #118531

Closed
matthiaskrgr opened this issue Dec 2, 2023 · 1 comment · Fixed by #118542
Closed

ICE: attrs: None at diagnostics.rs:804:30 #118531

matthiaskrgr opened this issue Dec 2, 2023 · 1 comment · Fixed by #118542
Assignees
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

@matthiaskrgr
Copy link
Member

Code

fn bar() -> String {
    #[cfg(feature = )]
    [1, 2, 3].iter().map().collect::<String>()
    #[attr]
    String::new()
}

Meta

rustc --version --verbose:

rustc 1.76.0-nightly (0919ad183 2023-12-02)
binary: rustc
commit-hash: 0919ad18381f6f4fcaddc809e786553e028bbde0
commit-date: 2023-12-02
host: x86_64-unknown-linux-gnu
release: 1.76.0-nightly
LLVM version: 17.0.5

Error output

<output>
Backtrace

thread 'rustc' panicked at compiler/rustc_parse/src/parser/diagnostics.rs:804:30:
called `Option::unwrap()` on a `None` value
stack backtrace:
   0:     0x7f0bf658b28c - std::backtrace_rs::backtrace::libunwind::trace::hf60fec8ebc0c5e46
                               at /rustc/0919ad18381f6f4fcaddc809e786553e028bbde0/library/std/src/../../backtrace/src/backtrace/libunwind.rs:104:5
   1:     0x7f0bf658b28c - std::backtrace_rs::backtrace::trace_unsynchronized::h6b0117997e292206
                               at /rustc/0919ad18381f6f4fcaddc809e786553e028bbde0/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f0bf658b28c - std::sys_common::backtrace::_print_fmt::h44b32f67603b518c
                               at /rustc/0919ad18381f6f4fcaddc809e786553e028bbde0/library/std/src/sys_common/backtrace.rs:68:5
   3:     0x7f0bf658b28c - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h27fb11da10f33041
                               at /rustc/0919ad18381f6f4fcaddc809e786553e028bbde0/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f0bf65de2c0 - core::fmt::rt::Argument::fmt::h3fc263cbfb58e262
                               at /rustc/0919ad18381f6f4fcaddc809e786553e028bbde0/library/core/src/fmt/rt.rs:142:9
   5:     0x7f0bf65de2c0 - core::fmt::write::h02278e02d2d5f049
                               at /rustc/0919ad18381f6f4fcaddc809e786553e028bbde0/library/core/src/fmt/mod.rs:1120:17
   6:     0x7f0bf657f17f - std::io::Write::write_fmt::hffc80e01f3ab27bb
                               at /rustc/0919ad18381f6f4fcaddc809e786553e028bbde0/library/std/src/io/mod.rs:1810:15
   7:     0x7f0bf658b074 - std::sys_common::backtrace::_print::h2544e68645d26127
                               at /rustc/0919ad18381f6f4fcaddc809e786553e028bbde0/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7f0bf658b074 - std::sys_common::backtrace::print::h2e0aa5ce667bab38
                               at /rustc/0919ad18381f6f4fcaddc809e786553e028bbde0/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7f0bf658dd07 - std::panicking::default_hook::{{closure}}::h0a15ec650eef3042
  10:     0x7f0bf658da6f - std::panicking::default_hook::heb7c98638cae941f
                               at /rustc/0919ad18381f6f4fcaddc809e786553e028bbde0/library/std/src/panicking.rs:292:9
  11:     0x7f0bf92f1e80 - std[87e1f5a9db75d886]::panicking::update_hook::<alloc[3858379072058137]::boxed::Box<rustc_driver_impl[cfa48c30a51debc9]::install_ice_hook::{closure#0}>>::{closure#0}
  12:     0x7f0bf658e448 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::hdf7e5e901896fee8
                               at /rustc/0919ad18381f6f4fcaddc809e786553e028bbde0/library/alloc/src/boxed.rs:2021:9
  13:     0x7f0bf658e448 - std::panicking::rust_panic_with_hook::h5b2da380fe2b9567
                               at /rustc/0919ad18381f6f4fcaddc809e786553e028bbde0/library/std/src/panicking.rs:783:13
  14:     0x7f0bf658e169 - std::panicking::begin_panic_handler::{{closure}}::h3f96784bf0ca7405
                               at /rustc/0919ad18381f6f4fcaddc809e786553e028bbde0/library/std/src/panicking.rs:649:13
  15:     0x7f0bf658b756 - std::sys_common::backtrace::__rust_end_short_backtrace::hf79e6243acc919d5
                               at /rustc/0919ad18381f6f4fcaddc809e786553e028bbde0/library/std/src/sys_common/backtrace.rs:171:18
  16:     0x7f0bf658df02 - rust_begin_unwind
                               at /rustc/0919ad18381f6f4fcaddc809e786553e028bbde0/library/std/src/panicking.rs:645:5
  17:     0x7f0bf65da995 - core::panicking::panic_fmt::h30900c9a84f4042b
                               at /rustc/0919ad18381f6f4fcaddc809e786553e028bbde0/library/core/src/panicking.rs:72:14
  18:     0x7f0bf65daa43 - core::panicking::panic::h234da1d28a5ceaa3
                               at /rustc/0919ad18381f6f4fcaddc809e786553e028bbde0/library/core/src/panicking.rs:142:5
  19:     0x7f0bf8015d98 - <rustc_parse[af32aa468c2a8517]::parser::Parser>::attr_on_non_tail_expr
  20:     0x7f0bfad098b0 - <rustc_parse[af32aa468c2a8517]::parser::Parser>::parse_block_tail
  21:     0x7f0bfa9da5a2 - <rustc_parse[af32aa468c2a8517]::parser::Parser>::parse_fn
  22:     0x7f0bfacf77ef - <rustc_parse[af32aa468c2a8517]::parser::Parser>::parse_item_kind
  23:     0x7f0bfa9f293f - <rustc_parse[af32aa468c2a8517]::parser::Parser>::parse_item_common
  24:     0x7f0bfa9effec - <rustc_parse[af32aa468c2a8517]::parser::Parser>::parse_mod
  25:     0x7f0bfb58b490 - rustc_interface[940fd56aa190939d]::passes::parse
  26:     0x7f0bfb58b20e - <rustc_interface[940fd56aa190939d]::queries::Queries>::parse
  27:     0x7f0bfb581f25 - rustc_interface[940fd56aa190939d]::interface::run_compiler::<core[75c7cbfbe7f98c9f]::result::Result<(), rustc_span[63578016ae5b5f6e]::ErrorGuaranteed>, rustc_driver_impl[cfa48c30a51debc9]::run_compiler::{closure#0}>::{closure#0}
  28:     0x7f0bfb575549 - std[87e1f5a9db75d886]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[940fd56aa190939d]::util::run_in_thread_with_globals<rustc_interface[940fd56aa190939d]::util::run_in_thread_pool_with_globals<rustc_interface[940fd56aa190939d]::interface::run_compiler<core[75c7cbfbe7f98c9f]::result::Result<(), rustc_span[63578016ae5b5f6e]::ErrorGuaranteed>, rustc_driver_impl[cfa48c30a51debc9]::run_compiler::{closure#0}>::{closure#0}, core[75c7cbfbe7f98c9f]::result::Result<(), rustc_span[63578016ae5b5f6e]::ErrorGuaranteed>>::{closure#0}, core[75c7cbfbe7f98c9f]::result::Result<(), rustc_span[63578016ae5b5f6e]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[75c7cbfbe7f98c9f]::result::Result<(), rustc_span[63578016ae5b5f6e]::ErrorGuaranteed>>
  29:     0x7f0bfb575373 - <<std[87e1f5a9db75d886]::thread::Builder>::spawn_unchecked_<rustc_interface[940fd56aa190939d]::util::run_in_thread_with_globals<rustc_interface[940fd56aa190939d]::util::run_in_thread_pool_with_globals<rustc_interface[940fd56aa190939d]::interface::run_compiler<core[75c7cbfbe7f98c9f]::result::Result<(), rustc_span[63578016ae5b5f6e]::ErrorGuaranteed>, rustc_driver_impl[cfa48c30a51debc9]::run_compiler::{closure#0}>::{closure#0}, core[75c7cbfbe7f98c9f]::result::Result<(), rustc_span[63578016ae5b5f6e]::ErrorGuaranteed>>::{closure#0}, core[75c7cbfbe7f98c9f]::result::Result<(), rustc_span[63578016ae5b5f6e]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[75c7cbfbe7f98c9f]::result::Result<(), rustc_span[63578016ae5b5f6e]::ErrorGuaranteed>>::{closure#1} as core[75c7cbfbe7f98c9f]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  30:     0x7f0bf65982d5 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h7c5f0316c4d081e7
                               at /rustc/0919ad18381f6f4fcaddc809e786553e028bbde0/library/alloc/src/boxed.rs:2007:9
  31:     0x7f0bf65982d5 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::ha58713453cbc0382
                               at /rustc/0919ad18381f6f4fcaddc809e786553e028bbde0/library/alloc/src/boxed.rs:2007:9
  32:     0x7f0bf65982d5 - std::sys::unix::thread::Thread::new::thread_start::h8f26f58dd762698d
                               at /rustc/0919ad18381f6f4fcaddc809e786553e028bbde0/library/std/src/sys/unix/thread.rs:108:17
  33:     0x7f0bf63889eb - <unknown>
  34:     0x7f0bf640c7cc - <unknown>
  35:                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 attach the file at `/tmp/im/rustc-ice-2023-12-02T11_40_29-2632871.txt` to your bug report

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 Dec 2, 2023
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Dec 2, 2023
@saethlin saethlin removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Dec 2, 2023
@eggyal
Copy link
Contributor

eggyal commented Dec 2, 2023

searched nightlies: from nightly-2023-10-01 to nightly-2023-12-02
regressed nightly: nightly-2023-11-21
searched commit range: 9a66e44...3a85a5c
regressed commit: 46ecc10

bisected with cargo-bisect-rustc v0.6.7

Host triple: aarch64-unknown-linux-gnu
Reproduce with:

cargo bisect-rustc --start=2023-10-01 --end=2023-12-02 --regress=ice 

#117988 looks most likely responsible, cc @estebank

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

Successfully merging a pull request may close this issue.

5 participants