Skip to content

ICE: entered unreachable code: parse_dot_or_call_expr_with_ shouldn't produce this #144527

@cushionbadak

Description

@cushionbadak

Code

fn main() {
    foo::bar as baz.yield
}
Original mutant

fn main() {
    marco_use::bar::quux as cal.yield &a {};
}

A mutant of glacier2's fixed/123383-1.rs.

Meta

rustc --version --verbose:

rustc 1.90.0-nightly (ce5fdd7d4 2025-07-26)
binary: rustc
commit-hash: ce5fdd7d42aba9a2925692e11af2bd39cf37798a
commit-date: 2025-07-26
host: aarch64-apple-darwin
release: 1.90.0-nightly
LLVM version: 20.1.8

Error output

Command: rustc

thread 'rustc' panicked at compiler/rustc_parse/src/parser/expr.rs:790:26:
internal error: entered unreachable code: parse_dot_or_call_expr_with_ shouldn't produce this
Backtrace

thread 'rustc' panicked at compiler/rustc_parse/src/parser/expr.rs:790:26:
internal error: entered unreachable code: parse_dot_or_call_expr_with_ shouldn't produce this
stack backtrace:
   0:        0x10eddd320 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h1594c8453712981c
   1:        0x10c2bed80 - core::fmt::write::h34cb90876f5d64c5
   2:        0x10edd1958 - std::io::Write::write_fmt::h7e817f1d11c8efad
   3:        0x10eddd1e0 - std::sys::backtrace::BacktraceLock::print::h333d5c96a4c6ae9f
   4:        0x10ede1d94 - std::panicking::default_hook::{{closure}}::hbd90616774065468
   5:        0x10ede1a6c - std::panicking::default_hook::h6af1ee91e8c02d13
   6:        0x10ceac424 - rustc_driver_impl[958a68ac8616d6a4]::install_ice_hook::{closure#1}
   7:        0x10ede2720 - std::panicking::rust_panic_with_hook::h90248fc01dca11c1
   8:        0x10ede22e0 - std::panicking::begin_panic_handler::{{closure}}::h2ad3db39166c496b
   9:        0x10eddd7bc - std::sys::backtrace::__rust_end_short_backtrace::hdbd09c712056bfdb
  10:        0x10ede200c - __rustc[3aaae60b58908e19]::rust_begin_unwind
  11:        0x111a1e4a8 - core::panicking::panic_fmt::h19107e67a72fa5ac
  12:        0x10dfec4d0 - <rustc_parse[c767a5a077b54cd6]::parser::Parser>::parse_expr_assoc_rest_with
  13:        0x10dfc94e4 - <rustc_parse[c767a5a077b54cd6]::parser::Parser>::collect_tokens::<rustc_ast[d31bd7a6480b90b8]::ast::Stmt, <rustc_parse[c767a5a077b54cd6]::parser::Parser>::parse_stmt_without_recovery::{closure#4}>
  14:        0x10e06a60c - <rustc_parse[c767a5a077b54cd6]::parser::Parser>::parse_stmt_without_recovery
  15:        0x10e071b98 - <rustc_parse[c767a5a077b54cd6]::parser::Parser>::parse_full_stmt
  16:        0x10e070a7c - <rustc_parse[c767a5a077b54cd6]::parser::Parser>::parse_block_tail
  17:        0x10e070204 - <rustc_parse[c767a5a077b54cd6]::parser::Parser>::parse_block_common
  18:        0x10e04808c - <rustc_parse[c767a5a077b54cd6]::parser::Parser>::parse_fn_body
  19:        0x10e047d48 - <rustc_parse[c767a5a077b54cd6]::parser::Parser>::parse_fn
  20:        0x10e02d7c4 - <rustc_parse[c767a5a077b54cd6]::parser::Parser>::parse_item_kind
  21:        0x10e02afa0 - <rustc_parse[c767a5a077b54cd6]::parser::Parser>::parse_item_common
  22:        0x10e02a998 - <rustc_parse[c767a5a077b54cd6]::parser::Parser>::parse_item_
  23:        0x10e029f40 - <rustc_parse[c767a5a077b54cd6]::parser::Parser>::parse_mod
  24:        0x10d789a28 - rustc_interface[edc599394d0ba7e4]::passes::parse
  25:        0x10ce5cb78 - rustc_interface[edc599394d0ba7e4]::interface::run_compiler::<(), rustc_driver_impl[958a68ac8616d6a4]::run_compiler::{closure#0}>::{closure#1}
  26:        0x10ce524dc - std[2e8331686e48b1eb]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[edc599394d0ba7e4]::util::run_in_thread_with_globals<rustc_interface[edc599394d0ba7e4]::util::run_in_thread_pool_with_globals<rustc_interface[edc599394d0ba7e4]::interface::run_compiler<(), rustc_driver_impl[958a68ac8616d6a4]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
  27:        0x10ce5f344 - <<std[2e8331686e48b1eb]::thread::Builder>::spawn_unchecked_<rustc_interface[edc599394d0ba7e4]::util::run_in_thread_with_globals<rustc_interface[edc599394d0ba7e4]::util::run_in_thread_pool_with_globals<rustc_interface[edc599394d0ba7e4]::interface::run_compiler<(), rustc_driver_impl[958a68ac8616d6a4]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[c38aea140a3b1cee]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  28:        0x10ede5a90 - std::sys::pal::unix::thread::Thread::new::thread_start::hb8819dabb00c668a
  29:        0x18759ac0c - __pthread_cond_wait

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 `/Users/jb/workspace/run_250725_250515_icemaker_perfeval_gb_34h/scratch/rustc-ice-2025-07-27T07_27_46-80438.txt` to your bug report

query stack during panic:
end of query stack

Notes

ICE location: compiler/rustc_parse/src/parser/expr.rs Line-790

if !matches!(with_postfix.kind, ExprKind::Cast(_, _)) {
let msg = format!(
"cast cannot be followed by {}",
match with_postfix.kind {
ExprKind::Index(..) => "indexing",
ExprKind::Try(_) => "`?`",
ExprKind::Field(_, _) => "a field access",
ExprKind::MethodCall(_) => "a method call",
ExprKind::Call(_, _) => "a function call",
ExprKind::Await(_, _) => "`.await`",
ExprKind::Use(_, _) => "`.use`",
ExprKind::Match(_, _, MatchKind::Postfix) => "a postfix match",
ExprKind::Err(_) => return Ok(with_postfix),
_ => unreachable!("parse_dot_or_call_expr_with_ shouldn't produce this"),
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions