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: rustc_ast_lowering: no entry found for key #124347

Open
matthiaskrgr opened this issue Apr 24, 2024 · 2 comments
Open

ICE: rustc_ast_lowering: no entry found for key #124347

matthiaskrgr opened this issue Apr 24, 2024 · 2 comments
Labels
C-bug Category: This is a bug. F-fn_delegation `#![feature(fn_delegation)]` I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ S-bug-has-test Status: A `known-bug` test has been added for this bug. 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):

trait Trait: ToReuse {
    reuse Trait::lolno { &self.0 };
}

original:

trait Trait: ToReuse {
    reuse Trait::lolno { &self.0 };
}

struct _Nope;

Version information

rustc 1.79.0-nightly (7bb4f0889 2024-04-24)
binary: rustc
commit-hash: 7bb4f0889e8b133c5b03c46f31f2ae6432c00219
commit-date: 2024-04-24
host: x86_64-unknown-linux-gnu
release: 1.79.0-nightly
LLVM version: 18.1.4

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

Program output

error: non-item in item list
 --> /tmp/icemaker_global_tempdir.lEaHpLdEU8PF/rustc_testrunner_tmpdir_reporting.NIN84Sl6wsUE/mvce.rs:2:35
  |
1 | trait Trait: ToReuse {
  |                      - item list starts here
2 |     reuse Trait::lolno { &self.0 };
  |                                   ^
  |                                   |
  |                                   non-item starts here
  |                                   help: consider removing this semicolon
3 | }
  | - item list ends here

error[E0405]: cannot find trait `ToReuse` in this scope
 --> /tmp/icemaker_global_tempdir.lEaHpLdEU8PF/rustc_testrunner_tmpdir_reporting.NIN84Sl6wsUE/mvce.rs:1:14
  |
1 | trait Trait: ToReuse {
  |              ^^^^^^^ not found in this scope

error[E0658]: functions delegation is not yet fully implemented
 --> /tmp/icemaker_global_tempdir.lEaHpLdEU8PF/rustc_testrunner_tmpdir_reporting.NIN84Sl6wsUE/mvce.rs:2:5
  |
2 |     reuse Trait::lolno { &self.0 };
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: see issue #118212 <https://github.com/rust-lang/rust/issues/118212> for more information
  = help: add `#![feature(fn_delegation)]` to the crate attributes to enable
  = note: this compiler was built on 2024-04-24; consider upgrading it if it is out of date

thread 'rustc' panicked at compiler/rustc_ast_lowering/src/delegation.rs:70:45:
no entry found for key
stack backtrace:
   0:     0x763d86a04145 - std::backtrace_rs::backtrace::libunwind::trace::h86d426b17d4e2e3d
                               at /rustc/7bb4f0889e8b133c5b03c46f31f2ae6432c00219/library/std/src/../../backtrace/src/backtrace/libunwind.rs:105:5
   1:     0x763d86a04145 - std::backtrace_rs::backtrace::trace_unsynchronized::h8c0ef1d148b9d940
                               at /rustc/7bb4f0889e8b133c5b03c46f31f2ae6432c00219/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x763d86a04145 - std::sys_common::backtrace::_print_fmt::he2abce7aa62cdc3a
                               at /rustc/7bb4f0889e8b133c5b03c46f31f2ae6432c00219/library/std/src/sys_common/backtrace.rs:68:5
   3:     0x763d86a04145 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h0c9241533158777f
                               at /rustc/7bb4f0889e8b133c5b03c46f31f2ae6432c00219/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x763d86a5321b - core::fmt::rt::Argument::fmt::h733dbde17a4a7d04
                               at /rustc/7bb4f0889e8b133c5b03c46f31f2ae6432c00219/library/core/src/fmt/rt.rs:165:63
   5:     0x763d86a5321b - core::fmt::write::h03896a7fdcd4b82f
                               at /rustc/7bb4f0889e8b133c5b03c46f31f2ae6432c00219/library/core/src/fmt/mod.rs:1157:21
   6:     0x763d869f8d4f - std::io::Write::write_fmt::hd74e7c0305df2660
                               at /rustc/7bb4f0889e8b133c5b03c46f31f2ae6432c00219/library/std/src/io/mod.rs:1832:15
   7:     0x763d86a03f1e - std::sys_common::backtrace::_print::hea8c9c28ab87b1b7
                               at /rustc/7bb4f0889e8b133c5b03c46f31f2ae6432c00219/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x763d86a03f1e - std::sys_common::backtrace::print::hd4bb5623fa4b8de6
                               at /rustc/7bb4f0889e8b133c5b03c46f31f2ae6432c00219/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x763d86a06889 - std::panicking::default_hook::{{closure}}::h4623b55631f16943
  10:     0x763d86a065cd - std::panicking::default_hook::he5d3fa1d7e671103
                               at /rustc/7bb4f0889e8b133c5b03c46f31f2ae6432c00219/library/std/src/panicking.rs:298:9
  11:     0x763d832456ab - std[73cef507c0358b10]::panicking::update_hook::<alloc[3ec83808c4b91c16]::boxed::Box<rustc_driver_impl[2d410f393cf62b06]::install_ice_hook::{closure#0}>>::{closure#0}
  12:     0x763d86a06f86 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h8ef97572a456b9c7
                               at /rustc/7bb4f0889e8b133c5b03c46f31f2ae6432c00219/library/alloc/src/boxed.rs:2036:9
  13:     0x763d86a06f86 - std::panicking::rust_panic_with_hook::h1e2384e63ce90283
                               at /rustc/7bb4f0889e8b133c5b03c46f31f2ae6432c00219/library/std/src/panicking.rs:799:13
  14:     0x763d86a06d34 - std::panicking::begin_panic_handler::{{closure}}::h8399fde27d16fbcc
                               at /rustc/7bb4f0889e8b133c5b03c46f31f2ae6432c00219/library/std/src/panicking.rs:664:13
  15:     0x763d86a04609 - std::sys_common::backtrace::__rust_end_short_backtrace::hbc2e58d3e2bbc56f
                               at /rustc/7bb4f0889e8b133c5b03c46f31f2ae6432c00219/library/std/src/sys_common/backtrace.rs:171:18
  16:     0x763d86a06a67 - rust_begin_unwind
                               at /rustc/7bb4f0889e8b133c5b03c46f31f2ae6432c00219/library/std/src/panicking.rs:652:5
  17:     0x763d86a4f6e3 - core::panicking::panic_fmt::h1b24b925c3ff40f0
                               at /rustc/7bb4f0889e8b133c5b03c46f31f2ae6432c00219/library/core/src/panicking.rs:72:14
  18:     0x763d86a4f89c - core::panicking::panic_display::h97d6a5a7742fb64d
                               at /rustc/7bb4f0889e8b133c5b03c46f31f2ae6432c00219/library/core/src/panicking.rs:263:5
  19:     0x763d86a4f48c - core::option::expect_failed::ha02463fea35638a7
                               at /rustc/7bb4f0889e8b133c5b03c46f31f2ae6432c00219/library/core/src/option.rs:1994:5
  20:     0x763d82efc8cc - <rustc_ast_lowering[234a1b302e77c7fa]::LoweringContext>::delegation_has_self
  21:     0x763d84d0091d - <rustc_ast_lowering[234a1b302e77c7fa]::LoweringContext>::lower_item_kind
  22:     0x763d84d1045c - <rustc_ast_lowering[234a1b302e77c7fa]::item::ItemLowerer>::lower_node
  23:     0x763d84d0b325 - rustc_ast_lowering[234a1b302e77c7fa]::lower_to_hir
  24:     0x763d853c32a0 - rustc_query_impl[e8a6f5b0469e51af]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[e8a6f5b0469e51af]::query_impl::hir_crate::dynamic_query::{closure#2}::{closure#0}, rustc_middle[65b49a3b5d6c0d49]::query::erase::Erased<[u8; 8usize]>>
  25:     0x763d853c0574 - rustc_query_system[ccb87b148b9f71e3]::query::plumbing::try_execute_query::<rustc_query_impl[e8a6f5b0469e51af]::DynamicConfig<rustc_query_system[ccb87b148b9f71e3]::query::caches::SingleCache<rustc_middle[65b49a3b5d6c0d49]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[e8a6f5b0469e51af]::plumbing::QueryCtxt, false>
  26:     0x763d853c0160 - rustc_query_impl[e8a6f5b0469e51af]::query_impl::hir_crate::get_query_non_incr::__rust_end_short_backtrace
  27:     0x763d84e297e1 - rustc_query_impl[e8a6f5b0469e51af]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[e8a6f5b0469e51af]::query_impl::hir_attrs::dynamic_query::{closure#2}::{closure#0}, rustc_middle[65b49a3b5d6c0d49]::query::erase::Erased<[u8; 8usize]>>
  28:     0x763d84e28d9b - rustc_query_system[ccb87b148b9f71e3]::query::plumbing::try_execute_query::<rustc_query_impl[e8a6f5b0469e51af]::DynamicConfig<rustc_query_system[ccb87b148b9f71e3]::query::caches::VecCache<rustc_hir[9c48b1d67895ee11]::hir_id::OwnerId, rustc_middle[65b49a3b5d6c0d49]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[e8a6f5b0469e51af]::plumbing::QueryCtxt, false>
  29:     0x763d84e28b09 - rustc_query_impl[e8a6f5b0469e51af]::query_impl::hir_attrs::get_query_non_incr::__rust_end_short_backtrace
  30:     0x763d8473611a - <rustc_middle[65b49a3b5d6c0d49]::hir::map::Map>::attrs
  31:     0x763d85533c43 - rustc_passes[ca9bc1310163fd3e]::entry::entry_fn
  32:     0x763d85533bd8 - rustc_query_impl[e8a6f5b0469e51af]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[e8a6f5b0469e51af]::query_impl::entry_fn::dynamic_query::{closure#2}::{closure#0}, rustc_middle[65b49a3b5d6c0d49]::query::erase::Erased<[u8; 12usize]>>
  33:     0x763d85533bb1 - <rustc_query_impl[e8a6f5b0469e51af]::query_impl::entry_fn::dynamic_query::{closure#2} as core[dad89120088e7e02]::ops::function::FnOnce<(rustc_middle[65b49a3b5d6c0d49]::ty::context::TyCtxt, ())>>::call_once
  34:     0x763d855334d2 - rustc_query_system[ccb87b148b9f71e3]::query::plumbing::try_execute_query::<rustc_query_impl[e8a6f5b0469e51af]::DynamicConfig<rustc_query_system[ccb87b148b9f71e3]::query::caches::SingleCache<rustc_middle[65b49a3b5d6c0d49]::query::erase::Erased<[u8; 12usize]>>, false, false, false>, rustc_query_impl[e8a6f5b0469e51af]::plumbing::QueryCtxt, false>
  35:     0x763d85533291 - rustc_query_impl[e8a6f5b0469e51af]::query_impl::entry_fn::get_query_non_incr::__rust_end_short_backtrace
  36:     0x763d849ef232 - rustc_interface[b73225351c325ab5]::passes::analysis
  37:     0x763d849ef055 - rustc_query_impl[e8a6f5b0469e51af]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[e8a6f5b0469e51af]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[65b49a3b5d6c0d49]::query::erase::Erased<[u8; 1usize]>>
  38:     0x763d853be665 - rustc_query_system[ccb87b148b9f71e3]::query::plumbing::try_execute_query::<rustc_query_impl[e8a6f5b0469e51af]::DynamicConfig<rustc_query_system[ccb87b148b9f71e3]::query::caches::SingleCache<rustc_middle[65b49a3b5d6c0d49]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[e8a6f5b0469e51af]::plumbing::QueryCtxt, false>
  39:     0x763d853be3c9 - rustc_query_impl[e8a6f5b0469e51af]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  40:     0x763d85245993 - rustc_interface[b73225351c325ab5]::interface::run_compiler::<core[dad89120088e7e02]::result::Result<(), rustc_span[ec1f1d58828cad2c]::ErrorGuaranteed>, rustc_driver_impl[2d410f393cf62b06]::run_compiler::{closure#0}>::{closure#1}
  41:     0x763d8522f8e7 - std[73cef507c0358b10]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[b73225351c325ab5]::util::run_in_thread_with_globals<rustc_interface[b73225351c325ab5]::util::run_in_thread_pool_with_globals<rustc_interface[b73225351c325ab5]::interface::run_compiler<core[dad89120088e7e02]::result::Result<(), rustc_span[ec1f1d58828cad2c]::ErrorGuaranteed>, rustc_driver_impl[2d410f393cf62b06]::run_compiler::{closure#0}>::{closure#1}, core[dad89120088e7e02]::result::Result<(), rustc_span[ec1f1d58828cad2c]::ErrorGuaranteed>>::{closure#0}, core[dad89120088e7e02]::result::Result<(), rustc_span[ec1f1d58828cad2c]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[dad89120088e7e02]::result::Result<(), rustc_span[ec1f1d58828cad2c]::ErrorGuaranteed>>
  42:     0x763d8522f6aa - <<std[73cef507c0358b10]::thread::Builder>::spawn_unchecked_<rustc_interface[b73225351c325ab5]::util::run_in_thread_with_globals<rustc_interface[b73225351c325ab5]::util::run_in_thread_pool_with_globals<rustc_interface[b73225351c325ab5]::interface::run_compiler<core[dad89120088e7e02]::result::Result<(), rustc_span[ec1f1d58828cad2c]::ErrorGuaranteed>, rustc_driver_impl[2d410f393cf62b06]::run_compiler::{closure#0}>::{closure#1}, core[dad89120088e7e02]::result::Result<(), rustc_span[ec1f1d58828cad2c]::ErrorGuaranteed>>::{closure#0}, core[dad89120088e7e02]::result::Result<(), rustc_span[ec1f1d58828cad2c]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[dad89120088e7e02]::result::Result<(), rustc_span[ec1f1d58828cad2c]::ErrorGuaranteed>>::{closure#2} as core[dad89120088e7e02]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  43:     0x763d86a10e1b - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h3679caeb60ab03c2
                               at /rustc/7bb4f0889e8b133c5b03c46f31f2ae6432c00219/library/alloc/src/boxed.rs:2022:9
  44:     0x763d86a10e1b - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h7e27b57c37e0ef1f
                               at /rustc/7bb4f0889e8b133c5b03c46f31f2ae6432c00219/library/alloc/src/boxed.rs:2022:9
  45:     0x763d86a10e1b - std::sys::pal::unix::thread::Thread::new::thread_start::he8797429d1c20e6e
                               at /rustc/7bb4f0889e8b133c5b03c46f31f2ae6432c00219/library/std/src/sys/pal/unix/thread.rs:108:17
  46:     0x763d867af55a - <unknown>
  47:     0x763d8682ca3c - <unknown>
  48:                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.79.0-nightly (7bb4f0889 2024-04-24) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [hir_crate] getting the crate HIR
#1 [hir_attrs] getting HIR owner attributes in ``
#2 [entry_fn] looking up the entry function of a crate
#3 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 3 previous errors

Some errors have detailed explanations: E0405, E0658.
For more information about an error, try `rustc --explain E0405`.

@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 Apr 24, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Apr 24, 2024
@matthiaskrgr
Copy link
Member Author

#122500

@compiler-errors
Copy link
Member

cc @petrochenkov

@fmease fmease added F-fn_delegation `#![feature(fn_delegation)]` and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Apr 25, 2024
@matthiaskrgr matthiaskrgr added the S-bug-has-test Status: A `known-bug` test has been added for this bug. label Apr 27, 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. F-fn_delegation `#![feature(fn_delegation)]` I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ S-bug-has-test Status: A `known-bug` test has been added for this bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants