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 "no entry for node id" (new_named_lifetime_with_res in rustc_ast_lowering) #103210

Closed
jruderman opened this issue Oct 18, 2022 · 0 comments · Fixed by #103216
Closed

ICE "no entry for node id" (new_named_lifetime_with_res in rustc_ast_lowering) #103210

jruderman opened this issue Oct 18, 2022 · 0 comments · Fixed by #103216
Assignees
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

@jruderman
Copy link
Contributor

Found by fuzzing with a modified fuzz-rustc

Code

The compiler panics while compiling this code (playground).

It then panics a second time while trying to explain why it panicked.

struct S<T> { _t: T }

fn f(S::<&i8> { .. }: S<&i8>) { }

fn main() {
    f(S { _t: &42_i8 });
}

I believe this is a valid Rust program, based on the variants below that compile successfully.

Meta

rustc --version --verbose:

rustc 1.66.0-nightly (b8b5caee0 2022-10-16)
binary: rustc
commit-hash: b8b5caee04116c7383eb1c6470fcf15c437a60d4
commit-date: 2022-10-16
host: x86_64-apple-darwin
release: 1.66.0-nightly
LLVM version: 15.0.2

Error output

thread 'rustc' panicked at 'no entry for node id: `NodeId(39)`', compiler/rustc_ast_lowering/src/lib.rs:530:55

query stack during panic:

thread 'rustc' panicked at 'already borrowed: BorrowMutError', /rustc/b8b5caee04116c7383eb1c6470fcf15c437a60d4/compiler/rustc_query_system/src/query/plumbing.rs:372:11
Full output with both backtraces

thread 'rustc' panicked at 'no entry for node id: `NodeId(39)`', compiler/rustc_ast_lowering/src/lib.rs:530:55
stack backtrace:
   0:        0x1015f6b22 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hfb61a9741044014f
   1:        0x10164e80a - core::fmt::write::h80b5546452104194
   2:        0x1015e8aec - std::io::Write::write_fmt::h33256fdd62339d0b
   3:        0x1015f68ea - std::sys_common::backtrace::print::hb694518e4c96c392
   4:        0x1015f9cf6 - std::panicking::default_hook::{{closure}}::he01b6bfd46306056
   5:        0x1015f9a47 - std::panicking::default_hook::h55443c55d7fa056c
   6:        0x10a7e15bd - rustc_driver[286c39cdc83f68da]::DEFAULT_HOOK::{closure#0}::{closure#0}
   7:        0x1015fa4f1 - std::panicking::rust_panic_with_hook::h8cb1f94537802594
   8:        0x1015fa283 - std::panicking::begin_panic_handler::{{closure}}::h187d949fd8e20977
   9:        0x1015f6fb8 - std::sys_common::backtrace::__rust_end_short_backtrace::hd86e521fe315a48c
  10:        0x1015f9f4d - _rust_begin_unwind
  11:        0x10167b283 - core::panicking::panic_fmt::h6de50ce229c1517b
  12:        0x10d5535c8 - <rustc_ast_lowering[38f7d2ec3d6fef89]::LoweringContext>::new_named_lifetime_with_res
  13:        0x10d543e3a - <rustc_ast_lowering[38f7d2ec3d6fef89]::LoweringContext>::lower_ty_direct
  14:        0x10d550367 - <rustc_ast_lowering[38f7d2ec3d6fef89]::LoweringContext>::lower_generic_arg
  15:        0x10d5a4dcd - <smallvec[7bffda26581a4dcd]::SmallVec<[rustc_hir[a1561edd397f405c]::hir::GenericArg; 4usize]> as core[c142ee26a724308]::iter::traits::collect::Extend<rustc_hir[a1561edd397f405c]::hir::GenericArg>>::extend::<core[c142ee26a724308]::iter::adapters::filter_map::FilterMap<core[c142ee26a724308]::slice::iter::Iter<rustc_ast[9f69a5d1c43c2806]::ast::AngleBracketedArg>, <rustc_ast_lowering[38f7d2ec3d6fef89]::LoweringContext>::lower_angle_bracketed_parameter_data::{closure#1}>>
  16:        0x10d53e4b8 - <rustc_ast_lowering[38f7d2ec3d6fef89]::LoweringContext>::lower_path_segment
  17:        0x10d5731a2 - <&mut <rustc_ast_lowering[38f7d2ec3d6fef89]::LoweringContext>::lower_qpath::{closure#3} as core[c142ee26a724308]::ops::function::FnOnce<((usize, &rustc_ast[9f69a5d1c43c2806]::ast::PathSegment),)>>::call_once
  18:        0x10d56477e - <rustc_hir[a1561edd397f405c]::Arena>::alloc_from_iter::<rustc_hir[a1561edd397f405c]::hir::PathSegment, rustc_arena[ec2ab19f8ba0be6c]::IsNotCopy, core[c142ee26a724308]::iter::adapters::map::Map<core[c142ee26a724308]::iter::adapters::enumerate::Enumerate<core[c142ee26a724308]::slice::iter::Iter<rustc_ast[9f69a5d1c43c2806]::ast::PathSegment>>, <rustc_ast_lowering[38f7d2ec3d6fef89]::LoweringContext>::lower_qpath::{closure#3}>>
  19:        0x10d549696 - <rustc_ast_lowering[38f7d2ec3d6fef89]::LoweringContext>::lower_qpath
  20:        0x10d53c376 - <rustc_ast_lowering[38f7d2ec3d6fef89]::LoweringContext>::lower_pat_mut::{closure#0}
  21:        0x10d538f02 - <rustc_ast_lowering[38f7d2ec3d6fef89]::LoweringContext>::lower_param
  22:        0x10d568340 - <rustc_hir[a1561edd397f405c]::Arena>::alloc_from_iter::<rustc_hir[a1561edd397f405c]::hir::Param, rustc_arena[ec2ab19f8ba0be6c]::IsNotCopy, core[c142ee26a724308]::iter::adapters::map::Map<core[c142ee26a724308]::slice::iter::Iter<rustc_ast[9f69a5d1c43c2806]::ast::Param>, <rustc_ast_lowering[38f7d2ec3d6fef89]::LoweringContext>::lower_fn_body<<rustc_ast_lowering[38f7d2ec3d6fef89]::LoweringContext>::lower_expr_closure::{closure#0}::{closure#0}>::{closure#0}::{closure#0}>>
  23:        0x10d539c94 - <rustc_ast_lowering[38f7d2ec3d6fef89]::LoweringContext>::lower_maybe_async_body
  24:        0x10d534011 - <rustc_ast_lowering[38f7d2ec3d6fef89]::LoweringContext>::lower_item_kind
  25:        0x10d54a39a - <rustc_ast_lowering[38f7d2ec3d6fef89]::LoweringContext>::with_hir_id_owner::<<rustc_ast_lowering[38f7d2ec3d6fef89]::item::ItemLowerer>::with_lctx<<rustc_ast_lowering[38f7d2ec3d6fef89]::item::ItemLowerer>::lower_item::{closure#0}>::{closure#0}>
  26:        0x10d574b39 - <rustc_ast_lowering[38f7d2ec3d6fef89]::item::ItemLowerer>::lower_node
  27:        0x10d540a74 - rustc_ast_lowering[38f7d2ec3d6fef89]::lower_to_hir
  28:        0x10df3d5a2 - rustc_query_system[60191ff238b8a13]::query::plumbing::try_execute_query::<rustc_query_impl[c368c67d71e7ea5e]::plumbing::QueryCtxt, rustc_query_system[60191ff238b8a13]::query::caches::ArenaCache<(), rustc_hir[a1561edd397f405c]::hir::Crate>>
  29:        0x10e084fa6 - rustc_query_system[60191ff238b8a13]::query::plumbing::get_query::<rustc_query_impl[c368c67d71e7ea5e]::queries::hir_crate, rustc_query_impl[c368c67d71e7ea5e]::plumbing::QueryCtxt>
  30:        0x10ee87ed3 - <rustc_middle[82a5eb415920cd5]::hir::provide::{closure#5} as core[c142ee26a724308]::ops::function::FnOnce<(rustc_middle[82a5eb415920cd5]::ty::context::TyCtxt, rustc_hir[a1561edd397f405c]::hir_id::OwnerId)>>::call_once
  31:        0x10dfdfd99 - rustc_query_system[60191ff238b8a13]::query::plumbing::try_execute_query::<rustc_query_impl[c368c67d71e7ea5e]::plumbing::QueryCtxt, rustc_query_system[60191ff238b8a13]::query::caches::DefaultCache<rustc_hir[a1561edd397f405c]::hir_id::OwnerId, &rustc_hir[a1561edd397f405c]::hir::AttributeMap>>
  32:        0x10e084e96 - rustc_query_system[60191ff238b8a13]::query::plumbing::get_query::<rustc_query_impl[c368c67d71e7ea5e]::queries::hir_attrs, rustc_query_impl[c368c67d71e7ea5e]::plumbing::QueryCtxt>
  33:        0x10eef467c - <rustc_middle[82a5eb415920cd5]::hir::map::Map>::attrs
  34:        0x10d8d65e2 - rustc_passes[f8f30ed79aba4c86]::entry::entry_fn
  35:        0x10e0089a8 - rustc_query_system[60191ff238b8a13]::query::plumbing::try_execute_query::<rustc_query_impl[c368c67d71e7ea5e]::plumbing::QueryCtxt, rustc_query_system[60191ff238b8a13]::query::caches::DefaultCache<(), core[c142ee26a724308]::option::Option<(rustc_span[625c954c368e5f39]::def_id::DefId, rustc_session[45de8744ec08d70e]::config::EntryFnType)>>>
  36:        0x10e084887 - rustc_query_system[60191ff238b8a13]::query::plumbing::get_query::<rustc_query_impl[c368c67d71e7ea5e]::queries::entry_fn, rustc_query_impl[c368c67d71e7ea5e]::plumbing::QueryCtxt>
  37:        0x10e113b6e - <rustc_query_impl[c368c67d71e7ea5e]::Queries as rustc_middle[82a5eb415920cd5]::ty::query::QueryEngine>::entry_fn
  38:        0x10a88086a - <rustc_session[45de8744ec08d70e]::session::Session>::time::<core[c142ee26a724308]::option::Option<(rustc_span[625c954c368e5f39]::def_id::DefId, rustc_session[45de8744ec08d70e]::config::EntryFnType)>, rustc_interface[4efa6836bf109096]::passes::analysis::{closure#0}::{closure#0}::{closure#0}>
  39:        0x10a884a83 - <rustc_session[45de8744ec08d70e]::session::Session>::time::<(), rustc_interface[4efa6836bf109096]::passes::analysis::{closure#0}>
  40:        0x10a8b1c61 - rustc_interface[4efa6836bf109096]::passes::analysis
  41:        0x10e0099cc - rustc_query_system[60191ff238b8a13]::query::plumbing::try_execute_query::<rustc_query_impl[c368c67d71e7ea5e]::plumbing::QueryCtxt, rustc_query_system[60191ff238b8a13]::query::caches::DefaultCache<(), core[c142ee26a724308]::result::Result<(), rustc_errors[41f2d39f8fb2a7bd]::ErrorGuaranteed>>>
  42:        0x10e0844c9 - rustc_query_system[60191ff238b8a13]::query::plumbing::get_query::<rustc_query_impl[c368c67d71e7ea5e]::queries::analysis, rustc_query_impl[c368c67d71e7ea5e]::plumbing::QueryCtxt>
  43:        0x10a7bfbb2 - <rustc_interface[4efa6836bf109096]::passes::QueryContext>::enter::<rustc_driver[286c39cdc83f68da]::run_compiler::{closure#1}::{closure#2}::{closure#3}, core[c142ee26a724308]::result::Result<(), rustc_errors[41f2d39f8fb2a7bd]::ErrorGuaranteed>>
  44:        0x10a758907 - <rustc_interface[4efa6836bf109096]::interface::Compiler>::enter::<rustc_driver[286c39cdc83f68da]::run_compiler::{closure#1}::{closure#2}, core[c142ee26a724308]::result::Result<core[c142ee26a724308]::option::Option<rustc_interface[4efa6836bf109096]::queries::Linker>, rustc_errors[41f2d39f8fb2a7bd]::ErrorGuaranteed>>
  45:        0x10a7ccec5 - rustc_span[625c954c368e5f39]::with_source_map::<core[c142ee26a724308]::result::Result<(), rustc_errors[41f2d39f8fb2a7bd]::ErrorGuaranteed>, rustc_interface[4efa6836bf109096]::interface::create_compiler_and_run<core[c142ee26a724308]::result::Result<(), rustc_errors[41f2d39f8fb2a7bd]::ErrorGuaranteed>, rustc_driver[286c39cdc83f68da]::run_compiler::{closure#1}>::{closure#1}>
  46:        0x10a773ad0 - rustc_interface[4efa6836bf109096]::interface::create_compiler_and_run::<core[c142ee26a724308]::result::Result<(), rustc_errors[41f2d39f8fb2a7bd]::ErrorGuaranteed>, rustc_driver[286c39cdc83f68da]::run_compiler::{closure#1}>
  47:        0x10a7bf395 - <scoped_tls[253ff75064fd0c2b]::ScopedKey<rustc_span[625c954c368e5f39]::SessionGlobals>>::set::<rustc_interface[4efa6836bf109096]::interface::run_compiler<core[c142ee26a724308]::result::Result<(), rustc_errors[41f2d39f8fb2a7bd]::ErrorGuaranteed>, rustc_driver[286c39cdc83f68da]::run_compiler::{closure#1}>::{closure#0}, core[c142ee26a724308]::result::Result<(), rustc_errors[41f2d39f8fb2a7bd]::ErrorGuaranteed>>
  48:        0x10a78ec1a - std[20409a7cc1741f85]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[4efa6836bf109096]::util::run_in_thread_pool_with_globals<rustc_interface[4efa6836bf109096]::interface::run_compiler<core[c142ee26a724308]::result::Result<(), rustc_errors[41f2d39f8fb2a7bd]::ErrorGuaranteed>, rustc_driver[286c39cdc83f68da]::run_compiler::{closure#1}>::{closure#0}, core[c142ee26a724308]::result::Result<(), rustc_errors[41f2d39f8fb2a7bd]::ErrorGuaranteed>>::{closure#0}, core[c142ee26a724308]::result::Result<(), rustc_errors[41f2d39f8fb2a7bd]::ErrorGuaranteed>>
  49:        0x10a77508b - <<std[20409a7cc1741f85]::thread::Builder>::spawn_unchecked_<rustc_interface[4efa6836bf109096]::util::run_in_thread_pool_with_globals<rustc_interface[4efa6836bf109096]::interface::run_compiler<core[c142ee26a724308]::result::Result<(), rustc_errors[41f2d39f8fb2a7bd]::ErrorGuaranteed>, rustc_driver[286c39cdc83f68da]::run_compiler::{closure#1}>::{closure#0}, core[c142ee26a724308]::result::Result<(), rustc_errors[41f2d39f8fb2a7bd]::ErrorGuaranteed>>::{closure#0}, core[c142ee26a724308]::result::Result<(), rustc_errors[41f2d39f8fb2a7bd]::ErrorGuaranteed>>::{closure#1} as core[c142ee26a724308]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  50:        0x101603607 - std::sys::unix::thread::Thread::new::thread_start::h8c17323206c3f1d4
  51:     0x7ff813a244e1 - __pthread_start

error: internal compiler error: unexpected panic

note: 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: rustc 1.66.0-nightly (b8b5caee0 2022-10-16) running on x86_64-apple-darwin

query stack during panic:
thread 'rustc' panicked at 'already borrowed: BorrowMutError', /rustc/b8b5caee04116c7383eb1c6470fcf15c437a60d4/compiler/rustc_query_system/src/query/plumbing.rs:372:11
stack backtrace:
   0:        0x1015f6b22 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hfb61a9741044014f
   1:        0x10164e80a - core::fmt::write::h80b5546452104194
   2:        0x1015e8aec - std::io::Write::write_fmt::h33256fdd62339d0b
   3:        0x1015f68ea - std::sys_common::backtrace::print::hb694518e4c96c392
   4:        0x1015f9cf6 - std::panicking::default_hook::{{closure}}::he01b6bfd46306056
   5:        0x1015f9a47 - std::panicking::default_hook::h55443c55d7fa056c
   6:        0x10a7e15bd - rustc_driver[286c39cdc83f68da]::DEFAULT_HOOK::{closure#0}::{closure#0}
   7:        0x1015fa4f1 - std::panicking::rust_panic_with_hook::h8cb1f94537802594
   8:        0x1015fa283 - std::panicking::begin_panic_handler::{{closure}}::h187d949fd8e20977
   9:        0x1015f6fb8 - std::sys_common::backtrace::__rust_end_short_backtrace::hd86e521fe315a48c
  10:        0x1015f9f4d - _rust_begin_unwind
  11:        0x10167b283 - core::panicking::panic_fmt::h6de50ce229c1517b
  12:        0x10167b545 - core::result::unwrap_failed::h07fd8953c60f2a53
  13:        0x10df7af9d - rustc_query_system[60191ff238b8a13]::query::plumbing::try_execute_query::<rustc_query_impl[c368c67d71e7ea5e]::plumbing::QueryCtxt, rustc_query_system[60191ff238b8a13]::query::caches::DefaultCache<rustc_span[625c954c368e5f39]::def_id::LocalDefId, rustc_hir[a1561edd397f405c]::hir_id::HirId>>
  14:        0x10e07cc5d - rustc_query_system[60191ff238b8a13]::query::plumbing::get_query::<rustc_query_impl[c368c67d71e7ea5e]::queries::local_def_id_to_hir_id, rustc_query_impl[c368c67d71e7ea5e]::plumbing::QueryCtxt>
  15:        0x10eeefc5e - <rustc_middle[82a5eb415920cd5]::hir::map::Map>::local_def_id_to_hir_id
  16:        0x10eeefd29 - <rustc_middle[82a5eb415920cd5]::hir::map::Map>::opt_def_kind
  17:        0x10df8fdfe - rustc_query_system[60191ff238b8a13]::query::plumbing::try_execute_query::<rustc_query_impl[c368c67d71e7ea5e]::plumbing::QueryCtxt, rustc_query_system[60191ff238b8a13]::query::caches::DefaultCache<rustc_span[625c954c368e5f39]::def_id::DefId, core[c142ee26a724308]::option::Option<rustc_hir[a1561edd397f405c]::def::DefKind>>>
  18:        0x10e070ed6 - rustc_query_system[60191ff238b8a13]::query::plumbing::get_query::<rustc_query_impl[c368c67d71e7ea5e]::queries::opt_def_kind, rustc_query_impl[c368c67d71e7ea5e]::plumbing::QueryCtxt>
  19:        0x10e2ccc46 - rustc_query_impl[c368c67d71e7ea5e]::plumbing::create_query_frame::<rustc_span[625c954c368e5f39]::def_id::DefId>
  20:        0x10e1eeefb - <rustc_query_impl[c368c67d71e7ea5e]::query_structs::def_span::{closure#0} as core[c142ee26a724308]::ops::function::FnOnce<(rustc_query_impl[c368c67d71e7ea5e]::plumbing::QueryCtxt, &mut std[20409a7cc1741f85]::collections::hash::map::HashMap<rustc_query_system[60191ff238b8a13]::query::job::QueryJobId, rustc_query_system[60191ff238b8a13]::query::job::QueryJobInfo, core[c142ee26a724308]::hash::BuildHasherDefault<rustc_hash[cb6040bd39e89a8d]::FxHasher>>)>>::call_once
  21:        0x10df9f737 - rustc_query_system[60191ff238b8a13]::query::plumbing::try_execute_query::<rustc_query_impl[c368c67d71e7ea5e]::plumbing::QueryCtxt, rustc_query_system[60191ff238b8a13]::query::caches::DefaultCache<rustc_span[625c954c368e5f39]::def_id::DefId, rustc_span[625c954c368e5f39]::span_encoding::Span>>
  22:        0x10e084623 - rustc_query_system[60191ff238b8a13]::query::plumbing::get_query::<rustc_query_impl[c368c67d71e7ea5e]::queries::def_span, rustc_query_impl[c368c67d71e7ea5e]::plumbing::QueryCtxt>
  23:        0x10e113065 - <rustc_query_impl[c368c67d71e7ea5e]::Queries as rustc_middle[82a5eb415920cd5]::ty::query::QueryEngine>::def_span
  24:        0x10e19434d - <rustc_span[625c954c368e5f39]::def_id::DefId as rustc_query_impl[c368c67d71e7ea5e]::keys::Key>::default_span
  25:        0x10e2cc6e6 - rustc_query_impl[c368c67d71e7ea5e]::plumbing::create_query_frame::<rustc_span[625c954c368e5f39]::def_id::LocalDefId>
  26:        0x10e1d9725 - <rustc_query_impl[c368c67d71e7ea5e]::query_structs::local_def_id_to_hir_id::{closure#0} as core[c142ee26a724308]::ops::function::FnOnce<(rustc_query_impl[c368c67d71e7ea5e]::plumbing::QueryCtxt, &mut std[20409a7cc1741f85]::collections::hash::map::HashMap<rustc_query_system[60191ff238b8a13]::query::job::QueryJobId, rustc_query_system[60191ff238b8a13]::query::job::QueryJobInfo, core[c142ee26a724308]::hash::BuildHasherDefault<rustc_hash[cb6040bd39e89a8d]::FxHasher>>)>>::call_once
  27:        0x10df3d7d9 - rustc_query_system[60191ff238b8a13]::query::plumbing::try_execute_query::<rustc_query_impl[c368c67d71e7ea5e]::plumbing::QueryCtxt, rustc_query_system[60191ff238b8a13]::query::caches::ArenaCache<(), rustc_hir[a1561edd397f405c]::hir::Crate>>
  28:        0x10e084fa6 - rustc_query_system[60191ff238b8a13]::query::plumbing::get_query::<rustc_query_impl[c368c67d71e7ea5e]::queries::hir_crate, rustc_query_impl[c368c67d71e7ea5e]::plumbing::QueryCtxt>
  29:        0x10ee877c7 - <rustc_middle[82a5eb415920cd5]::hir::provide::{closure#2} as core[c142ee26a724308]::ops::function::FnOnce<(rustc_middle[82a5eb415920cd5]::ty::context::TyCtxt, rustc_span[625c954c368e5f39]::def_id::LocalDefId)>>::call_once
  30:        0x10df7a9ff - rustc_query_system[60191ff238b8a13]::query::plumbing::try_execute_query::<rustc_query_impl[c368c67d71e7ea5e]::plumbing::QueryCtxt, rustc_query_system[60191ff238b8a13]::query::caches::DefaultCache<rustc_span[625c954c368e5f39]::def_id::LocalDefId, rustc_hir[a1561edd397f405c]::hir_id::HirId>>
  31:        0x10e07cc5d - rustc_query_system[60191ff238b8a13]::query::plumbing::get_query::<rustc_query_impl[c368c67d71e7ea5e]::queries::local_def_id_to_hir_id, rustc_query_impl[c368c67d71e7ea5e]::plumbing::QueryCtxt>
  32:        0x10ee894be - <rustc_middle[82a5eb415920cd5]::hir::map::Map>::local_def_id_to_hir_id
  33:        0x10ee880c3 - <rustc_middle[82a5eb415920cd5]::hir::provide::{closure#7} as core[c142ee26a724308]::ops::function::FnOnce<(rustc_middle[82a5eb415920cd5]::ty::context::TyCtxt, rustc_span[625c954c368e5f39]::def_id::DefId)>>::call_once
  34:        0x10df9fba2 - rustc_query_system[60191ff238b8a13]::query::plumbing::try_execute_query::<rustc_query_impl[c368c67d71e7ea5e]::plumbing::QueryCtxt, rustc_query_system[60191ff238b8a13]::query::caches::DefaultCache<rustc_span[625c954c368e5f39]::def_id::DefId, rustc_span[625c954c368e5f39]::span_encoding::Span>>
  35:        0x10e084623 - rustc_query_system[60191ff238b8a13]::query::plumbing::get_query::<rustc_query_impl[c368c67d71e7ea5e]::queries::def_span, rustc_query_impl[c368c67d71e7ea5e]::plumbing::QueryCtxt>
  36:        0x10e113065 - <rustc_query_impl[c368c67d71e7ea5e]::Queries as rustc_middle[82a5eb415920cd5]::ty::query::QueryEngine>::def_span
  37:        0x10e19434d - <rustc_span[625c954c368e5f39]::def_id::DefId as rustc_query_impl[c368c67d71e7ea5e]::keys::Key>::default_span
  38:        0x10e2cc6e6 - rustc_query_impl[c368c67d71e7ea5e]::plumbing::create_query_frame::<rustc_span[625c954c368e5f39]::def_id::LocalDefId>
  39:        0x10e1f0e45 - <rustc_query_impl[c368c67d71e7ea5e]::query_structs::hir_attrs::{closure#0} as core[c142ee26a724308]::ops::function::FnOnce<(rustc_query_impl[c368c67d71e7ea5e]::plumbing::QueryCtxt, &mut std[20409a7cc1741f85]::collections::hash::map::HashMap<rustc_query_system[60191ff238b8a13]::query::job::QueryJobId, rustc_query_system[60191ff238b8a13]::query::job::QueryJobInfo, core[c142ee26a724308]::hash::BuildHasherDefault<rustc_hash[cb6040bd39e89a8d]::FxHasher>>)>>::call_once
  40:        0x10e19968d - rustc_query_system[60191ff238b8a13]::query::job::print_query_stack::<rustc_query_impl[c368c67d71e7ea5e]::plumbing::QueryCtxt>
  41:        0x10a90c392 - rustc_interface[4efa6836bf109096]::interface::try_print_query_stack
  42:        0x10a7e226c - rustc_driver[286c39cdc83f68da]::report_ice
  43:        0x1015fa4f1 - std::panicking::rust_panic_with_hook::h8cb1f94537802594
  44:        0x1015fa283 - std::panicking::begin_panic_handler::{{closure}}::h187d949fd8e20977
  45:        0x1015f6fb8 - std::sys_common::backtrace::__rust_end_short_backtrace::hd86e521fe315a48c
  46:        0x1015f9f4d - _rust_begin_unwind
  47:        0x10167b283 - core::panicking::panic_fmt::h6de50ce229c1517b
  48:        0x10d5535c8 - <rustc_ast_lowering[38f7d2ec3d6fef89]::LoweringContext>::new_named_lifetime_with_res
  49:        0x10d543e3a - <rustc_ast_lowering[38f7d2ec3d6fef89]::LoweringContext>::lower_ty_direct
  50:        0x10d550367 - <rustc_ast_lowering[38f7d2ec3d6fef89]::LoweringContext>::lower_generic_arg
  51:        0x10d5a4dcd - <smallvec[7bffda26581a4dcd]::SmallVec<[rustc_hir[a1561edd397f405c]::hir::GenericArg; 4usize]> as core[c142ee26a724308]::iter::traits::collect::Extend<rustc_hir[a1561edd397f405c]::hir::GenericArg>>::extend::<core[c142ee26a724308]::iter::adapters::filter_map::FilterMap<core[c142ee26a724308]::slice::iter::Iter<rustc_ast[9f69a5d1c43c2806]::ast::AngleBracketedArg>, <rustc_ast_lowering[38f7d2ec3d6fef89]::LoweringContext>::lower_angle_bracketed_parameter_data::{closure#1}>>
  52:        0x10d53e4b8 - <rustc_ast_lowering[38f7d2ec3d6fef89]::LoweringContext>::lower_path_segment
  53:        0x10d5731a2 - <&mut <rustc_ast_lowering[38f7d2ec3d6fef89]::LoweringContext>::lower_qpath::{closure#3} as core[c142ee26a724308]::ops::function::FnOnce<((usize, &rustc_ast[9f69a5d1c43c2806]::ast::PathSegment),)>>::call_once
  54:        0x10d56477e - <rustc_hir[a1561edd397f405c]::Arena>::alloc_from_iter::<rustc_hir[a1561edd397f405c]::hir::PathSegment, rustc_arena[ec2ab19f8ba0be6c]::IsNotCopy, core[c142ee26a724308]::iter::adapters::map::Map<core[c142ee26a724308]::iter::adapters::enumerate::Enumerate<core[c142ee26a724308]::slice::iter::Iter<rustc_ast[9f69a5d1c43c2806]::ast::PathSegment>>, <rustc_ast_lowering[38f7d2ec3d6fef89]::LoweringContext>::lower_qpath::{closure#3}>>
  55:        0x10d549696 - <rustc_ast_lowering[38f7d2ec3d6fef89]::LoweringContext>::lower_qpath
  56:        0x10d53c376 - <rustc_ast_lowering[38f7d2ec3d6fef89]::LoweringContext>::lower_pat_mut::{closure#0}
  57:        0x10d538f02 - <rustc_ast_lowering[38f7d2ec3d6fef89]::LoweringContext>::lower_param
  58:        0x10d568340 - <rustc_hir[a1561edd397f405c]::Arena>::alloc_from_iter::<rustc_hir[a1561edd397f405c]::hir::Param, rustc_arena[ec2ab19f8ba0be6c]::IsNotCopy, core[c142ee26a724308]::iter::adapters::map::Map<core[c142ee26a724308]::slice::iter::Iter<rustc_ast[9f69a5d1c43c2806]::ast::Param>, <rustc_ast_lowering[38f7d2ec3d6fef89]::LoweringContext>::lower_fn_body<<rustc_ast_lowering[38f7d2ec3d6fef89]::LoweringContext>::lower_expr_closure::{closure#0}::{closure#0}>::{closure#0}::{closure#0}>>
  59:        0x10d539c94 - <rustc_ast_lowering[38f7d2ec3d6fef89]::LoweringContext>::lower_maybe_async_body
  60:        0x10d534011 - <rustc_ast_lowering[38f7d2ec3d6fef89]::LoweringContext>::lower_item_kind
  61:        0x10d54a39a - <rustc_ast_lowering[38f7d2ec3d6fef89]::LoweringContext>::with_hir_id_owner::<<rustc_ast_lowering[38f7d2ec3d6fef89]::item::ItemLowerer>::with_lctx<<rustc_ast_lowering[38f7d2ec3d6fef89]::item::ItemLowerer>::lower_item::{closure#0}>::{closure#0}>
  62:        0x10d574b39 - <rustc_ast_lowering[38f7d2ec3d6fef89]::item::ItemLowerer>::lower_node
  63:        0x10d540a74 - rustc_ast_lowering[38f7d2ec3d6fef89]::lower_to_hir
  64:        0x10df3d5a2 - rustc_query_system[60191ff238b8a13]::query::plumbing::try_execute_query::<rustc_query_impl[c368c67d71e7ea5e]::plumbing::QueryCtxt, rustc_query_system[60191ff238b8a13]::query::caches::ArenaCache<(), rustc_hir[a1561edd397f405c]::hir::Crate>>
  65:        0x10e084fa6 - rustc_query_system[60191ff238b8a13]::query::plumbing::get_query::<rustc_query_impl[c368c67d71e7ea5e]::queries::hir_crate, rustc_query_impl[c368c67d71e7ea5e]::plumbing::QueryCtxt>
  66:        0x10ee87ed3 - <rustc_middle[82a5eb415920cd5]::hir::provide::{closure#5} as core[c142ee26a724308]::ops::function::FnOnce<(rustc_middle[82a5eb415920cd5]::ty::context::TyCtxt, rustc_hir[a1561edd397f405c]::hir_id::OwnerId)>>::call_once
  67:        0x10dfdfd99 - rustc_query_system[60191ff238b8a13]::query::plumbing::try_execute_query::<rustc_query_impl[c368c67d71e7ea5e]::plumbing::QueryCtxt, rustc_query_system[60191ff238b8a13]::query::caches::DefaultCache<rustc_hir[a1561edd397f405c]::hir_id::OwnerId, &rustc_hir[a1561edd397f405c]::hir::AttributeMap>>
  68:        0x10e084e96 - rustc_query_system[60191ff238b8a13]::query::plumbing::get_query::<rustc_query_impl[c368c67d71e7ea5e]::queries::hir_attrs, rustc_query_impl[c368c67d71e7ea5e]::plumbing::QueryCtxt>
  69:        0x10eef467c - <rustc_middle[82a5eb415920cd5]::hir::map::Map>::attrs
  70:        0x10d8d65e2 - rustc_passes[f8f30ed79aba4c86]::entry::entry_fn
  71:        0x10e0089a8 - rustc_query_system[60191ff238b8a13]::query::plumbing::try_execute_query::<rustc_query_impl[c368c67d71e7ea5e]::plumbing::QueryCtxt, rustc_query_system[60191ff238b8a13]::query::caches::DefaultCache<(), core[c142ee26a724308]::option::Option<(rustc_span[625c954c368e5f39]::def_id::DefId, rustc_session[45de8744ec08d70e]::config::EntryFnType)>>>
  72:        0x10e084887 - rustc_query_system[60191ff238b8a13]::query::plumbing::get_query::<rustc_query_impl[c368c67d71e7ea5e]::queries::entry_fn, rustc_query_impl[c368c67d71e7ea5e]::plumbing::QueryCtxt>
  73:        0x10e113b6e - <rustc_query_impl[c368c67d71e7ea5e]::Queries as rustc_middle[82a5eb415920cd5]::ty::query::QueryEngine>::entry_fn
  74:        0x10a88086a - <rustc_session[45de8744ec08d70e]::session::Session>::time::<core[c142ee26a724308]::option::Option<(rustc_span[625c954c368e5f39]::def_id::DefId, rustc_session[45de8744ec08d70e]::config::EntryFnType)>, rustc_interface[4efa6836bf109096]::passes::analysis::{closure#0}::{closure#0}::{closure#0}>
  75:        0x10a884a83 - <rustc_session[45de8744ec08d70e]::session::Session>::time::<(), rustc_interface[4efa6836bf109096]::passes::analysis::{closure#0}>
  76:        0x10a8b1c61 - rustc_interface[4efa6836bf109096]::passes::analysis
  77:        0x10e0099cc - rustc_query_system[60191ff238b8a13]::query::plumbing::try_execute_query::<rustc_query_impl[c368c67d71e7ea5e]::plumbing::QueryCtxt, rustc_query_system[60191ff238b8a13]::query::caches::DefaultCache<(), core[c142ee26a724308]::result::Result<(), rustc_errors[41f2d39f8fb2a7bd]::ErrorGuaranteed>>>
  78:        0x10e0844c9 - rustc_query_system[60191ff238b8a13]::query::plumbing::get_query::<rustc_query_impl[c368c67d71e7ea5e]::queries::analysis, rustc_query_impl[c368c67d71e7ea5e]::plumbing::QueryCtxt>
  79:        0x10a7bfbb2 - <rustc_interface[4efa6836bf109096]::passes::QueryContext>::enter::<rustc_driver[286c39cdc83f68da]::run_compiler::{closure#1}::{closure#2}::{closure#3}, core[c142ee26a724308]::result::Result<(), rustc_errors[41f2d39f8fb2a7bd]::ErrorGuaranteed>>
  80:        0x10a758907 - <rustc_interface[4efa6836bf109096]::interface::Compiler>::enter::<rustc_driver[286c39cdc83f68da]::run_compiler::{closure#1}::{closure#2}, core[c142ee26a724308]::result::Result<core[c142ee26a724308]::option::Option<rustc_interface[4efa6836bf109096]::queries::Linker>, rustc_errors[41f2d39f8fb2a7bd]::ErrorGuaranteed>>
  81:        0x10a7ccec5 - rustc_span[625c954c368e5f39]::with_source_map::<core[c142ee26a724308]::result::Result<(), rustc_errors[41f2d39f8fb2a7bd]::ErrorGuaranteed>, rustc_interface[4efa6836bf109096]::interface::create_compiler_and_run<core[c142ee26a724308]::result::Result<(), rustc_errors[41f2d39f8fb2a7bd]::ErrorGuaranteed>, rustc_driver[286c39cdc83f68da]::run_compiler::{closure#1}>::{closure#1}>
  82:        0x10a773ad0 - rustc_interface[4efa6836bf109096]::interface::create_compiler_and_run::<core[c142ee26a724308]::result::Result<(), rustc_errors[41f2d39f8fb2a7bd]::ErrorGuaranteed>, rustc_driver[286c39cdc83f68da]::run_compiler::{closure#1}>
  83:        0x10a7bf395 - <scoped_tls[253ff75064fd0c2b]::ScopedKey<rustc_span[625c954c368e5f39]::SessionGlobals>>::set::<rustc_interface[4efa6836bf109096]::interface::run_compiler<core[c142ee26a724308]::result::Result<(), rustc_errors[41f2d39f8fb2a7bd]::ErrorGuaranteed>, rustc_driver[286c39cdc83f68da]::run_compiler::{closure#1}>::{closure#0}, core[c142ee26a724308]::result::Result<(), rustc_errors[41f2d39f8fb2a7bd]::ErrorGuaranteed>>
  84:        0x10a78ec1a - std[20409a7cc1741f85]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[4efa6836bf109096]::util::run_in_thread_pool_with_globals<rustc_interface[4efa6836bf109096]::interface::run_compiler<core[c142ee26a724308]::result::Result<(), rustc_errors[41f2d39f8fb2a7bd]::ErrorGuaranteed>, rustc_driver[286c39cdc83f68da]::run_compiler::{closure#1}>::{closure#0}, core[c142ee26a724308]::result::Result<(), rustc_errors[41f2d39f8fb2a7bd]::ErrorGuaranteed>>::{closure#0}, core[c142ee26a724308]::result::Result<(), rustc_errors[41f2d39f8fb2a7bd]::ErrorGuaranteed>>
  85:        0x10a77508b - <<std[20409a7cc1741f85]::thread::Builder>::spawn_unchecked_<rustc_interface[4efa6836bf109096]::util::run_in_thread_pool_with_globals<rustc_interface[4efa6836bf109096]::interface::run_compiler<core[c142ee26a724308]::result::Result<(), rustc_errors[41f2d39f8fb2a7bd]::ErrorGuaranteed>, rustc_driver[286c39cdc83f68da]::run_compiler::{closure#1}>::{closure#0}, core[c142ee26a724308]::result::Result<(), rustc_errors[41f2d39f8fb2a7bd]::ErrorGuaranteed>>::{closure#0}, core[c142ee26a724308]::result::Result<(), rustc_errors[41f2d39f8fb2a7bd]::ErrorGuaranteed>>::{closure#1} as core[c142ee26a724308]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  86:        0x101603607 - std::sys::unix::thread::Thread::new::thread_start::h8c17323206c3f1d4
  87:     0x7ff813a244e1 - __pthread_start

error: internal compiler error: unexpected panic

note: 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: rustc 1.66.0-nightly (b8b5caee0 2022-10-16) running on x86_64-apple-darwin

query stack during panic:
thread panicked while processing panic. aborting.
Abort trap: 6

Variants that do not crash

It compiles successfully if I change &i8 to _ in the paramter's pattern:

struct S<T> { _t: T }

fn f(S::<_> { .. }: S<&i8>) { }

fn main() {
    f(S { _t: &42_i8 });
}

It also compiles successfully if I change the reference to specify the 'static lifetime throughout:

struct S<T> { _t: T }

fn f(S::<&'static i8> { .. }: S<&'static i8>) { }

fn main() {
    f(S { _t: &42_i8 });
}
@jruderman jruderman added 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. labels Oct 18, 2022
@cjgillot cjgillot self-assigned this Oct 18, 2022
@bors bors closed this as completed in 32159e3 Oct 19, 2022
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.

2 participants