Skip to content

ICE: unreachable match arm in concat_bytes::invalid_type_err #104769

Closed
@jruderman

Description

@jruderman

Code

#![feature(concat_bytes)]

fn main() {
    concat_bytes!(7Y);
}

Error output

thread 'rustc' panicked at 'internal error: entered unreachable code', compiler/rustc_builtin_macros/src/concat_bytes.rs:71:14

Backtrace

stack backtrace:
   0:        0x10c2fd152 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::he02b81ee9fd93999
   1:        0x10c35bbba - core::fmt::write::h2defc6780b01b98f
   2:        0x10c2ef51c - std::io::Write::write_fmt::hd14cefb8f7ff162a
   3:        0x10c2fcf1a - std::sys_common::backtrace::print::hd794f53e9106805e
   4:        0x10c300246 - std::panicking::default_hook::{{closure}}::h3f1a7d2a7e113922
   5:        0x10c2fff97 - std::panicking::default_hook::hc2ab762c436ea8e6
   6:        0x1197e377d - rustc_driver[2fa5ced89a36b2bb]::DEFAULT_HOOK::{closure#0}::{closure#0}
   7:        0x10c300a2d - std::panicking::rust_panic_with_hook::h6737e44fee662a10
   8:        0x10c300792 - std::panicking::begin_panic_handler::{{closure}}::h4a64d9a8992bcb9b
   9:        0x10c2fd5e8 - std::sys_common::backtrace::__rust_end_short_backtrace::hbfe08945b06bbded
  10:        0x10c30049d - _rust_begin_unwind
  11:        0x10c3883b3 - core::panicking::panic_fmt::h33758e422e6757c6
  12:        0x10c388487 - core::panicking::panic::h104d4c2160940b10
  13:        0x11c6d2827 - rustc_builtin_macros[6e397771dfd08578]::concat_bytes::invalid_type_err
  14:        0x11c6d3487 - rustc_builtin_macros[6e397771dfd08578]::concat_bytes::expand_concat_bytes
  15:        0x11d8e2956 - <rustc_expand[c077f77e487cbca0]::expand::MacroExpander>::fully_expand_fragment
  16:        0x11d8e1a36 - <rustc_expand[c077f77e487cbca0]::expand::MacroExpander>::expand_crate
  17:        0x1198644bf - <rustc_session[1d2780505fe32284]::session::Session>::time::<core[3d042c94762723bc]::result::Result<rustc_ast[12eca1c47efd111e]::ast::Crate, rustc_errors[a3b0880de9357bbd]::ErrorGuaranteed>, rustc_interface[ebeaf7db7192038f]::passes::configure_and_expand::{closure#1}>
  18:        0x11989b7b5 - rustc_interface[ebeaf7db7192038f]::passes::configure_and_expand
  19:        0x11987e55a - <rustc_interface[ebeaf7db7192038f]::queries::Queries>::expansion
  20:        0x1197ba3a0 - rustc_span[8424830d8e8bf797]::with_source_map::<core[3d042c94762723bc]::result::Result<(), rustc_errors[a3b0880de9357bbd]::ErrorGuaranteed>, rustc_interface[ebeaf7db7192038f]::interface::run_compiler<core[3d042c94762723bc]::result::Result<(), rustc_errors[a3b0880de9357bbd]::ErrorGuaranteed>, rustc_driver[2fa5ced89a36b2bb]::run_compiler::{closure#1}>::{closure#0}::{closure#1}>
  21:        0x1197b0e8c - <scoped_tls[d5d11682d6a263c2]::ScopedKey<rustc_span[8424830d8e8bf797]::SessionGlobals>>::set::<rustc_interface[ebeaf7db7192038f]::interface::run_compiler<core[3d042c94762723bc]::result::Result<(), rustc_errors[a3b0880de9357bbd]::ErrorGuaranteed>, rustc_driver[2fa5ced89a36b2bb]::run_compiler::{closure#1}>::{closure#0}, core[3d042c94762723bc]::result::Result<(), rustc_errors[a3b0880de9357bbd]::ErrorGuaranteed>>
  22:        0x119779a3a - std[a7bcc37ac91ea507]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[ebeaf7db7192038f]::util::run_in_thread_pool_with_globals<rustc_interface[ebeaf7db7192038f]::interface::run_compiler<core[3d042c94762723bc]::result::Result<(), rustc_errors[a3b0880de9357bbd]::ErrorGuaranteed>, rustc_driver[2fa5ced89a36b2bb]::run_compiler::{closure#1}>::{closure#0}, core[3d042c94762723bc]::result::Result<(), rustc_errors[a3b0880de9357bbd]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[3d042c94762723bc]::result::Result<(), rustc_errors[a3b0880de9357bbd]::ErrorGuaranteed>>
  23:        0x11975becb - <<std[a7bcc37ac91ea507]::thread::Builder>::spawn_unchecked_<rustc_interface[ebeaf7db7192038f]::util::run_in_thread_pool_with_globals<rustc_interface[ebeaf7db7192038f]::interface::run_compiler<core[3d042c94762723bc]::result::Result<(), rustc_errors[a3b0880de9357bbd]::ErrorGuaranteed>, rustc_driver[2fa5ced89a36b2bb]::run_compiler::{closure#1}>::{closure#0}, core[3d042c94762723bc]::result::Result<(), rustc_errors[a3b0880de9357bbd]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[3d042c94762723bc]::result::Result<(), rustc_errors[a3b0880de9357bbd]::ErrorGuaranteed>>::{closure#1} as core[3d042c94762723bc]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  24:        0x10c309de7 - std::sys::unix::thread::Thread::new::thread_start::hc3ae91907c3ce551
  25:     0x7ff816f934e1 - __pthread_start

error: internal compiler error: unexpected panic

note: 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.67.0-nightly (ff8c8dfbe 2022-11-22) running on x86_64-apple-darwin

query stack during panic:
end of query stack

Regression

Regression in nightly-2022-11-18 from bebd57a (#102944, @nnethercote)

Version

rustc 1.67.0-nightly (ff8c8dfbe 2022-11-22)
binary: rustc
commit-hash: ff8c8dfbe66701531e3e5e335c28c544d0fbc945
commit-date: 2022-11-22
host: x86_64-apple-darwin
release: 1.67.0-nightly
LLVM version: 15.0.4

Metadata

Metadata

Assignees

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.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions