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: parse_expected_identifier_found_str #127600

Closed
matthiaskrgr opened this issue Jul 11, 2024 · 1 comment · Fixed by #127601
Closed

ICE: parse_expected_identifier_found_str #127600

matthiaskrgr opened this issue Jul 11, 2024 · 1 comment · Fixed by #127601
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

auto-reduced (treereduce-rust):

         
const!(&raw mut a);           





g

original:

macro_rules! is_expr {
    ($e:expr) => {}
}

assert!(c_p == i_r);         //~ ERROR raw address of syntax is experimental
const!(&raw mut a);           //~ ERROR raw address of syntax is experimental

#[cfg(FALSE)]
fn cfgd_out() {
    let mut a = 0;
    &raw mut FOUR const a;               //~ ERROR raw address of syntax is experimental
    &raw mut a;                 //@ check-pass
}

fn main() {
    let mut ref_const = 123;
    let type_ascription = &raw const y;       //~ ERROR raw address of syntax is experimental
    let x = &raw mut y;         //~ ERROR raw address of syntax is experimental
}
g

Version information

rustc 1.81.0-nightly (8c39ac9ec 2024-07-11)
binary: rustc
commit-hash: 8c39ac9eccdfaeff11bd3b6107817a81fe0a3a43
commit-date: 2024-07-11
host: x86_64-unknown-linux-gnu
release: 1.81.0-nightly
LLVM version: 18.1.7

Command:
/home/matthias/.rustup/toolchains/master/bin/rustc

Program output

thread 'rustc' panicked at compiler/rustc_parse/src/parser/item.rs:400:32:
called `Result::unwrap()` on an `Err` value: Some(DiagInner { level: Error, messages: [(FluentIdentifier("parse_expected_identifier_found_str", None), NoStyle)], code: None, span: MultiSpan { primary_spans: [/tmp/icemaker_global_tempdir.v8vwIM7cQWLj/rustc_testrunner_tmpdir_reporting.S34MI5P1DYcO/mvce.rs:4:6: 4:7 (#0)], span_labels: [(/tmp/icemaker_global_tempdir.v8vwIM7cQWLj/rustc_testrunner_tmpdir_reporting.S34MI5P1DYcO/mvce.rs:4:6: 4:7 (#0), FluentIdentifier("parse_expected_identifier", None))] }, children: [], suggestions: Ok([]), args: {"token": Str("!")}, sort_span: /tmp/icemaker_global_tempdir.v8vwIM7cQWLj/rustc_testrunner_tmpdir_reporting.S34MI5P1DYcO/mvce.rs:4:6: 4:7 (#0), is_lint: None, emitted_at: DiagLocation { file: "compiler/rustc_parse/src/parser/diagnostics.rs", line: 336, col: 34 } })
stack backtrace:
   0:     0x79e0b866d655 - std::backtrace_rs::backtrace::libunwind::trace::h0ad7104fc0c7e307
                               at /rustc/8c39ac9eccdfaeff11bd3b6107817a81fe0a3a43/library/std/src/../../backtrace/src/backtrace/libunwind.rs:116:5
   1:     0x79e0b866d655 - std::backtrace_rs::backtrace::trace_unsynchronized::h9c7f2883cf9d711f
                               at /rustc/8c39ac9eccdfaeff11bd3b6107817a81fe0a3a43/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x79e0b866d655 - std::sys::backtrace::_print_fmt::hc21801433e5e75bd
                               at /rustc/8c39ac9eccdfaeff11bd3b6107817a81fe0a3a43/library/std/src/sys/backtrace.rs:68:5
   3:     0x79e0b866d655 - <std::sys::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h01536dc20a0b3dc8
                               at /rustc/8c39ac9eccdfaeff11bd3b6107817a81fe0a3a43/library/std/src/sys/backtrace.rs:44:22
   4:     0x79e0b86bcd3b - core::fmt::rt::Argument::fmt::h7fa63291ffc0421e
                               at /rustc/8c39ac9eccdfaeff11bd3b6107817a81fe0a3a43/library/core/src/fmt/rt.rs:173:76
   5:     0x79e0b86bcd3b - core::fmt::write::haaca9a516bbb3d6d
                               at /rustc/8c39ac9eccdfaeff11bd3b6107817a81fe0a3a43/library/core/src/fmt/mod.rs:1182:21
   6:     0x79e0b866203f - std::io::Write::write_fmt::hb7bdd50ff15c6341
                               at /rustc/8c39ac9eccdfaeff11bd3b6107817a81fe0a3a43/library/std/src/io/mod.rs:1835:15
   7:     0x79e0b866d42e - std::sys::backtrace::_print::h0e69b6ad9c8445db
                               at /rustc/8c39ac9eccdfaeff11bd3b6107817a81fe0a3a43/library/std/src/sys/backtrace.rs:47:5
   8:     0x79e0b866d42e - std::sys::backtrace::print::h416361b81303f7a9
                               at /rustc/8c39ac9eccdfaeff11bd3b6107817a81fe0a3a43/library/std/src/sys/backtrace.rs:34:9
   9:     0x79e0b866fd79 - std::panicking::default_hook::{{closure}}::h98a2ed3a8cdc4a0e
  10:     0x79e0b866fb1c - std::panicking::default_hook::h87426540abda5fa6
                               at /rustc/8c39ac9eccdfaeff11bd3b6107817a81fe0a3a43/library/std/src/panicking.rs:292:9
  11:     0x79e0b4a214c9 - std[345a6075b69746bb]::panicking::update_hook::<alloc[49e2c6433099fa6f]::boxed::Box<rustc_driver_impl[38b2d71697c3137b]::install_ice_hook::{closure#0}>>::{closure#0}
  12:     0x79e0b867069f - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h0b1e506e70b4a6ea
                               at /rustc/8c39ac9eccdfaeff11bd3b6107817a81fe0a3a43/library/alloc/src/boxed.rs:2078:9
  13:     0x79e0b867069f - std::panicking::rust_panic_with_hook::hbfcf7e706fc9ce1f
                               at /rustc/8c39ac9eccdfaeff11bd3b6107817a81fe0a3a43/library/std/src/panicking.rs:804:13
  14:     0x79e0b86702c7 - std::panicking::begin_panic_handler::{{closure}}::h106fd1ad345395eb
                               at /rustc/8c39ac9eccdfaeff11bd3b6107817a81fe0a3a43/library/std/src/panicking.rs:670:13
  15:     0x79e0b866db19 - std::sys::backtrace::__rust_end_short_backtrace::hd1df58f8f74bde30
                               at /rustc/8c39ac9eccdfaeff11bd3b6107817a81fe0a3a43/library/std/src/sys/backtrace.rs:171:18
  16:     0x79e0b866ff54 - rust_begin_unwind
                               at /rustc/8c39ac9eccdfaeff11bd3b6107817a81fe0a3a43/library/std/src/panicking.rs:661:5
  17:     0x79e0b86b92f3 - core::panicking::panic_fmt::h7402a80f725a0b7f
                               at /rustc/8c39ac9eccdfaeff11bd3b6107817a81fe0a3a43/library/core/src/panicking.rs:74:14
  18:     0x79e0b86b9946 - core::result::unwrap_failed::h381a87aa4c123d1d
                               at /rustc/8c39ac9eccdfaeff11bd3b6107817a81fe0a3a43/library/core/src/result.rs:1679:5
  19:     0x79e0b696d67f - <rustc_parse[352ee8005d917dd6]::parser::Parser>::recover_missing_kw_before_item
  20:     0x79e0b697114e - <rustc_parse[352ee8005d917dd6]::parser::Parser>::parse_item_kind
  21:     0x79e0b6962b76 - <rustc_parse[352ee8005d917dd6]::parser::Parser>::parse_item_common
  22:     0x79e0b695ff56 - <rustc_parse[352ee8005d917dd6]::parser::Parser>::parse_item_
  23:     0x79e0b695f62c - <rustc_parse[352ee8005d917dd6]::parser::Parser>::parse_mod
  24:     0x79e0b6e7c9e7 - <rustc_interface[dd56aaed4815c9c3]::queries::Queries>::parse
  25:     0x79e0b6de7646 - rustc_interface[dd56aaed4815c9c3]::interface::run_compiler::<core[52b6a911b4720599]::result::Result<(), rustc_span[35866dc41a87639c]::ErrorGuaranteed>, rustc_driver_impl[38b2d71697c3137b]::run_compiler::{closure#0}>::{closure#1}
  26:     0x79e0b6d9b0c9 - std[345a6075b69746bb]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[dd56aaed4815c9c3]::util::run_in_thread_with_globals<rustc_interface[dd56aaed4815c9c3]::util::run_in_thread_pool_with_globals<rustc_interface[dd56aaed4815c9c3]::interface::run_compiler<core[52b6a911b4720599]::result::Result<(), rustc_span[35866dc41a87639c]::ErrorGuaranteed>, rustc_driver_impl[38b2d71697c3137b]::run_compiler::{closure#0}>::{closure#1}, core[52b6a911b4720599]::result::Result<(), rustc_span[35866dc41a87639c]::ErrorGuaranteed>>::{closure#0}, core[52b6a911b4720599]::result::Result<(), rustc_span[35866dc41a87639c]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[52b6a911b4720599]::result::Result<(), rustc_span[35866dc41a87639c]::ErrorGuaranteed>>
  27:     0x79e0b6d9ae7a - <<std[345a6075b69746bb]::thread::Builder>::spawn_unchecked_<rustc_interface[dd56aaed4815c9c3]::util::run_in_thread_with_globals<rustc_interface[dd56aaed4815c9c3]::util::run_in_thread_pool_with_globals<rustc_interface[dd56aaed4815c9c3]::interface::run_compiler<core[52b6a911b4720599]::result::Result<(), rustc_span[35866dc41a87639c]::ErrorGuaranteed>, rustc_driver_impl[38b2d71697c3137b]::run_compiler::{closure#0}>::{closure#1}, core[52b6a911b4720599]::result::Result<(), rustc_span[35866dc41a87639c]::ErrorGuaranteed>>::{closure#0}, core[52b6a911b4720599]::result::Result<(), rustc_span[35866dc41a87639c]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[52b6a911b4720599]::result::Result<(), rustc_span[35866dc41a87639c]::ErrorGuaranteed>>::{closure#2} as core[52b6a911b4720599]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  28:     0x79e0b867a4fb - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::he4016fa7a4767d81
                               at /rustc/8c39ac9eccdfaeff11bd3b6107817a81fe0a3a43/library/alloc/src/boxed.rs:2064:9
  29:     0x79e0b867a4fb - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h530d2f5d97b41cf7
                               at /rustc/8c39ac9eccdfaeff11bd3b6107817a81fe0a3a43/library/alloc/src/boxed.rs:2064:9
  30:     0x79e0b867a4fb - std::sys::pal::unix::thread::Thread::new::thread_start::h5aa83f9ec739fa87
                               at /rustc/8c39ac9eccdfaeff11bd3b6107817a81fe0a3a43/library/std/src/sys/pal/unix/thread.rs:108:17
  31:     0x79e0b840eded - <unknown>
  32:     0x79e0b84920dc - <unknown>
  33:                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: rustc 1.81.0-nightly (8c39ac9ec 2024-07-11) running on x86_64-unknown-linux-gnu

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 Jul 11, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jul 11, 2024
@matthiaskrgr
Copy link
Member Author

#127419 cc @trevyn

@bors bors closed this as completed in d433f17 Jul 12, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Jul 12, 2024
Rollup merge of rust-lang#127601 - trevyn:issue-127600, r=compiler-errors

check is_ident before parse_ident

Closes rust-lang#127600
@saethlin saethlin removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jul 12, 2024
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.

3 participants