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: item_name: no name for DefPath #116031

Closed
matthiaskrgr opened this issue Sep 21, 2023 · 1 comment · Fixed by #116039
Closed

ICE: item_name: no name for DefPath #116031

matthiaskrgr opened this issue Sep 21, 2023 · 1 comment · Fixed by #116039
Labels
C-bug Category: This is a bug. F-type_alias_impl_trait `#[feature(type_alias_impl_trait)]` 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

#![feature(type_alias_impl_trait)]

pub type Tait = impl Iterator<Item = (&'db Key, impl Iterator)>;

pub fn main() {}

Meta

rustc --version --verbose:

rustc 1.74.0-nightly (3223b0b5e 2023-09-20)
binary: rustc
commit-hash: 3223b0b5e8dadda3f76c3fd1a8d6c5addc09599e
commit-date: 2023-09-20
host: x86_64-unknown-linux-gnu
release: 1.74.0-nightly
LLVM version: 17.0.0

Error output

 --> 76763E5DC6AE6ABA23B770362FAE63C109414F5F9F4688E091EC3407A9B9CB1E.rs:3:40
  |
3 | pub type Tait = impl Iterator<Item = (&'db Key, impl Iterator)>;
  |                                        ^^^ undeclared lifetime
  |
  = note: for more information on higher-ranked polymorphism, visit https://doc.rust-lang.org/nomicon/hrtb.html
help: consider making the bound lifetime-generic with a new `'db` lifetime
  |
3 | pub type Tait = impl for<'db> Iterator<Item = (&'db Key, impl Iterator)>;
  |                      ++++++++
help: consider introducing lifetime `'db` here
  |
3 | pub type Tait<'db> = impl Iterator<Item = (&'db Key, impl Iterator)>;
  |              +++++

error[E0412]: cannot find type `Key` in this scope
 --> 76763E5DC6AE6ABA23B770362FAE63C109414F5F9F4688E091EC3407A9B9CB1E.rs:3:44
  |
3 | pub type Tait = impl Iterator<Item = (&'db Key, impl Iterator)>;
  |                                            ^^^ not found in this scope
  |
help: consider importing this struct
  |
3 + use std::thread::local_impl::Key;
  |

error: unconstrained opaque type
 --> 76763E5DC6AE6ABA23B770362FAE63C109414F5F9F4688E091EC3407A9B9CB1E.rs:3:17
  |
3 | pub type Tait = impl Iterator<Item = (&'db Key, impl Iterator)>;
  |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: `Tait` must be used in combination with a concrete type within the same module
Backtrace


thread 'rustc' panicked at /rustc/bdb0fa3ee5ffb4cc1a1b53cbe8344a2b83b1ae2a/compiler/rustc_errors/src/lib.rs:1651:9:
Box<dyn Any>
stack backtrace:
   0:     0x7f459af6402c - std::backtrace_rs::backtrace::libunwind::trace::h29c8374995c7d415
                               at /rustc/bdb0fa3ee5ffb4cc1a1b53cbe8344a2b83b1ae2a/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f459af6402c - std::backtrace_rs::backtrace::trace_unsynchronized::h16cdf57e7d1bb070
                               at /rustc/bdb0fa3ee5ffb4cc1a1b53cbe8344a2b83b1ae2a/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f459af6402c - std::sys_common::backtrace::_print_fmt::hbfb4f22585dcb2fd
                               at /rustc/bdb0fa3ee5ffb4cc1a1b53cbe8344a2b83b1ae2a/library/std/src/sys_common/backtrace.rs:67:5
   3:     0x7f459af6402c - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hb0e43dc4856f6e03
                               at /rustc/bdb0fa3ee5ffb4cc1a1b53cbe8344a2b83b1ae2a/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f459afc9e1c - core::fmt::rt::Argument::fmt::h82e137948f0d7ee4
                               at /rustc/bdb0fa3ee5ffb4cc1a1b53cbe8344a2b83b1ae2a/library/core/src/fmt/rt.rs:138:9
   5:     0x7f459afc9e1c - core::fmt::write::h8b9ac4f4c7374e69
                               at /rustc/bdb0fa3ee5ffb4cc1a1b53cbe8344a2b83b1ae2a/library/core/src/fmt/mod.rs:1114:21
   6:     0x7f459af56dae - std::io::Write::write_fmt::h9ce93f75df8e70bc
                               at /rustc/bdb0fa3ee5ffb4cc1a1b53cbe8344a2b83b1ae2a/library/std/src/io/mod.rs:1714:15
   7:     0x7f459af63e14 - std::sys_common::backtrace::_print::h954477bb2c14503b
                               at /rustc/bdb0fa3ee5ffb4cc1a1b53cbe8344a2b83b1ae2a/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7f459af63e14 - std::sys_common::backtrace::print::h38fd536905d677e7
                               at /rustc/bdb0fa3ee5ffb4cc1a1b53cbe8344a2b83b1ae2a/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7f459af66d33 - std::panicking::default_hook::{{closure}}::h0d512547687cad13
                               at /rustc/bdb0fa3ee5ffb4cc1a1b53cbe8344a2b83b1ae2a/library/std/src/panicking.rs:272:22
  10:     0x7f459af66a54 - std::panicking::default_hook::h3c758d5c634aa6e1
                               at /rustc/bdb0fa3ee5ffb4cc1a1b53cbe8344a2b83b1ae2a/library/std/src/panicking.rs:292:9
  11:     0x7f459e141d6f - std[423b84e37edbea9d]::panicking::update_hook::<alloc[4c1b9f1e7fd4ece9]::boxed::Box<rustc_driver_impl[5065b449a99b292a]::install_ice_hook::{closure#0}>>::{closure#0}
  12:     0x7f459af67561 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::hc1529ee1ff5c0ed4
                               at /rustc/bdb0fa3ee5ffb4cc1a1b53cbe8344a2b83b1ae2a/library/alloc/src/boxed.rs:2021:9
  13:     0x7f459af67561 - std::panicking::rust_panic_with_hook::ha8fa8090a7e1cf35
                               at /rustc/bdb0fa3ee5ffb4cc1a1b53cbe8344a2b83b1ae2a/library/std/src/panicking.rs:735:13
  14:     0x7f459e72c824 - std[423b84e37edbea9d]::panicking::begin_panic::<rustc_errors[753e7a578930e2a3]::ExplicitBug>::{closure#0}
  15:     0x7f459e727906 - std[423b84e37edbea9d]::sys_common::backtrace::__rust_end_short_backtrace::<std[423b84e37edbea9d]::panicking::begin_panic<rustc_errors[753e7a578930e2a3]::ExplicitBug>::{closure#0}, !>
  16:     0x7f459e638ea6 - std[423b84e37edbea9d]::panicking::begin_panic::<rustc_errors[753e7a578930e2a3]::ExplicitBug>
  17:     0x7f459e68bc44 - <rustc_errors[753e7a578930e2a3]::HandlerInner>::bug::<alloc[4c1b9f1e7fd4ece9]::string::String>
  18:     0x7f459e68bb06 - <rustc_errors[753e7a578930e2a3]::Handler>::bug::<alloc[4c1b9f1e7fd4ece9]::string::String>
  19:     0x7f459e64a024 - rustc_middle[7532cecbef1af146]::util::bug::opt_span_bug_fmt::<rustc_span[52113c30dfc0425a]::span_encoding::Span>::{closure#0}
  20:     0x7f459e64945a - rustc_middle[7532cecbef1af146]::ty::context::tls::with_opt::<rustc_middle[7532cecbef1af146]::util::bug::opt_span_bug_fmt<rustc_span[52113c30dfc0425a]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  21:     0x7f459e649428 - rustc_middle[7532cecbef1af146]::ty::context::tls::with_context_opt::<rustc_middle[7532cecbef1af146]::ty::context::tls::with_opt<rustc_middle[7532cecbef1af146]::util::bug::opt_span_bug_fmt<rustc_span[52113c30dfc0425a]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  22:     0x7f459c7cb9a0 - rustc_middle[7532cecbef1af146]::util::bug::bug_fmt
  23:     0x7f459c65c3b6 - <rustc_middle[7532cecbef1af146]::ty::context::TyCtxt>::item_name
  24:     0x7f459e244c09 - rustc_hir_analysis[417a0e0ce74bdc30]::collect::type_of::opaque::find_opaque_ty_constraints_for_tait
  25:     0x7f459d775e11 - rustc_query_impl[4050e2da7ab96027]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[4050e2da7ab96027]::query_impl::type_of_opaque::dynamic_query::{closure#2}::{closure#0}, rustc_middle[7532cecbef1af146]::query::erase::Erased<[u8; 8usize]>>
  26:     0x7f459d775df1 - <rustc_query_impl[4050e2da7ab96027]::query_impl::type_of_opaque::dynamic_query::{closure#2} as core[4ff1a1b12c81ae0a]::ops::function::FnOnce<(rustc_middle[7532cecbef1af146]::ty::context::TyCtxt, rustc_span[52113c30dfc0425a]::def_id::DefId)>>::call_once
  27:     0x7f459c2573f0 - rustc_query_system[f4eb094e69159de6]::query::plumbing::try_execute_query::<rustc_query_impl[4050e2da7ab96027]::DynamicConfig<rustc_query_system[f4eb094e69159de6]::query::caches::DefaultCache<rustc_span[52113c30dfc0425a]::def_id::DefId, rustc_middle[7532cecbef1af146]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[4050e2da7ab96027]::plumbing::QueryCtxt, false>
  28:     0x7f459da9fce2 - rustc_query_impl[4050e2da7ab96027]::query_impl::type_of_opaque::get_query_non_incr::__rust_end_short_backtrace
  29:     0x7f459cbd0a7f - rustc_hir_analysis[417a0e0ce74bdc30]::collect::type_of::type_of
  30:     0x7f459c54079c - rustc_query_impl[4050e2da7ab96027]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[4050e2da7ab96027]::query_impl::type_of::dynamic_query::{closure#2}::{closure#0}, rustc_middle[7532cecbef1af146]::query::erase::Erased<[u8; 8usize]>>
  31:     0x7f459c540760 - <rustc_query_impl[4050e2da7ab96027]::query_impl::type_of::dynamic_query::{closure#2} as core[4ff1a1b12c81ae0a]::ops::function::FnOnce<(rustc_middle[7532cecbef1af146]::ty::context::TyCtxt, rustc_span[52113c30dfc0425a]::def_id::DefId)>>::call_once
  32:     0x7f459c2573f0 - rustc_query_system[f4eb094e69159de6]::query::plumbing::try_execute_query::<rustc_query_impl[4050e2da7ab96027]::DynamicConfig<rustc_query_system[f4eb094e69159de6]::query::caches::DefaultCache<rustc_span[52113c30dfc0425a]::def_id::DefId, rustc_middle[7532cecbef1af146]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[4050e2da7ab96027]::plumbing::QueryCtxt, false>
  33:     0x7f459da9f941 - rustc_query_impl[4050e2da7ab96027]::query_impl::type_of::get_query_non_incr::__rust_end_short_backtrace
  34:     0x7f459d113200 - rustc_middle[7532cecbef1af146]::query::plumbing::query_get_at::<rustc_query_system[f4eb094e69159de6]::query::caches::DefaultCache<rustc_span[52113c30dfc0425a]::def_id::DefId, rustc_middle[7532cecbef1af146]::query::erase::Erased<[u8; 8usize]>>>
  35:     0x7f459d10d21a - rustc_hir_analysis[417a0e0ce74bdc30]::check::check::check_mod_item_types
  36:     0x7f459cf3a46c - rustc_query_impl[4050e2da7ab96027]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[4050e2da7ab96027]::query_impl::check_mod_item_types::dynamic_query::{closure#2}::{closure#0}, rustc_middle[7532cecbef1af146]::query::erase::Erased<[u8; 0usize]>>
  37:     0x7f459cf3a44e - <rustc_query_impl[4050e2da7ab96027]::query_impl::check_mod_item_types::dynamic_query::{closure#2} as core[4ff1a1b12c81ae0a]::ops::function::FnOnce<(rustc_middle[7532cecbef1af146]::ty::context::TyCtxt, rustc_span[52113c30dfc0425a]::def_id::LocalModDefId)>>::call_once
  38:     0x7f459d141058 - rustc_query_system[f4eb094e69159de6]::query::plumbing::try_execute_query::<rustc_query_impl[4050e2da7ab96027]::DynamicConfig<rustc_query_system[f4eb094e69159de6]::query::caches::DefaultCache<rustc_span[52113c30dfc0425a]::def_id::LocalModDefId, rustc_middle[7532cecbef1af146]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[4050e2da7ab96027]::plumbing::QueryCtxt, false>
  39:     0x7f459daaaac4 - rustc_query_impl[4050e2da7ab96027]::query_impl::check_mod_item_types::get_query_non_incr::__rust_end_short_backtrace
  40:     0x7f459d589877 - <rustc_middle[7532cecbef1af146]::hir::map::Map>::for_each_module::<rustc_hir_analysis[417a0e0ce74bdc30]::check_crate::{closure#6}::{closure#0}>
  41:     0x7f459d587ff5 - rustc_hir_analysis[417a0e0ce74bdc30]::check_crate
  42:     0x7f459d5816c2 - rustc_interface[8cb810cfd898a703]::passes::analysis
  43:     0x7f459d592e3a - rustc_query_impl[4050e2da7ab96027]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[4050e2da7ab96027]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[7532cecbef1af146]::query::erase::Erased<[u8; 1usize]>>
  44:     0x7f459d592e29 - <rustc_query_impl[4050e2da7ab96027]::query_impl::analysis::dynamic_query::{closure#2} as core[4ff1a1b12c81ae0a]::ops::function::FnOnce<(rustc_middle[7532cecbef1af146]::ty::context::TyCtxt, ())>>::call_once
  45:     0x7f459d8750e4 - rustc_query_system[f4eb094e69159de6]::query::plumbing::try_execute_query::<rustc_query_impl[4050e2da7ab96027]::DynamicConfig<rustc_query_system[f4eb094e69159de6]::query::caches::SingleCache<rustc_middle[7532cecbef1af146]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[4050e2da7ab96027]::plumbing::QueryCtxt, false>
  46:     0x7f459d874e59 - rustc_query_impl[4050e2da7ab96027]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  47:     0x7f459d62ab92 - <rustc_middle[7532cecbef1af146]::ty::context::GlobalCtxt>::enter::<rustc_driver_impl[5065b449a99b292a]::run_compiler::{closure#1}::{closure#2}::{closure#6}, core[4ff1a1b12c81ae0a]::result::Result<(), rustc_span[52113c30dfc0425a]::ErrorGuaranteed>>
  48:     0x7f459d629bb1 - rustc_span[52113c30dfc0425a]::set_source_map::<core[4ff1a1b12c81ae0a]::result::Result<(), rustc_span[52113c30dfc0425a]::ErrorGuaranteed>, rustc_interface[8cb810cfd898a703]::interface::run_compiler<core[4ff1a1b12c81ae0a]::result::Result<(), rustc_span[52113c30dfc0425a]::ErrorGuaranteed>, rustc_driver_impl[5065b449a99b292a]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  49:     0x7f459d62888e - std[423b84e37edbea9d]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[8cb810cfd898a703]::util::run_in_thread_with_globals<rustc_interface[8cb810cfd898a703]::interface::run_compiler<core[4ff1a1b12c81ae0a]::result::Result<(), rustc_span[52113c30dfc0425a]::ErrorGuaranteed>, rustc_driver_impl[5065b449a99b292a]::run_compiler::{closure#1}>::{closure#0}, core[4ff1a1b12c81ae0a]::result::Result<(), rustc_span[52113c30dfc0425a]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[4ff1a1b12c81ae0a]::result::Result<(), rustc_span[52113c30dfc0425a]::ErrorGuaranteed>>
  50:     0x7f459d9ac34e - <<std[423b84e37edbea9d]::thread::Builder>::spawn_unchecked_<rustc_interface[8cb810cfd898a703]::util::run_in_thread_with_globals<rustc_interface[8cb810cfd898a703]::interface::run_compiler<core[4ff1a1b12c81ae0a]::result::Result<(), rustc_span[52113c30dfc0425a]::ErrorGuaranteed>, rustc_driver_impl[5065b449a99b292a]::run_compiler::{closure#1}>::{closure#0}, core[4ff1a1b12c81ae0a]::result::Result<(), rustc_span[52113c30dfc0425a]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[4ff1a1b12c81ae0a]::result::Result<(), rustc_span[52113c30dfc0425a]::ErrorGuaranteed>>::{closure#1} as core[4ff1a1b12c81ae0a]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  51:     0x7f459af71ec5 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h21dd47fc485ddadd
                               at /rustc/bdb0fa3ee5ffb4cc1a1b53cbe8344a2b83b1ae2a/library/alloc/src/boxed.rs:2007:9
  52:     0x7f459af71ec5 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h676a2c85317f6542
                               at /rustc/bdb0fa3ee5ffb4cc1a1b53cbe8344a2b83b1ae2a/library/alloc/src/boxed.rs:2007:9
  53:     0x7f459af71ec5 - std::sys::unix::thread::Thread::new::thread_start::h1169492f432a65d4
                               at /rustc/bdb0fa3ee5ffb4cc1a1b53cbe8344a2b83b1ae2a/library/std/src/sys/unix/thread.rs:108:17
  54:     0x7f459aa8c9eb - <unknown>
  55:     0x7f459ab10dfc - <unknown>
  56:                0x0 - <unknown>

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 attach the file at `/home/matthias/vcs/github/glacier2/TO_REPORT/rustc-ice-2023-09-21T12:15:07.571359303Z-841491.txt` to your bug report

query stack during panic:
#0 [type_of_opaque] computing type of opaque `Tait::{opaque#0}::{opaque#0}`
#1 [type_of] computing type of `Tait::{opaque#0}::{opaque#0}`
#2 [check_mod_item_types] checking item types in top-level module
#3 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 4 previous errors

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

@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. F-type_alias_impl_trait `#[feature(type_alias_impl_trait)]` labels Sep 21, 2023
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Sep 21, 2023
@matthiaskrgr
Copy link
Member Author

Regression in nightly-2023-09-20

@saethlin saethlin removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Sep 21, 2023
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Sep 22, 2023
…rrors

Account for nested `impl Trait` in TAIT

Fix rust-lang#116031.

r? `@compiler-errors`
@bors bors closed this as completed in f2ede49 Sep 22, 2023
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Sep 22, 2023
Rollup merge of rust-lang#116039 - estebank:nested-tait, r=compiler-errors

Account for nested `impl Trait` in TAIT

Fix rust-lang#116031.

r? `@compiler-errors`
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-type_alias_impl_trait `#[feature(type_alias_impl_trait)]` 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.

3 participants