rust-lang / rust

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

ICE: incr: `no entry found for key` #126516

Closed matthiaskrgr closed 3 months ago

matthiaskrgr commented 3 months ago

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 - ::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::>::{closure#0} 12: 0x799f24a6bbff - as core::ops::function::Fn>::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 - ::collect_invocations 21: 0x799f1eff7e4d - ::fully_expand_fragment 22: 0x799f23382de0 - ::expand_crate 23: 0x799f22b7eef4 - rustc_interface[31624f1d80ab4fc4]::passes::resolver_for_lowering_raw 24: 0x799f22b7e4af - rustc_query_impl[84344bc95dc11429]::plumbing::__rust_begin_short_backtrace::> 25: 0x799f22b7e49d - >::call_once 26: 0x799f23691940 - rustc_query_system[3ac0490446cce27]::query::plumbing::try_execute_query::>, 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::, rustc_driver_impl[5ac992c1e906279b]::run_compiler::{closure#0}>::{closure#1} 29: 0x799f232a6749 - std[dcc9197a679e7515]::sys_common::backtrace::__rust_begin_short_backtrace::, 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 - <::spawn_unchecked_, 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 - as core::ops::function::FnOnce>::call_once::h63d7e4867a6f7a50 at /rustc/8217b412a235407243f2516ebc859e7b3af8345a/library/alloc/src/boxed.rs:2062:9 32: 0x799f24a75a7b - as core::ops::function::FnOnce>::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 - 35: 0x799f1df2a0dc - 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 `/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 ```

matthiaskrgr commented 3 months ago

bisects to https://github.com/rust-lang/rust/pull/125918 cc @oli-obk

oli-obk commented 3 months ago

That's a revert, the issue probably exists much longer

matthiaskrgr commented 3 months ago

ah :+1: when I start the bisection at a later point, this goes down to Regression in nightly-2023-11-29

  commit[0] 2023-11-27: Auto merge of #117947 - Dirbaio:drop-llvm-15, r=cuviper
  commit[1] 2023-11-28: Auto merge of #118395 - compiler-errors:rollup-c8yqlmw, r=compiler-errors
  commit[2] 2023-11-28: Auto merge of #118282 - fee1-dead-contrib:enforce-more, r=compiler-errors
  commit[3] 2023-11-28: Auto merge of #118405 - matthiaskrgr:rollup-3a2eevc, r=matthiaskrgr
  commit[4] 2023-11-28: Auto merge of #110353 - the8472:in-place-flatten-chunks, r=cuviper
  commit[5] 2023-11-28: Auto merge of #118188 - petrochenkov:defeed, r=cjgillot

probably #118282 ?

oli-obk commented 3 months ago

Jup, that looks like it