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: entered unreachable code: parse_dot_or_call_expr_with_ shouldn't produce this #123383

Closed
matthiaskrgr opened this issue Apr 2, 2024 · 1 comment · Fixed by #123394
Closed
Assignees
Labels
C-bug Category: This is a bug. F-postfix_match `#![feature(postfix_match)]` 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 Apr 2, 2024

snippet:

fn main() {
    bar::c::cc as cal.match {};
}

EDIT: smaller:

fn main() {
    a as b.match {};
}

Version information

rustc 1.79.0-nightly (36b6f9b58 2024-04-02)
binary: rustc
commit-hash: 36b6f9b58e78a1225a322a759e42c262e6dc8d5d
commit-date: 2024-04-02
host: x86_64-unknown-linux-gnu
release: 1.79.0-nightly
LLVM version: 18.1.2

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

Program output

thread 'rustc' panicked at compiler/rustc_parse/src/parser/expr.rs:864:26:
internal error: entered unreachable code: parse_dot_or_call_expr_with_ shouldn't produce this
stack backtrace:
   0:     0x7877392ebab5 - std::backtrace_rs::backtrace::libunwind::trace::hb554c6cfce162cb7
                               at /rustc/36b6f9b58e78a1225a322a759e42c262e6dc8d5d/library/std/src/../../backtrace/src/backtrace/libunwind.rs:105:5
   1:     0x7877392ebab5 - std::backtrace_rs::backtrace::trace_unsynchronized::h9dc33cf446c01521
                               at /rustc/36b6f9b58e78a1225a322a759e42c262e6dc8d5d/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7877392ebab5 - std::sys_common::backtrace::_print_fmt::hfaf9c226bbee02d6
                               at /rustc/36b6f9b58e78a1225a322a759e42c262e6dc8d5d/library/std/src/sys_common/backtrace.rs:68:5
   3:     0x7877392ebab5 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h709ff639877dfcc9
                               at /rustc/36b6f9b58e78a1225a322a759e42c262e6dc8d5d/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x78773933acfb - core::fmt::rt::Argument::fmt::ha2e1d329cf33e392
                               at /rustc/36b6f9b58e78a1225a322a759e42c262e6dc8d5d/library/core/src/fmt/rt.rs:142:9
   5:     0x78773933acfb - core::fmt::write::hc6e32ec589b5b732
                               at /rustc/36b6f9b58e78a1225a322a759e42c262e6dc8d5d/library/core/src/fmt/mod.rs:1153:17
   6:     0x7877392e071f - std::io::Write::write_fmt::h76af0a9a50d5920b
                               at /rustc/36b6f9b58e78a1225a322a759e42c262e6dc8d5d/library/std/src/io/mod.rs:1843:15
   7:     0x7877392eb88e - std::sys_common::backtrace::_print::h050eb9698c773e14
                               at /rustc/36b6f9b58e78a1225a322a759e42c262e6dc8d5d/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7877392eb88e - std::sys_common::backtrace::print::hf972d8655188dec4
                               at /rustc/36b6f9b58e78a1225a322a759e42c262e6dc8d5d/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7877392ee2d9 - std::panicking::default_hook::{{closure}}::h11f7742d4e1e394f
  10:     0x7877392ee043 - std::panicking::default_hook::h47c437f579fa3ba0
                               at /rustc/36b6f9b58e78a1225a322a759e42c262e6dc8d5d/library/std/src/panicking.rs:291:9
  11:     0x787735bfa23e - std[dde4c46f3e4e4933]::panicking::update_hook::<alloc[40f8f08cb9ca21e1]::boxed::Box<rustc_driver_impl[ab9373d42ce754a3]::install_ice_hook::{closure#0}>>::{closure#0}
  12:     0x7877392ee9dc - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h97cf3abc6eaf7b2c
                               at /rustc/36b6f9b58e78a1225a322a759e42c262e6dc8d5d/library/alloc/src/boxed.rs:2032:9
  13:     0x7877392ee9dc - std::panicking::rust_panic_with_hook::h0852f31e48eac668
                               at /rustc/36b6f9b58e78a1225a322a759e42c262e6dc8d5d/library/std/src/panicking.rs:792:13
  14:     0x7877392ee74d - std::panicking::begin_panic_handler::{{closure}}::h3de72ba740b32f92
                               at /rustc/36b6f9b58e78a1225a322a759e42c262e6dc8d5d/library/std/src/panicking.rs:649:13
  15:     0x7877392ebf79 - std::sys_common::backtrace::__rust_end_short_backtrace::h7fb3651ed3021033
                               at /rustc/36b6f9b58e78a1225a322a759e42c262e6dc8d5d/library/std/src/sys_common/backtrace.rs:171:18
  16:     0x7877392ee4b7 - rust_begin_unwind
                               at /rustc/36b6f9b58e78a1225a322a759e42c262e6dc8d5d/library/std/src/panicking.rs:645:5
  17:     0x787739337196 - core::panicking::panic_fmt::h661b0cb8cba97650
                               at /rustc/36b6f9b58e78a1225a322a759e42c262e6dc8d5d/library/core/src/panicking.rs:72:14
  18:     0x787737484b4e - <rustc_parse[61130940a4f934c7]::parser::Parser>::parse_and_disallow_postfix_after_cast
  19:     0x787737483f76 - <rustc_parse[61130940a4f934c7]::parser::Parser>::parse_assoc_op_cast
  20:     0x787733d7e686 - <rustc_parse[61130940a4f934c7]::parser::Parser>::parse_expr_assoc_with
  21:     0x787737253ecd - <rustc_parse[61130940a4f934c7]::parser::Parser>::parse_stmt_without_recovery
  22:     0x787737251f5d - <rustc_parse[61130940a4f934c7]::parser::Parser>::parse_full_stmt
  23:     0x7877372514e8 - <rustc_parse[61130940a4f934c7]::parser::Parser>::parse_block_tail
  24:     0x78773725d2e9 - <rustc_parse[61130940a4f934c7]::parser::Parser>::parse_fn
  25:     0x787737222b15 - <rustc_parse[61130940a4f934c7]::parser::Parser>::parse_item_kind
  26:     0x787737245883 - <rustc_parse[61130940a4f934c7]::parser::Parser>::parse_item_common
  27:     0x7877372427e5 - <rustc_parse[61130940a4f934c7]::parser::Parser>::parse_mod
  28:     0x787737e437ce - rustc_interface[f4f6ad3d2f6f7b2e]::passes::parse
  29:     0x787737e435d3 - <rustc_interface[f4f6ad3d2f6f7b2e]::queries::Queries>::parse
  30:     0x787737c220ec - rustc_interface[f4f6ad3d2f6f7b2e]::interface::run_compiler::<core[27be123739a20c93]::result::Result<(), rustc_span[4b546e586c05f092]::ErrorGuaranteed>, rustc_driver_impl[ab9373d42ce754a3]::run_compiler::{closure#0}>::{closure#0}
  31:     0x787737cf4253 - std[dde4c46f3e4e4933]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[f4f6ad3d2f6f7b2e]::util::run_in_thread_with_globals<rustc_interface[f4f6ad3d2f6f7b2e]::util::run_in_thread_pool_with_globals<rustc_interface[f4f6ad3d2f6f7b2e]::interface::run_compiler<core[27be123739a20c93]::result::Result<(), rustc_span[4b546e586c05f092]::ErrorGuaranteed>, rustc_driver_impl[ab9373d42ce754a3]::run_compiler::{closure#0}>::{closure#0}, core[27be123739a20c93]::result::Result<(), rustc_span[4b546e586c05f092]::ErrorGuaranteed>>::{closure#0}, core[27be123739a20c93]::result::Result<(), rustc_span[4b546e586c05f092]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[27be123739a20c93]::result::Result<(), rustc_span[4b546e586c05f092]::ErrorGuaranteed>>
  32:     0x787737cf4061 - <<std[dde4c46f3e4e4933]::thread::Builder>::spawn_unchecked_<rustc_interface[f4f6ad3d2f6f7b2e]::util::run_in_thread_with_globals<rustc_interface[f4f6ad3d2f6f7b2e]::util::run_in_thread_pool_with_globals<rustc_interface[f4f6ad3d2f6f7b2e]::interface::run_compiler<core[27be123739a20c93]::result::Result<(), rustc_span[4b546e586c05f092]::ErrorGuaranteed>, rustc_driver_impl[ab9373d42ce754a3]::run_compiler::{closure#0}>::{closure#0}, core[27be123739a20c93]::result::Result<(), rustc_span[4b546e586c05f092]::ErrorGuaranteed>>::{closure#0}, core[27be123739a20c93]::result::Result<(), rustc_span[4b546e586c05f092]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[27be123739a20c93]::result::Result<(), rustc_span[4b546e586c05f092]::ErrorGuaranteed>>::{closure#1} as core[27be123739a20c93]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  33:     0x7877392f83fb - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h930e146764354393
                               at /rustc/36b6f9b58e78a1225a322a759e42c262e6dc8d5d/library/alloc/src/boxed.rs:2018:9
  34:     0x7877392f83fb - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h9f08d22b87052fc1
                               at /rustc/36b6f9b58e78a1225a322a759e42c262e6dc8d5d/library/alloc/src/boxed.rs:2018:9
  35:     0x7877392f83fb - std::sys::pal::unix::thread::Thread::new::thread_start::hd7bb799ae250c035
                               at /rustc/36b6f9b58e78a1225a322a759e42c262e6dc8d5d/library/std/src/sys/pal/unix/thread.rs:108:17
  36:     0x787732aa955a - <unknown>
  37:     0x787732b26a3c - <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: rustc 1.79.0-nightly (36b6f9b58 2024-04-02) 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 Apr 2, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Apr 2, 2024
@matthiaskrgr matthiaskrgr added the F-postfix_match `#![feature(postfix_match)]` label Apr 2, 2024
@matthiaskrgr
Copy link
Member Author

#121619 cc @RossSmyth

@compiler-errors compiler-errors self-assigned this Apr 2, 2024
@jieyouxu jieyouxu removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Apr 3, 2024
@bors bors closed this as completed in deb48aa Apr 3, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Apr 3, 2024
Rollup merge of rust-lang#123394 - compiler-errors:postfix-match-fixes, r=estebank

Postfix match fixes

1. Don't ice on `expr as Ty.match {}`
2. Fix the suggestion span for non-exhaustive matches to add `_ => todo!(),`

Fixes rust-lang#123383
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-postfix_match `#![feature(postfix_match)]` 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.

4 participants