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: transcribe: None #128346

Closed
matthiaskrgr opened this issue Jul 29, 2024 · 0 comments · Fixed by #131522 or #134812
Closed

ICE: transcribe: None #128346

matthiaskrgr opened this issue Jul 29, 2024 · 0 comments · Fixed by #131522 or #134812
Labels
C-bug Category: This is a bug. F-macro_metavar_expr_concat `#![feature(macro_metavar_expr_concat)]` I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ S-bug-has-test Status: This bug is tracked inside the repo by a `known-bug` test. 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):

macro_rules! one_rep {
    ( $($a:ident)* ) => {
        A(
            const ${concat($a, Z)}: i32 = 3;
        )*
    };
}

fn main() {
    one_rep!(A B C);
}

original:

#![feature(macro_metavar_expr_concat)]

macro_rules! one_rep {
    ( $($a:ident)* ) => {
        A(
            const ${concat($a, Z)}: i32 = 3;
        )*
    };
}

fn main() {
    one_rep!(A B C);
    assert_eq!(AZ, 3);
    assert_eq!{
        $(
            const ${concat($a, Z)}: i32 = 3;
        )*
    };
    assert_eq!(CZ, 3);
}

Version information

rustc 1.82.0-nightly (a5ee5cbad 2024-07-29)
binary: rustc
commit-hash: a5ee5cbad1dde83dde61959e9436716094e3408c
commit-date: 2024-07-29
host: x86_64-unknown-linux-gnu
release: 1.82.0-nightly
LLVM version: 18.1.7

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

Program output

error[E0658]: the `concat` meta-variable expression is unstable
 --> /tmp/icemaker_global_tempdir.FDR6hVZZQzAl/rustc_testrunner_tmpdir_reporting.TfJpwWG3aR5f/mvce.rs:4:20
  |
4 |             const ${concat($a, Z)}: i32 = 3;
  |                    ^^^^^^^^^^^^^^^
  |
  = note: see issue #124225 <https://github.com/rust-lang/rust/issues/124225> for more information
  = help: add `#![feature(macro_metavar_expr_concat)]` to the crate attributes to enable
  = note: this compiler was built on 2024-07-29; consider upgrading it if it is out of date

thread 'rustc' panicked at compiler/rustc_expand/src/mbe/transcribe.rs:698:63:
called `Option::unwrap()` on a `None` value
stack backtrace:
   0:     0x796dd2857055 - std::backtrace_rs::backtrace::libunwind::trace::h5200c2caec84f42d
                               at /rustc/a5ee5cbad1dde83dde61959e9436716094e3408c/library/std/src/../../backtrace/src/backtrace/libunwind.rs:116:5
   1:     0x796dd2857055 - std::backtrace_rs::backtrace::trace_unsynchronized::he7c3f8fab4bfbd07
                               at /rustc/a5ee5cbad1dde83dde61959e9436716094e3408c/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x796dd2857055 - std::sys::backtrace::_print_fmt::hd631a028372816d9
                               at /rustc/a5ee5cbad1dde83dde61959e9436716094e3408c/library/std/src/sys/backtrace.rs:66:9
   3:     0x796dd2857055 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::he0a1eeb2110733a8
                               at /rustc/a5ee5cbad1dde83dde61959e9436716094e3408c/library/std/src/sys/backtrace.rs:39:26
   4:     0x796dd28a7f2b - core::fmt::rt::Argument::fmt::h5f59e0ff9c29f201
                               at /rustc/a5ee5cbad1dde83dde61959e9436716094e3408c/library/core/src/fmt/rt.rs:173:76
   5:     0x796dd28a7f2b - core::fmt::write::h40fd57865b73e8d1
                               at /rustc/a5ee5cbad1dde83dde61959e9436716094e3408c/library/core/src/fmt/mod.rs:1178:21
   6:     0x796dd284b94f - std::io::Write::write_fmt::ha91da9d1116ba39c
                               at /rustc/a5ee5cbad1dde83dde61959e9436716094e3408c/library/std/src/io/mod.rs:1823:15
   7:     0x796dd28598f1 - std::sys::backtrace::BacktraceLock::print::h5bc1e8aea4432fca
                               at /rustc/a5ee5cbad1dde83dde61959e9436716094e3408c/library/std/src/sys/backtrace.rs:42:9
   8:     0x796dd28598f1 - std::panicking::default_hook::{{closure}}::h7ac8a47d098eca56
                               at /rustc/a5ee5cbad1dde83dde61959e9436716094e3408c/library/std/src/panicking.rs:266:22
   9:     0x796dd28595cc - std::panicking::default_hook::h23ba2c1fd8c8a801
                               at /rustc/a5ee5cbad1dde83dde61959e9436716094e3408c/library/std/src/panicking.rs:293:9
  10:     0x796dcec39279 - std[ccabb9a6d43d485f]::panicking::update_hook::<alloc[f8f6e0ead239af4d]::boxed::Box<rustc_driver_impl[31237189629bb2ae]::install_ice_hook::{closure#0}>>::{closure#0}
  11:     0x796dd285a2bf - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h01ae6a2308bc025d
                               at /rustc/a5ee5cbad1dde83dde61959e9436716094e3408c/library/alloc/src/boxed.rs:2162:9
  12:     0x796dd285a2bf - std::panicking::rust_panic_with_hook::ha5fda6924ae6df7c
                               at /rustc/a5ee5cbad1dde83dde61959e9436716094e3408c/library/std/src/panicking.rs:805:13
  13:     0x796dd2859eb3 - std::panicking::begin_panic_handler::{{closure}}::h30d298a80e866e15
                               at /rustc/a5ee5cbad1dde83dde61959e9436716094e3408c/library/std/src/panicking.rs:664:13
  14:     0x796dd2857519 - std::sys::backtrace::__rust_end_short_backtrace::hb93e9e8450183be8
                               at /rustc/a5ee5cbad1dde83dde61959e9436716094e3408c/library/std/src/sys/backtrace.rs:170:18
  15:     0x796dd2859b74 - rust_begin_unwind
                               at /rustc/a5ee5cbad1dde83dde61959e9436716094e3408c/library/std/src/panicking.rs:662:5
  16:     0x796dd28a44f3 - core::panicking::panic_fmt::h1f4e0c5152ffe5e0
                               at /rustc/a5ee5cbad1dde83dde61959e9436716094e3408c/library/core/src/panicking.rs:74:14
  17:     0x796dd28a457c - core::panicking::panic::h16d496a9254bba48
                               at /rustc/a5ee5cbad1dde83dde61959e9436716094e3408c/library/core/src/panicking.rs:148:5
  18:     0x796dd28a42e9 - core::option::unwrap_failed::h2566b8f64654f995
                               at /rustc/a5ee5cbad1dde83dde61959e9436716094e3408c/library/core/src/option.rs:2017:5
  19:     0x796dcc860028 - <rustc_expand[34e14bfb072448c]::expand::MacroExpander>::fully_expand_fragment
  20:     0x796dd0cc87d8 - <rustc_expand[34e14bfb072448c]::expand::MacroExpander>::expand_crate
  21:     0x796dd05746f3 - rustc_interface[539f3934048b9842]::passes::resolver_for_lowering_raw
  22:     0x796dd0573cb1 - rustc_query_impl[bbbbf68942f8fd9d]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[bbbbf68942f8fd9d]::query_impl::resolver_for_lowering_raw::dynamic_query::{closure#2}::{closure#0}, rustc_middle[cb63de5e900177d3]::query::erase::Erased<[u8; 16usize]>>
  23:     0x796dd0573c9f - <rustc_query_impl[bbbbf68942f8fd9d]::query_impl::resolver_for_lowering_raw::dynamic_query::{closure#2} as core[52a599b2714c5040]::ops::function::FnOnce<(rustc_middle[cb63de5e900177d3]::ty::context::TyCtxt, ())>>::call_once
  24:     0x796dd107215d - rustc_query_system[85ec09cc279e17de]::query::plumbing::try_execute_query::<rustc_query_impl[bbbbf68942f8fd9d]::DynamicConfig<rustc_query_system[85ec09cc279e17de]::query::caches::SingleCache<rustc_middle[cb63de5e900177d3]::query::erase::Erased<[u8; 16usize]>>, false, false, false>, rustc_query_impl[bbbbf68942f8fd9d]::plumbing::QueryCtxt, false>
  25:     0x796dd1071df7 - rustc_query_impl[bbbbf68942f8fd9d]::query_impl::resolver_for_lowering_raw::get_query_non_incr::__rust_end_short_backtrace
  26:     0x796dd0f45963 - rustc_interface[539f3934048b9842]::interface::run_compiler::<core[52a599b2714c5040]::result::Result<(), rustc_span[155dece38b7eea75]::ErrorGuaranteed>, rustc_driver_impl[31237189629bb2ae]::run_compiler::{closure#0}>::{closure#1}
  27:     0x796dd0f1be89 - std[ccabb9a6d43d485f]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[539f3934048b9842]::util::run_in_thread_with_globals<rustc_interface[539f3934048b9842]::util::run_in_thread_pool_with_globals<rustc_interface[539f3934048b9842]::interface::run_compiler<core[52a599b2714c5040]::result::Result<(), rustc_span[155dece38b7eea75]::ErrorGuaranteed>, rustc_driver_impl[31237189629bb2ae]::run_compiler::{closure#0}>::{closure#1}, core[52a599b2714c5040]::result::Result<(), rustc_span[155dece38b7eea75]::ErrorGuaranteed>>::{closure#0}, core[52a599b2714c5040]::result::Result<(), rustc_span[155dece38b7eea75]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[52a599b2714c5040]::result::Result<(), rustc_span[155dece38b7eea75]::ErrorGuaranteed>>
  28:     0x796dd0f1bc3a - <<std[ccabb9a6d43d485f]::thread::Builder>::spawn_unchecked_<rustc_interface[539f3934048b9842]::util::run_in_thread_with_globals<rustc_interface[539f3934048b9842]::util::run_in_thread_pool_with_globals<rustc_interface[539f3934048b9842]::interface::run_compiler<core[52a599b2714c5040]::result::Result<(), rustc_span[155dece38b7eea75]::ErrorGuaranteed>, rustc_driver_impl[31237189629bb2ae]::run_compiler::{closure#0}>::{closure#1}, core[52a599b2714c5040]::result::Result<(), rustc_span[155dece38b7eea75]::ErrorGuaranteed>>::{closure#0}, core[52a599b2714c5040]::result::Result<(), rustc_span[155dece38b7eea75]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[52a599b2714c5040]::result::Result<(), rustc_span[155dece38b7eea75]::ErrorGuaranteed>>::{closure#1} as core[52a599b2714c5040]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  29:     0x796dd286420b - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h4c8f9bb98b743875
                               at /rustc/a5ee5cbad1dde83dde61959e9436716094e3408c/library/alloc/src/boxed.rs:2148:9
  30:     0x796dd286420b - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h2598fa8752cf32b5
                               at /rustc/a5ee5cbad1dde83dde61959e9436716094e3408c/library/alloc/src/boxed.rs:2148:9
  31:     0x796dd286420b - std::sys::pal::unix::thread::Thread::new::thread_start::hcc536d54f273dcc2
                               at /rustc/a5ee5cbad1dde83dde61959e9436716094e3408c/library/std/src/sys/pal/unix/thread.rs:105:17
  32:     0x796dd25f7ded - <unknown>
  33:     0x796dd267b0dc - <unknown>
  34:                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.82.0-nightly (a5ee5cbad 2024-07-29) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [resolver_for_lowering_raw] getting the resolver for lowering
end of query stack
error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0658`.

@rustbot label +F-macro_metavar_expr_concat

@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 29, 2024
@rustbot rustbot added needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. F-macro_metavar_expr_concat `#![feature(macro_metavar_expr_concat)]` labels Jul 29, 2024
@matthiaskrgr matthiaskrgr added the S-bug-has-test Status: This bug is tracked inside the repo by a `known-bug` test. label Aug 5, 2024
@saethlin saethlin removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Aug 19, 2024
c410-f3r added a commit to c410-f3r/rust that referenced this issue Oct 10, 2024
jhpratt added a commit to jhpratt/rust that referenced this issue Dec 27, 2024
…kang

[macro_metavar_expr_concat] Fix rust-lang#128346

Fix rust-lang#128346
Fix rust-lang#131393

The syntax is invalid in both issues so I guess that theoretically the compiler should have aborted early.

This PR tries to fix a local problem but let me know if there are better options.

cc `@petrochenkov` if you are interested
bors added a commit to rust-lang-ci/rust that referenced this issue Dec 27, 2024
Rollup of 8 pull requests

Successful merges:

 - rust-lang#131522 ([macro_metavar_expr_concat] Fix rust-lang#128346)
 - rust-lang#134379 (Add `into_array` conversion destructors for `Box`, `Rc`, and `Arc`.)
 - rust-lang#134644 (Document collection `From` and `FromIterator` impls that drop duplicate keys.)
 - rust-lang#134649 (Fix forgetting to save statx availability on success)
 - rust-lang#134728 (Use scoped threads in `std::sync::Barrier` examples)
 - rust-lang#134782 (Update Code Example for `Iterator::rposition`)
 - rust-lang#134789 (unwinding: bump version to fix naked_asm on Xous)
 - rust-lang#134791 (docs: inline `std::ffi::c_str` types to `std::ffi`)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors closed this as completed in b661e98 Dec 27, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Dec 27, 2024
Rollup merge of rust-lang#131522 - c410-f3r:unlock-rfc-2011, r=chenyukang

[macro_metavar_expr_concat] Fix rust-lang#128346

Fix rust-lang#128346
Fix rust-lang#131393

The syntax is invalid in both issues so I guess that theoretically the compiler should have aborted early.

This PR tries to fix a local problem but let me know if there are better options.

cc `@petrochenkov` if you are interested
poliorcetics pushed a commit to poliorcetics/rust that referenced this issue Dec 28, 2024
…kang

[macro_metavar_expr_concat] Fix rust-lang#128346

Fix rust-lang#128346
Fix rust-lang#131393

The syntax is invalid in both issues so I guess that theoretically the compiler should have aborted early.

This PR tries to fix a local problem but let me know if there are better options.

cc `@petrochenkov` if you are interested
poliorcetics pushed a commit to poliorcetics/rust that referenced this issue Dec 28, 2024
Rollup of 8 pull requests

Successful merges:

 - rust-lang#131522 ([macro_metavar_expr_concat] Fix rust-lang#128346)
 - rust-lang#134379 (Add `into_array` conversion destructors for `Box`, `Rc`, and `Arc`.)
 - rust-lang#134644 (Document collection `From` and `FromIterator` impls that drop duplicate keys.)
 - rust-lang#134649 (Fix forgetting to save statx availability on success)
 - rust-lang#134728 (Use scoped threads in `std::sync::Barrier` examples)
 - rust-lang#134782 (Update Code Example for `Iterator::rposition`)
 - rust-lang#134789 (unwinding: bump version to fix naked_asm on Xous)
 - rust-lang#134791 (docs: inline `std::ffi::c_str` types to `std::ffi`)

r? `@ghost`
`@rustbot` modify labels: rollup
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-macro_metavar_expr_concat `#![feature(macro_metavar_expr_concat)]` I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ S-bug-has-test Status: This bug is tracked inside the repo by a `known-bug` test. 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