Skip to content

ICE: incr: no entry found for key #126516

Closed
@matthiaskrgr

Description

@matthiaskrgr

Code

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

Meta

rustc --version --verbose:

rustc 1.81.0-nightly (8217b412a 2024-06-15)
binary: rustc
commit-hash: 8217b412a235407243f2516ebc859e7b3af8345a
commit-date: 2024-06-15
host: x86_64-unknown-linux-gnu
release: 1.81.0-nightly
LLVM version: 18.1.7

Error output

~/.rustup/toolchains/master/bin/rustc -Cincremental=. a.rs

<output>
Backtrace

error: expected identifier, found keyword `fn`
 --> a.rs:1:33
  |
1 | const fn test() -> impl ~const  fn() {
  |                                 ^^
  |
help: use `Fn` to refer to the trait (notice the capitalization difference)
  |
1 | const fn test() -> impl ~const  Fn() {
  |                                 ~~

thread 'rustc' panicked at compiler/rustc_resolve/src/macros.rs:176:32:
no entry found for key
stack backtrace:
   0:     0x799f24a68ae5 - std::backtrace_rs::backtrace::libunwind::trace::h3ce4b988cf764081
                               at /rustc/8217b412a235407243f2516ebc859e7b3af8345a/library/std/src/../../backtrace/src/backtrace/libunwind.rs:116:5
   1:     0x799f24a68ae5 - std::backtrace_rs::backtrace::trace_unsynchronized::h644386fb9b6d425c
                               at /rustc/8217b412a235407243f2516ebc859e7b3af8345a/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x799f24a68ae5 - std::sys_common::backtrace::_print_fmt::hbcb0591974d9d4b6
                               at /rustc/8217b412a235407243f2516ebc859e7b3af8345a/library/std/src/sys_common/backtrace.rs:68:5
   3:     0x799f24a68ae5 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hfde42e5447c9921d
                               at /rustc/8217b412a235407243f2516ebc859e7b3af8345a/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x799f24ab977b - core::fmt::rt::Argument::fmt::h30fdc3acfe153665
                               at /rustc/8217b412a235407243f2516ebc859e7b3af8345a/library/core/src/fmt/rt.rs:165:63
   5:     0x799f24ab977b - core::fmt::write::h200fae6a9c1c5465
                               at /rustc/8217b412a235407243f2516ebc859e7b3af8345a/library/core/src/fmt/mod.rs:1168:21
   6:     0x799f24a5d6bf - std::io::Write::write_fmt::h5fdb7a30131da972
                               at /rustc/8217b412a235407243f2516ebc859e7b3af8345a/library/std/src/io/mod.rs:1835:15
   7:     0x799f24a688be - std::sys_common::backtrace::_print::hf65f993d1acacdf9
                               at /rustc/8217b412a235407243f2516ebc859e7b3af8345a/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x799f24a688be - std::sys_common::backtrace::print::h9357a66f85cf385d
                               at /rustc/8217b412a235407243f2516ebc859e7b3af8345a/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x799f24a6b2f9 - std::panicking::default_hook::{{closure}}::h0e9d547e65bc525c
  10:     0x799f24a6b09c - std::panicking::default_hook::h91e630649f44b46d
                               at /rustc/8217b412a235407243f2516ebc859e7b3af8345a/library/std/src/panicking.rs:292:9
  11:     0x799f212bc9c0 - std[dcc9197a679e7515]::panicking::update_hook::<alloc[32d4cfa2fa7835b6]::boxed::Box<rustc_driver_impl[5ac992c1e906279b]::install_ice_hook::{closure#0}>>::{closure#0}
  12:     0x799f24a6bbff - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::hbbd2e22c8b3436c1
                               at /rustc/8217b412a235407243f2516ebc859e7b3af8345a/library/alloc/src/boxed.rs:2076:9
  13:     0x799f24a6bbff - std::panicking::rust_panic_with_hook::h6087348979401d1f
                               at /rustc/8217b412a235407243f2516ebc859e7b3af8345a/library/std/src/panicking.rs:801:13
  14:     0x799f24a6b827 - std::panicking::begin_panic_handler::{{closure}}::h60e075871035f1b2
                               at /rustc/8217b412a235407243f2516ebc859e7b3af8345a/library/std/src/panicking.rs:667:13
  15:     0x799f24a68fa9 - std::sys_common::backtrace::__rust_end_short_backtrace::h2d7ea7abc5510281
                               at /rustc/8217b412a235407243f2516ebc859e7b3af8345a/library/std/src/sys_common/backtrace.rs:171:18
  16:     0x799f24a6b4d4 - rust_begin_unwind
                               at /rustc/8217b412a235407243f2516ebc859e7b3af8345a/library/std/src/panicking.rs:658:5
  17:     0x799f24ab5d33 - core::panicking::panic_fmt::h5c2727eb7e98b498
                               at /rustc/8217b412a235407243f2516ebc859e7b3af8345a/library/core/src/panicking.rs:74:14
  18:     0x799f24ab5b8b - core::panicking::panic_display::h94a8eb28f58fd986
                               at /rustc/8217b412a235407243f2516ebc859e7b3af8345a/library/core/src/panicking.rs:264:5
  19:     0x799f24ab5b8b - core::option::expect_failed::h96edad4082807c8e
                               at /rustc/8217b412a235407243f2516ebc859e7b3af8345a/library/core/src/option.rs:2021:5
  20:     0x799f22baa2ef - <rustc_expand[54dc30a574a50031]::expand::MacroExpander>::collect_invocations
  21:     0x799f1eff7e4d - <rustc_expand[54dc30a574a50031]::expand::MacroExpander>::fully_expand_fragment
  22:     0x799f23382de0 - <rustc_expand[54dc30a574a50031]::expand::MacroExpander>::expand_crate
  23:     0x799f22b7eef4 - rustc_interface[31624f1d80ab4fc4]::passes::resolver_for_lowering_raw
  24:     0x799f22b7e4af - rustc_query_impl[84344bc95dc11429]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[84344bc95dc11429]::query_impl::resolver_for_lowering_raw::dynamic_query::{closure#2}::{closure#0}, rustc_middle[6499c3638713b479]::query::erase::Erased<[u8; 16usize]>>
  25:     0x799f22b7e49d - <rustc_query_impl[84344bc95dc11429]::query_impl::resolver_for_lowering_raw::dynamic_query::{closure#2} as core[19fe13b6211de354]::ops::function::FnOnce<(rustc_middle[6499c3638713b479]::ty::context::TyCtxt, ())>>::call_once
  26:     0x799f23691940 - rustc_query_system[3ac0490446cce27]::query::plumbing::try_execute_query::<rustc_query_impl[84344bc95dc11429]::DynamicConfig<rustc_query_system[3ac0490446cce27]::query::caches::SingleCache<rustc_middle[6499c3638713b479]::query::erase::Erased<[u8; 16usize]>>, false, false, false>, rustc_query_impl[84344bc95dc11429]::plumbing::QueryCtxt, true>
  27:     0x799f236913ca - rustc_query_impl[84344bc95dc11429]::query_impl::resolver_for_lowering_raw::get_query_incr::__rust_end_short_backtrace
  28:     0x799f23287ac2 - rustc_interface[31624f1d80ab4fc4]::interface::run_compiler::<core[19fe13b6211de354]::result::Result<(), rustc_span[acf1ed94241100d5]::ErrorGuaranteed>, rustc_driver_impl[5ac992c1e906279b]::run_compiler::{closure#0}>::{closure#1}
  29:     0x799f232a6749 - std[dcc9197a679e7515]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[31624f1d80ab4fc4]::util::run_in_thread_with_globals<rustc_interface[31624f1d80ab4fc4]::util::run_in_thread_pool_with_globals<rustc_interface[31624f1d80ab4fc4]::interface::run_compiler<core[19fe13b6211de354]::result::Result<(), rustc_span[acf1ed94241100d5]::ErrorGuaranteed>, rustc_driver_impl[5ac992c1e906279b]::run_compiler::{closure#0}>::{closure#1}, core[19fe13b6211de354]::result::Result<(), rustc_span[acf1ed94241100d5]::ErrorGuaranteed>>::{closure#0}, core[19fe13b6211de354]::result::Result<(), rustc_span[acf1ed94241100d5]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[19fe13b6211de354]::result::Result<(), rustc_span[acf1ed94241100d5]::ErrorGuaranteed>>
  30:     0x799f232a64fa - <<std[dcc9197a679e7515]::thread::Builder>::spawn_unchecked_<rustc_interface[31624f1d80ab4fc4]::util::run_in_thread_with_globals<rustc_interface[31624f1d80ab4fc4]::util::run_in_thread_pool_with_globals<rustc_interface[31624f1d80ab4fc4]::interface::run_compiler<core[19fe13b6211de354]::result::Result<(), rustc_span[acf1ed94241100d5]::ErrorGuaranteed>, rustc_driver_impl[5ac992c1e906279b]::run_compiler::{closure#0}>::{closure#1}, core[19fe13b6211de354]::result::Result<(), rustc_span[acf1ed94241100d5]::ErrorGuaranteed>>::{closure#0}, core[19fe13b6211de354]::result::Result<(), rustc_span[acf1ed94241100d5]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[19fe13b6211de354]::result::Result<(), rustc_span[acf1ed94241100d5]::ErrorGuaranteed>>::{closure#2} as core[19fe13b6211de354]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  31:     0x799f24a75a7b - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h63d7e4867a6f7a50
                               at /rustc/8217b412a235407243f2516ebc859e7b3af8345a/library/alloc/src/boxed.rs:2062:9
  32:     0x799f24a75a7b - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hc69a2b2417343e31
                               at /rustc/8217b412a235407243f2516ebc859e7b3af8345a/library/alloc/src/boxed.rs:2062:9
  33:     0x799f24a75a7b - std::sys::pal::unix::thread::Thread::new::thread_start::h3b699498c0d63166
                               at /rustc/8217b412a235407243f2516ebc859e7b3af8345a/library/std/src/sys/pal/unix/thread.rs:108:17
  34:     0x799f1dea6ded - <unknown>
  35:     0x799f1df2a0dc - <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 `/tmp/im/2/rustc-ice-2024-06-15T10_44_28-2450574.txt` to your bug report

note: compiler flags: -C incremental=[REDACTED]

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-incr-compArea: Incremental compilationA-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)C-bugCategory: This is a bug.F-effects`#![feature(effects)]`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