Skip to content

ice: unreachable expr.rs #112622

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
matthiaskrgr opened this issue Jun 14, 2023 · 3 comments · Fixed by #112642
Closed

ice: unreachable expr.rs #112622

matthiaskrgr opened this issue Jun 14, 2023 · 3 comments · Fixed by #112642
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-low Low priority regression-from-stable-to-stable Performance or correctness regression from one stable version to another. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@matthiaskrgr
Copy link
Member

Code

macro_rules! sink {
    ($abi:literal) => {
        extern $abi

        extern $abi fn _export

        type _PTR = extern $abi fn;
    }
}

fn main() {
    let _ = sink!("Foo"__);
}

Meta

rustc --version --verbose:

rustc 1.72.0-nightly (371994e0d 2023-06-13)
binary: rustc
commit-hash: 371994e0d8380600ddda78ca1be937c7fb179b49
commit-date: 2023-06-13
host: x86_64-unknown-linux-gnu
release: 1.72.0-nightly
LLVM version: 16.0.5

Error output

-
Backtrace

thread 'rustc' panicked at 'internal error: entered unreachable code', compiler/rustc_parse/src/parser/expr.rs:2035:29
stack backtrace:
   0:     0x7f2cf3368c41 - std::backtrace_rs::backtrace::libunwind::trace::h4e5cd7155e2ebaac
                               at /rustc/371994e0d8380600ddda78ca1be937c7fb179b49/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f2cf3368c41 - std::backtrace_rs::backtrace::trace_unsynchronized::hb4d504f8def07b70
                               at /rustc/371994e0d8380600ddda78ca1be937c7fb179b49/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f2cf3368c41 - std::sys_common::backtrace::_print_fmt::h270ee65403a6a640
                               at /rustc/371994e0d8380600ddda78ca1be937c7fb179b49/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7f2cf3368c41 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hfa127bbe4d370ae8
                               at /rustc/371994e0d8380600ddda78ca1be937c7fb179b49/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f2cf33c95ff - core::fmt::rt::Argument::fmt::h975c0825ea1bb836
                               at /rustc/371994e0d8380600ddda78ca1be937c7fb179b49/library/core/src/fmt/rt.rs:138:9
   5:     0x7f2cf33c95ff - core::fmt::write::hb200bbda235147d0
                               at /rustc/371994e0d8380600ddda78ca1be937c7fb179b49/library/core/src/fmt/mod.rs:1094:21
   6:     0x7f2cf335bee1 - std::io::Write::write_fmt::hf4eeaa80392fd692
                               at /rustc/371994e0d8380600ddda78ca1be937c7fb179b49/library/std/src/io/mod.rs:1713:15
   7:     0x7f2cf3368a55 - std::sys_common::backtrace::_print::h2427e2e0721aca68
                               at /rustc/371994e0d8380600ddda78ca1be937c7fb179b49/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7f2cf3368a55 - std::sys_common::backtrace::print::h8c074174f5a65b94
                               at /rustc/371994e0d8380600ddda78ca1be937c7fb179b49/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7f2cf336b737 - std::panicking::default_hook::{{closure}}::habdecd03f278805d
  10:     0x7f2cf336b524 - std::panicking::default_hook::hfeee4c9ec6e7984a
                               at /rustc/371994e0d8380600ddda78ca1be937c7fb179b49/library/std/src/panicking.rs:288:9
  11:     0x7f2cf65ef46b - rustc_driver_impl[82ed5c687fa14bc7]::install_ice_hook::{closure#0}
  12:     0x7f2cf336be7d - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h75ee17e40156a9b1
                               at /rustc/371994e0d8380600ddda78ca1be937c7fb179b49/library/alloc/src/boxed.rs:1999:9
  13:     0x7f2cf336be7d - std::panicking::rust_panic_with_hook::h50748255142a0809
                               at /rustc/371994e0d8380600ddda78ca1be937c7fb179b49/library/std/src/panicking.rs:709:13
  14:     0x7f2cf336bbd1 - std::panicking::begin_panic_handler::{{closure}}::h1532befb1017034b
                               at /rustc/371994e0d8380600ddda78ca1be937c7fb179b49/library/std/src/panicking.rs:595:13
  15:     0x7f2cf3369076 - std::sys_common::backtrace::__rust_end_short_backtrace::h36f919598d3260ac
                               at /rustc/371994e0d8380600ddda78ca1be937c7fb179b49/library/std/src/sys_common/backtrace.rs:151:18
  16:     0x7f2cf336b962 - rust_begin_unwind
                               at /rustc/371994e0d8380600ddda78ca1be937c7fb179b49/library/std/src/panicking.rs:593:5
  17:     0x7f2cf33c5883 - core::panicking::panic_fmt::h637089c9b9878b43
                               at /rustc/371994e0d8380600ddda78ca1be937c7fb179b49/library/core/src/panicking.rs:67:14
  18:     0x7f2cf33c5913 - core::panicking::panic::hafc1723084de6f6f
                               at /rustc/371994e0d8380600ddda78ca1be937c7fb179b49/library/core/src/panicking.rs:117:5
  19:     0x7f2cf528a9a8 - <rustc_parse[875314dae382605e]::parser::Parser>::parse_opt_meta_item_lit
  20:     0x7f2cf573899a - <rustc_parse[875314dae382605e]::parser::Parser>::parse_item_foreign_mod
  21:     0x7f2cf56ee175 - <rustc_parse[875314dae382605e]::parser::Parser>::parse_item_kind
  22:     0x7f2cf56e7a62 - <rustc_parse[875314dae382605e]::parser::Parser>::parse_item_common
  23:     0x7f2cf51bbee2 - <rustc_parse[875314dae382605e]::parser::Parser>::parse_stmt_without_recovery
  24:     0x7f2cf5058ad1 - <rustc_parse[875314dae382605e]::parser::Parser>::parse_full_stmt
  25:     0x7f2cf5051193 - rustc_expand[3d8282d625be83b0]::expand::parse_ast_fragment
  26:     0x7f2cf66983cf - rustc_expand[3d8282d625be83b0]::mbe::diagnostics::emit_frag_parse_err
  27:     0x7f2cf504e3d1 - <rustc_expand[3d8282d625be83b0]::mbe::macro_rules::ParserAnyMacro>::make
  28:     0x7f2cf504d86d - <rustc_expand[3d8282d625be83b0]::mbe::macro_rules::ParserAnyMacro as rustc_expand[3d8282d625be83b0]::base::MacResult>::make_expr
  29:     0x7f2cf5047f98 - <rustc_expand[3d8282d625be83b0]::expand::MacroExpander>::fully_expand_fragment
  30:     0x7f2cf56442a7 - <rustc_expand[3d8282d625be83b0]::expand::MacroExpander>::expand_crate
  31:     0x7f2cf56435b0 - <rustc_session[c89a0e04955a4434]::session::Session>::time::<rustc_ast[e53a9a02179a5d5]::ast::Crate, rustc_interface[5fbdb9547dedf44d]::passes::configure_and_expand::{closure#1}>
  32:     0x7f2cf55f6ec4 - rustc_interface[5fbdb9547dedf44d]::passes::resolver_for_lowering
  33:     0x7f2cf5b072ca - rustc_query_impl[eec84043af3db326]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[eec84043af3db326]::query_impl::resolver_for_lowering::dynamic_query::{closure#2}::{closure#0}, rustc_middle[cf9791794388bff2]::query::erase::Erased<[u8; 8usize]>>
  34:     0x7f2cf5b072b9 - <rustc_query_impl[eec84043af3db326]::query_impl::resolver_for_lowering::dynamic_query::{closure#2} as core[c5a351271e0d68a3]::ops::function::FnOnce<(rustc_middle[cf9791794388bff2]::ty::context::TyCtxt, ())>>::call_once
  35:     0x7f2cf5a2d65c - rustc_query_system[558b060458ea38]::query::plumbing::try_execute_query::<rustc_query_impl[eec84043af3db326]::DynamicConfig<rustc_query_system[558b060458ea38]::query::caches::SingleCache<rustc_middle[cf9791794388bff2]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[eec84043af3db326]::plumbing::QueryCtxt, false>
  36:     0x7f2cf5f736b7 - rustc_query_impl[eec84043af3db326]::query_impl::resolver_for_lowering::get_query_non_incr::__rust_end_short_backtrace
  37:     0x7f2cf5c6a0f3 - <rustc_middle[cf9791794388bff2]::ty::context::GlobalCtxt>::enter::<rustc_driver_impl[82ed5c687fa14bc7]::run_compiler::{closure#1}::{closure#2}::{closure#2}, &rustc_data_structures[77d4adee0611d83c]::steal::Steal<(rustc_middle[cf9791794388bff2]::ty::ResolverAstLowering, alloc[a8c9cd47032004ef]::rc::Rc<rustc_ast[e53a9a02179a5d5]::ast::Crate>)>>
  38:     0x7f2cf58bff05 - <rustc_interface[5fbdb9547dedf44d]::interface::Compiler>::enter::<rustc_driver_impl[82ed5c687fa14bc7]::run_compiler::{closure#1}::{closure#2}, core[c5a351271e0d68a3]::result::Result<core[c5a351271e0d68a3]::option::Option<rustc_interface[5fbdb9547dedf44d]::queries::Linker>, rustc_span[5b25b58355c0a00e]::ErrorGuaranteed>>
  39:     0x7f2cf58bdb79 - <scoped_tls[c0707037e0f60a9b]::ScopedKey<rustc_span[5b25b58355c0a00e]::SessionGlobals>>::set::<rustc_interface[5fbdb9547dedf44d]::interface::run_compiler<core[c5a351271e0d68a3]::result::Result<(), rustc_span[5b25b58355c0a00e]::ErrorGuaranteed>, rustc_driver_impl[82ed5c687fa14bc7]::run_compiler::{closure#1}>::{closure#0}, core[c5a351271e0d68a3]::result::Result<(), rustc_span[5b25b58355c0a00e]::ErrorGuaranteed>>
  40:     0x7f2cf58bcfe6 - std[cd097dad4f2506ec]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[5fbdb9547dedf44d]::util::run_in_thread_pool_with_globals<rustc_interface[5fbdb9547dedf44d]::interface::run_compiler<core[c5a351271e0d68a3]::result::Result<(), rustc_span[5b25b58355c0a00e]::ErrorGuaranteed>, rustc_driver_impl[82ed5c687fa14bc7]::run_compiler::{closure#1}>::{closure#0}, core[c5a351271e0d68a3]::result::Result<(), rustc_span[5b25b58355c0a00e]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[c5a351271e0d68a3]::result::Result<(), rustc_span[5b25b58355c0a00e]::ErrorGuaranteed>>
  41:     0x7f2cf58bcd95 - <<std[cd097dad4f2506ec]::thread::Builder>::spawn_unchecked_<rustc_interface[5fbdb9547dedf44d]::util::run_in_thread_pool_with_globals<rustc_interface[5fbdb9547dedf44d]::interface::run_compiler<core[c5a351271e0d68a3]::result::Result<(), rustc_span[5b25b58355c0a00e]::ErrorGuaranteed>, rustc_driver_impl[82ed5c687fa14bc7]::run_compiler::{closure#1}>::{closure#0}, core[c5a351271e0d68a3]::result::Result<(), rustc_span[5b25b58355c0a00e]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[c5a351271e0d68a3]::result::Result<(), rustc_span[5b25b58355c0a00e]::ErrorGuaranteed>>::{closure#1} as core[c5a351271e0d68a3]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  42:     0x7f2cf33763a5 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hae3241ec192e9c95
                               at /rustc/371994e0d8380600ddda78ca1be937c7fb179b49/library/alloc/src/boxed.rs:1985:9
  43:     0x7f2cf33763a5 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h75f69d4e89077470
                               at /rustc/371994e0d8380600ddda78ca1be937c7fb179b49/library/alloc/src/boxed.rs:1985:9
  44:     0x7f2cf33763a5 - std::sys::unix::thread::Thread::new::thread_start::heddaad8550613863
                               at /rustc/371994e0d8380600ddda78ca1be937c7fb179b49/library/std/src/sys/unix/thread.rs:108:17
  45:     0x7f2cf310f44b - <unknown>
  46:     0x7f2cf3192e40 - <unknown>
  47:                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.72.0-nightly (371994e0d 2023-06-13) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [resolver_for_lowering] getting the resolver for lowering
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 Jun 14, 2023
@matthiaskrgr
Copy link
Member Author

Regression in nightly-2022-11-18


found 8 bors merge commits in the specified range
  commit[0] 2022-11-16: Auto merge of #104456 - RalfJung:miri, r=RalfJung
  commit[1] 2022-11-16: Auto merge of #102944 - nnethercote:ast-Lit-third-time-lucky, r=petrochenkov
  commit[2] 2022-11-17: Auto merge of #103138 - nnethercote:merge-BBs, r=bjorn3
  commit[3] 2022-11-17: Auto merge of #103779 - the8472:simd-str-contains, r=thomcc
  commit[4] 2022-11-17: Auto merge of #104170 - cjgillot:hir-def-id, r=fee1-dead
  commit[5] 2022-11-17: Auto merge of #104205 - clubby789:grow-rc, r=thomcc
  commit[6] 2022-11-17: Auto merge of #104219 - bryangarza:async-track-caller-dup, r=eholk
  commit[7] 2022-11-17: Auto merge of #104361 - vladimir-ea:watchos_fix_linking, r=oli-obk
ERROR: no CI builds available between e9493d63c2a57b91556dccd219e21821432c7445 and 83356b78c4ff3e7d84e977aa6143793545967301 within last 167 days

@Jules-Bertholet
Copy link
Contributor

@rustbot label regression-from-stable-to-stable

@rustbot rustbot added regression-from-stable-to-stable Performance or correctness regression from one stable version to another. I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Jun 14, 2023
@apiraino
Copy link
Contributor

WG-prioritization assigning priority (Zulip discussion).

@rustbot label -I-prioritize +P-low

@rustbot rustbot added P-low Low priority and removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Jun 15, 2023
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jun 16, 2023
…nnethercote

Handle interpolated literal errors

Not sure why it was doing a whole dance to re-match on the token kind when it seems like `Lit::from_token` does the right thing for both macro-arg and regular literals. Nothing seems to have regressed diagnostics-wise from the change, though.

Fixes rust-lang#112622

r? `@nnethercote`
@bors bors closed this as completed in c2e1097 Jun 16, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-low Low priority regression-from-stable-to-stable Performance or correctness regression from one stable version to another. 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