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: expanded a dummy bang macro #126647

Closed
matthiaskrgr opened this issue Jun 18, 2024 · 1 comment · Fixed by #126735
Closed

ICE: expanded a dummy bang macro #126647

matthiaskrgr opened this issue Jun 18, 2024 · 1 comment · Fixed by #126735
Labels
C-bug Category: This is a bug. 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.

Comments

@matthiaskrgr
Copy link
Member

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 - <std::sys::backtrace::_print::DisplayBacktrace as core::fmt::Display>::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::<alloc[3df32a5d58f536a7]::boxed::Box<rustc_driver_impl[ee4d79150a07c4f8]::install_ice_hook::{closure#0}>>::{closure#0}
  12:     0x74610d214a4f - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::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 - <rustc_resolve[ca53971e3488965f]::Resolver as rustc_expand[8d24b62af0bc097]::base::ResolverExpand>::visit_ast_fragment_with_placeholders.cold
  21:     0x7461078113c2 - <rustc_expand[8d24b62af0bc097]::expand::MacroExpander>::fully_expand_fragment
  22:     0x74610bbe4118 - <rustc_expand[8d24b62af0bc097]::expand::MacroExpander>::expand_crate
  23:     0x74610b31e98a - rustc_interface[ad92266d8770ef5]::passes::resolver_for_lowering_raw
  24:     0x74610b31df4d - rustc_query_impl[250cb7a150488de5]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[250cb7a150488de5]::query_impl::resolver_for_lowering_raw::dynamic_query::{closure#2}::{closure#0}, rustc_middle[516cb2fde7e58e9c]::query::erase::Erased<[u8; 16usize]>>
  25:     0x74610b31df2d - <rustc_query_impl[250cb7a150488de5]::query_impl::resolver_for_lowering_raw::dynamic_query::{closure#2} as core[2498b3506ce20dac]::ops::function::FnOnce<(rustc_middle[516cb2fde7e58e9c]::ty::context::TyCtxt, ())>>::call_once
  26:     0x74610bc46991 - rustc_query_system[7ef52ba0f7b4d7c0]::query::plumbing::try_execute_query::<rustc_query_impl[250cb7a150488de5]::DynamicConfig<rustc_query_system[7ef52ba0f7b4d7c0]::query::caches::SingleCache<rustc_middle[516cb2fde7e58e9c]::query::erase::Erased<[u8; 16usize]>>, 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::<core[2498b3506ce20dac]::result::Result<(), rustc_span[72d27a3883823780]::ErrorGuaranteed>, rustc_driver_impl[ee4d79150a07c4f8]::run_compiler::{closure#0}>::{closure#1}
  29:     0x74610bab2b09 - std[c3fbaf9a0386b13c]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[ad92266d8770ef5]::util::run_in_thread_with_globals<rustc_interface[ad92266d8770ef5]::util::run_in_thread_pool_with_globals<rustc_interface[ad92266d8770ef5]::interface::run_compiler<core[2498b3506ce20dac]::result::Result<(), rustc_span[72d27a3883823780]::ErrorGuaranteed>, 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 - <<std[c3fbaf9a0386b13c]::thread::Builder>::spawn_unchecked_<rustc_interface[ad92266d8770ef5]::util::run_in_thread_with_globals<rustc_interface[ad92266d8770ef5]::util::run_in_thread_pool_with_globals<rustc_interface[ad92266d8770ef5]::interface::run_compiler<core[2498b3506ce20dac]::result::Result<(), rustc_span[72d27a3883823780]::ErrorGuaranteed>, 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 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h415b3c48feec9148
                               at /rustc/59e2c01c2217a01546222e4d9ff4e6695ee8a1db/library/alloc/src/boxed.rs:2062:9
  32:     0x74610d21e8cb - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::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 - <unknown>
  35:     0x74610672a0dc - <unknown>
  36:                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: 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

@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 18, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jun 18, 2024
@GrigorenkoPV
Copy link
Contributor

Regression in nightly-2023-11-29 (49b3924...5facb42)

@bors bors closed this as completed in 2fa148e Jun 20, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Jun 20, 2024
Rollup merge of rust-lang#126735 - bvanjoi:fix-126647, r=petrochenkov

collect attrs in const block expr

Fixes rust-lang#126516
Fixes rust-lang#126647

It was forgotten to collect these attributes in the const block expression.

r? `@petrochenkov`
@saethlin saethlin removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jun 20, 2024
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. 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.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants