rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
97.78k stars 12.65k forks source link

ICE: `expanded a dummy bang macro` #126647

Closed matthiaskrgr closed 3 months ago

matthiaskrgr commented 4 months ago

Code

const fn test() -> impl FnMut(usize) -> u32 {
    const { #![path = foo!()] }
}

Meta

rustc --version --verbose:

rustc 1.81.0-nightly (59e2c01c2 2024-06-17)
binary: rustc
commit-hash: 59e2c01c2217a01546222e4d9ff4e6695ee8a1db
commit-date: 2024-06-17
host: x86_64-unknown-linux-gnu
release: 1.81.0-nightly
LLVM version: 18.1.7

Error output

<output>
Backtrace

``` thread 'rustc' panicked at compiler/rustc_resolve/src/def_collector.rs:18:71: no entry found for key stack backtrace: 0: 0x74610d211935 - std::backtrace_rs::backtrace::libunwind::trace::h184e33fa7a4efbe9 at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library/std/src/../../backtrace/src/backtrace/libunwind.rs:116:5 1: 0x74610d211935 - std::backtrace_rs::backtrace::trace_unsynchronized::h4dca295048001c05 at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5 2: 0x74610d211935 - std::sys::backtrace::_print_fmt::h622e99f1f7a98eb9 at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library/std/src/sys/backtrace.rs:68:5 3: 0x74610d211935 - ::fmt::h28f531d3888c6232 at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library/std/src/sys/backtrace.rs:44:22 4: 0x74610d2624bb - core::fmt::rt::Argument::fmt::h253c327f844a6420 at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library/core/src/fmt/rt.rs:165:63 5: 0x74610d2624bb - core::fmt::write::h2fb7595745e09759 at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library/core/src/fmt/mod.rs:1168:21 6: 0x74610d20651f - std::io::Write::write_fmt::h552e7a88d935daf5 at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library/std/src/io/mod.rs:1835:15 7: 0x74610d21170e - std::sys::backtrace::_print::h249fbba2cfb2db75 at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library/std/src/sys/backtrace.rs:47:5 8: 0x74610d21170e - std::sys::backtrace::print::hd0736ee82821eb5a at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library/std/src/sys/backtrace.rs:34:9 9: 0x74610d214149 - std::panicking::default_hook::{{closure}}::h00c814c943d2d674 10: 0x74610d213eec - std::panicking::default_hook::h551f46be220f17f1 at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library/std/src/panicking.rs:292:9 11: 0x746109ac6a6f - std[c3fbaf9a0386b13c]::panicking::update_hook::>::{closure#0} 12: 0x74610d214a4f - as core::ops::function::Fn>::call::ha3b0d962ec1ff02b at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library/alloc/src/boxed.rs:2076:9 13: 0x74610d214a4f - std::panicking::rust_panic_with_hook::h0adf1873cdd8ce86 at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library/std/src/panicking.rs:801:13 14: 0x74610d214677 - std::panicking::begin_panic_handler::{{closure}}::h14e7b85ca1885ac4 at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library/std/src/panicking.rs:667:13 15: 0x74610d211df9 - std::sys::backtrace::__rust_end_short_backtrace::h17e9af05fae71c34 at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library/std/src/sys/backtrace.rs:171:18 16: 0x74610d214324 - rust_begin_unwind at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library/std/src/panicking.rs:658:5 17: 0x74610d25ea73 - core::panicking::panic_fmt::h273dffa90a45a379 at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library/core/src/panicking.rs:74:14 18: 0x74610d25e8cb - core::panicking::panic_display::h4c64ba18b3569eba at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library/core/src/panicking.rs:264:5 19: 0x74610d25e8cb - core::option::expect_failed::h4bc01f21b61f5a56 at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library/core/src/option.rs:2021:5 20: 0x74610c4fdc80 - ::visit_ast_fragment_with_placeholders.cold 21: 0x7461078113c2 - ::fully_expand_fragment 22: 0x74610bbe4118 - ::expand_crate 23: 0x74610b31e98a - rustc_interface[ad92266d8770ef5]::passes::resolver_for_lowering_raw 24: 0x74610b31df4d - rustc_query_impl[250cb7a150488de5]::plumbing::__rust_begin_short_backtrace::> 25: 0x74610b31df2d - >::call_once 26: 0x74610bc46991 - rustc_query_system[7ef52ba0f7b4d7c0]::query::plumbing::try_execute_query::>, false, false, false>, rustc_query_impl[250cb7a150488de5]::plumbing::QueryCtxt, false> 27: 0x74610bc4662d - rustc_query_impl[250cb7a150488de5]::query_impl::resolver_for_lowering_raw::get_query_non_incr::__rust_end_short_backtrace 28: 0x74610bad0ec2 - rustc_interface[ad92266d8770ef5]::interface::run_compiler::, rustc_driver_impl[ee4d79150a07c4f8]::run_compiler::{closure#0}>::{closure#1} 29: 0x74610bab2b09 - std[c3fbaf9a0386b13c]::sys::backtrace::__rust_begin_short_backtrace::, rustc_driver_impl[ee4d79150a07c4f8]::run_compiler::{closure#0}>::{closure#1}, core[2498b3506ce20dac]::result::Result<(), rustc_span[72d27a3883823780]::ErrorGuaranteed>>::{closure#0}, core[2498b3506ce20dac]::result::Result<(), rustc_span[72d27a3883823780]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[2498b3506ce20dac]::result::Result<(), rustc_span[72d27a3883823780]::ErrorGuaranteed>> 30: 0x74610bab28ba - <::spawn_unchecked_, rustc_driver_impl[ee4d79150a07c4f8]::run_compiler::{closure#0}>::{closure#1}, core[2498b3506ce20dac]::result::Result<(), rustc_span[72d27a3883823780]::ErrorGuaranteed>>::{closure#0}, core[2498b3506ce20dac]::result::Result<(), rustc_span[72d27a3883823780]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[2498b3506ce20dac]::result::Result<(), rustc_span[72d27a3883823780]::ErrorGuaranteed>>::{closure#2} as core[2498b3506ce20dac]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0} 31: 0x74610d21e8cb - as core::ops::function::FnOnce>::call_once::h415b3c48feec9148 at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library/alloc/src/boxed.rs:2062:9 32: 0x74610d21e8cb - as core::ops::function::FnOnce>::call_once::h0d4446e047e96116 at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library/alloc/src/boxed.rs:2062:9 33: 0x74610d21e8cb - std::sys::pal::unix::thread::Thread::new::thread_start::h01071f1a69504322 at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library/std/src/sys/pal/unix/thread.rs:108:17 34: 0x7461066a6ded - 35: 0x74610672a0dc - 36: 0x0 - 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 `/home/matthias/vcs/github/glacier2/ices/rustc-ice-2024-06-18T21_35_30-1920013.txt` to your bug report query stack during panic: #0 [resolver_for_lowering_raw] getting the resolver for lowering end of query stack note: no errors encountered even though delayed bugs were created note: those delayed bugs will now be shown as internal compiler errors error: internal compiler error: expanded a dummy bang macro --> /home/matthias/vcs/github/glacier2/ices/icemaker_omni_4/5B40B247F34301387AD2586EA8590F8C51E3821EC45818650747CF79194450B9.rs:3:23 | 3 | const { #![path = foo!()] } | ^^^^^^ | note: delayed at compiler/rustc_expand/src/base.rs:902:26 - disabled backtrace --> /home/matthias/vcs/github/glacier2/ices/icemaker_omni_4/5B40B247F34301387AD2586EA8590F8C51E3821EC45818650747CF79194450B9.rs:3:23 | 3 | const { #![path = foo!()] } | ^^^^^^ 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 `/home/matthias/vcs/github/glacier2/ices/rustc-ice-2024-06-18T21_35_30-1920013.txt` to your bug report query stack during panic: end of query stack thread 'rustc' panicked at library/core/src/panicking.rs:229:5: panic in a destructor during cleanup 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 `/home/matthias/vcs/github/glacier2/ices/rustc-ice-2024-06-18T21_35_30-1920013.txt` to your bug report query stack during panic: end of query stack thread caused non-unwinding panic. aborting. [1] 1920013 IOT instruction rustc ```

GrigorenkoPV commented 4 months ago

Regression in nightly-2023-11-29 (49b3924bd4a34d3cf9c37b74120fba78d9712ab8...5facb422f8a5a61df515572fe79b02433639d565)