Skip to content

ICE: name of non-Rpitit assoc item (episode 3) #140084

Closed
@matthiaskrgr

Description

@matthiaskrgr

still repros on top of #139981

auto-reduced (treereduce-rust):

trait Trait {
    fn method(&self) -> impl Sized;
}

struct Struct<T>(T);

fn main() {
    Struct::<()>::return_type_notation{
    fn method(&self) -> 
};
}

original:

//@ check-pass

#![feature(return_type_notation)]

trait Trait {
    fn method(&self) -> impl Sized;
}

impl Trait for () {
    fn method(&self) -> impl Sized {}
}

struct Struct<T>(T);

// This test used to fail a debug assertion since we weren't resolving the item
// for `T::method(..)` correctly, leading to two bound vars being given the
// index 0. The solution is to look at both generics of `test` and its parent impl.

impl<T> Struct<T>
where
    T: Trait,
{
    fn test()
    where
        T::method(..): Send
    {}
}

fn main() {
    Struct::<()>::return_type_notation{
    fn method(&self) -> impl Sized {}
};
}

Version information

rustc 1.88.0-dev
binary: rustc
commit-hash: unknown
commit-date: unknown
host: x86_64-unknown-linux-gnu
release: 1.88.0-dev
LLVM version: 20.1.2

Possibly related line of code:

}
}
// Gets the identifier name. Aborts if it lacks one, i.e. is an RPITIT
// associated type.
pub fn name(&self) -> Symbol {
self.opt_name().expect("name of non-Rpitit assoc item")
}
pub fn ident(&self, tcx: TyCtxt<'_>) -> Ident {
Ident::new(self.name(), tcx.def_ident_span(self.def_id).unwrap())
}

Command:
/home/matthias/vcs/github/rust/build/x86_64-unknown-linux-gnu/stage1/bin/rustc -Zincremental-verify-ich=yes -Cincremental=<dir> -Cdebuginfo=2 -Clink-dead-code=true -Zvalidate-mir --edition=2024

Program output

error: expected identifier, found keyword `fn`
  --> /tmp/icemaker_global_tempdir.AlPgpHtExNKi/rustc_testrunner_tmpdir_reporting.W2U9qydpSMKz/mvce.rs:21:5
   |
20 |     Struct::<()>::return_type_notation{
   |     ---------------------------------- while parsing this struct
21 |     fn method(&self) -> 
   |     ^^ expected identifier, found keyword


thread 'rustc' panicked at compiler/rustc_middle/src/ty/assoc.rs:43:25:
name of non-Rpitit assoc item
stack backtrace:
   0:     0x74f2f73ba79d - std::backtrace_rs::backtrace::libunwind::trace::h011b48c467e59619
                               at /home/matthias/vcs/github/rust/library/std/src/../../backtrace/src/backtrace/libunwind.rs:117:9
   1:     0x74f2f73ba79d - std::backtrace_rs::backtrace::trace_unsynchronized::h07cd764734aa0c0b
                               at /home/matthias/vcs/github/rust/library/std/src/../../backtrace/src/backtrace/mod.rs:66:14
   2:     0x74f2f73ba79d - std::sys::backtrace::_print_fmt::h58ded1cbd33f5cd9
                               at /home/matthias/vcs/github/rust/library/std/src/sys/backtrace.rs:66:9
   3:     0x74f2f73ba79d - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h8998fad0cc282486
                               at /home/matthias/vcs/github/rust/library/std/src/sys/backtrace.rs:39:26
   4:     0x74f2f740c52f - core::fmt::rt::Argument::fmt::hbae11d0e63bc4d00
                               at /home/matthias/vcs/github/rust/library/core/src/fmt/rt.rs:179:76
   5:     0x74f2f740c52f - core::fmt::write::haab9b401431f7cb9
                               at /home/matthias/vcs/github/rust/library/core/src/fmt/mod.rs:1481:25
   6:     0x74f2f7364669 - std::io::default_write_fmt::hcec8a00af467e222
                               at /home/matthias/vcs/github/rust/library/std/src/io/mod.rs:639:11
   7:     0x74f2f739c6c7 - std::io::Write::write_fmt::h83476355c0037b46
                               at /home/matthias/vcs/github/rust/library/std/src/io/mod.rs:1914:13
   8:     0x74f2f73ba643 - std::sys::backtrace::BacktraceLock::print::h07f0c825e9c26892
                               at /home/matthias/vcs/github/rust/library/std/src/sys/backtrace.rs:42:9
   9:     0x74f2f738ec4e - std::panicking::default_hook::{{closure}}::h9d70cceec4fa3281
  10:     0x74f2f738ea97 - std::panicking::default_hook::h97d6f5c85e79066a
                               at /home/matthias/vcs/github/rust/library/std/src/panicking.rs:327:9
  11:     0x74f2f32dcef2 - rustc_driver_impl[4b320e172352ba9d]::install_ice_hook::{closure#1}
                               at /home/matthias/vcs/github/rust/compiler/rustc_driver_impl/src/lib.rs:1360:17
  12:     0x74f2f32dcef2 - <alloc[a8793daebe823be9]::boxed::Box<rustc_driver_impl[4b320e172352ba9d]::install_ice_hook::{closure#1}> as core[3433a92f17b11c25]::ops::function::Fn<(&dyn for<'a, 'b> core[3433a92f17b11c25]::ops::function::Fn<(&'a std[f60f9d482cb5fed2]::panic::PanicHookInfo<'b>,), Output = ()> + core[3433a92f17b11c25]::marker::Sync + core[3433a92f17b11c25]::marker::Send, &std[f60f9d482cb5fed2]::panic::PanicHookInfo)>>::call
                               at /home/matthias/vcs/github/rust/library/alloc/src/boxed.rs:1980:9
  13:     0x74f2f738f3db - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h660ff84d52d06a37
                               at /home/matthias/vcs/github/rust/library/alloc/src/boxed.rs:1980:9
  14:     0x74f2f738f3db - std::panicking::rust_panic_with_hook::h07bf001ff87db426
                               at /home/matthias/vcs/github/rust/library/std/src/panicking.rs:841:13
  15:     0x74f2f73bb7fc - std::panicking::begin_panic_handler::{{closure}}::h61d878ca62a48dcd
                               at /home/matthias/vcs/github/rust/library/std/src/panicking.rs:706:13
  16:     0x74f2f73ba9d9 - std::sys::backtrace::__rust_end_short_backtrace::he52d83b0f58c3da5
                               at /home/matthias/vcs/github/rust/library/std/src/sys/backtrace.rs:168:18
  17:     0x74f2f738ecdf - __rustc[ec7fb6ce294bfd5b]::rust_begin_unwind
                               at /home/matthias/vcs/github/rust/library/std/src/panicking.rs:697:5
  18:     0x74f2f31cf3c0 - core::panicking::panic_fmt::hc7451b10a276178e
                               at /home/matthias/vcs/github/rust/library/core/src/panicking.rs:75:14
  19:     0x74f2f31cf0ab - core::panicking::panic_display::h64897a4f3c634d42
                               at /home/matthias/vcs/github/rust/library/core/src/panicking.rs:261:5
  20:     0x74f2f31cf0ab - core::option::expect_failed::h1c6ee84547ee983e
                               at /home/matthias/vcs/github/rust/library/core/src/option.rs:2024:5
  21:     0x74f2f6d40ee8 - <core[3433a92f17b11c25]::option::Option<rustc_span[e77f64a58ae1dba3]::symbol::Symbol>>::expect
                               at /home/matthias/vcs/github/rust/library/core/src/option.rs:933:21
  22:     0x74f2f6d40ee8 - <rustc_middle[8e80a05929e71d30]::ty::assoc::AssocItem>::name
                               at /home/matthias/vcs/github/rust/compiler/rustc_middle/src/ty/assoc.rs:43:25
  23:     0x74f2f6d40ee8 - <rustc_middle[8e80a05929e71d30]::ty::assoc::AssocItem>::ident
                               at /home/matthias/vcs/github/rust/compiler/rustc_middle/src/ty/assoc.rs:47:20
  24:     0x74f2f3ee9a3d - <dyn rustc_hir_analysis[28e1860b7f9e1bd2]::hir_ty_lowering::HirTyLowerer>::probe_traits_that_match_assoc_ty::{closure#0}::{closure#0}
                               at /home/matthias/vcs/github/rust/compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs:1735:36
  25:     0x74f2f3ee9a3d - core[3433a92f17b11c25]::iter::traits::iterator::Iterator::any::check::<&rustc_middle[8e80a05929e71d30]::ty::assoc::AssocItem, <dyn rustc_hir_analysis[28e1860b7f9e1bd2]::hir_ty_lowering::HirTyLowerer>::probe_traits_that_match_assoc_ty::{closure#0}::{closure#0}>::{closure#0}
                               at /home/matthias/vcs/github/rust/library/core/src/iter/traits/iterator.rs:2780:20
  26:     0x74f2f3ee9a3d - core[3433a92f17b11c25]::iter::adapters::map::map_try_fold::<(&core[3433a92f17b11c25]::option::Option<rustc_span[e77f64a58ae1dba3]::symbol::Symbol>, &rustc_middle[8e80a05929e71d30]::ty::assoc::AssocItem), &rustc_middle[8e80a05929e71d30]::ty::assoc::AssocItem, (), core[3433a92f17b11c25]::ops::control_flow::ControlFlow<()>, <rustc_middle[8e80a05929e71d30]::ty::assoc::AssocItems>::in_definition_order::{closure#0}, core[3433a92f17b11c25]::iter::traits::iterator::Iterator::any::check<&rustc_middle[8e80a05929e71d30]::ty::assoc::AssocItem, <dyn rustc_hir_analysis[28e1860b7f9e1bd2]::hir_ty_lowering::HirTyLowerer>::probe_traits_that_match_assoc_ty::{closure#0}::{closure#0}>::{closure#0}>::{closure#0}
                               at /home/matthias/vcs/github/rust/library/core/src/iter/adapters/map.rs:95:21
  27:     0x74f2f3ee9a3d - core[3433a92f17b11c25]::iter::adapters::map::map_try_fold::<&(core[3433a92f17b11c25]::option::Option<rustc_span[e77f64a58ae1dba3]::symbol::Symbol>, rustc_middle[8e80a05929e71d30]::ty::assoc::AssocItem), (&core[3433a92f17b11c25]::option::Option<rustc_span[e77f64a58ae1dba3]::symbol::Symbol>, &rustc_middle[8e80a05929e71d30]::ty::assoc::AssocItem), (), core[3433a92f17b11c25]::ops::control_flow::ControlFlow<()>, <rustc_data_structures[8ead172b8b87331e]::sorted_map::index_map::SortedIndexMultiMap<u32, core[3433a92f17b11c25]::option::Option<rustc_span[e77f64a58ae1dba3]::symbol::Symbol>, rustc_middle[8e80a05929e71d30]::ty::assoc::AssocItem>>::iter::{closure#0}, core[3433a92f17b11c25]::iter::adapters::map::map_try_fold<(&core[3433a92f17b11c25]::option::Option<rustc_span[e77f64a58ae1dba3]::symbol::Symbol>, &rustc_middle[8e80a05929e71d30]::ty::assoc::AssocItem), &rustc_middle[8e80a05929e71d30]::ty::assoc::AssocItem, (), core[3433a92f17b11c25]::ops::control_flow::ControlFlow<()>, <rustc_middle[8e80a05929e71d30]::ty::assoc::AssocItems>::in_definition_order::{closure#0}, core[3433a92f17b11c25]::iter::traits::iterator::Iterator::any::check<&rustc_middle[8e80a05929e71d30]::ty::assoc::AssocItem, <dyn rustc_hir_analysis[28e1860b7f9e1bd2]::hir_ty_lowering::HirTyLowerer>::probe_traits_that_match_assoc_ty::{closure#0}::{closure#0}>::{closure#0}>::{closure#0}>::{closure#0}
                               at /home/matthias/vcs/github/rust/library/core/src/iter/adapters/map.rs:95:21
  28:     0x74f2f3ee9a3d - <core[3433a92f17b11c25]::slice::iter::Iter<(core[3433a92f17b11c25]::option::Option<rustc_span[e77f64a58ae1dba3]::symbol::Symbol>, rustc_middle[8e80a05929e71d30]::ty::assoc::AssocItem)> as core[3433a92f17b11c25]::iter::traits::iterator::Iterator>::try_fold::<(), core[3433a92f17b11c25]::iter::adapters::map::map_try_fold<&(core[3433a92f17b11c25]::option::Option<rustc_span[e77f64a58ae1dba3]::symbol::Symbol>, rustc_middle[8e80a05929e71d30]::ty::assoc::AssocItem), (&core[3433a92f17b11c25]::option::Option<rustc_span[e77f64a58ae1dba3]::symbol::Symbol>, &rustc_middle[8e80a05929e71d30]::ty::assoc::AssocItem), (), core[3433a92f17b11c25]::ops::control_flow::ControlFlow<()>, <rustc_data_structures[8ead172b8b87331e]::sorted_map::index_map::SortedIndexMultiMap<u32, core[3433a92f17b11c25]::option::Option<rustc_span[e77f64a58ae1dba3]::symbol::Symbol>, rustc_middle[8e80a05929e71d30]::ty::assoc::AssocItem>>::iter::{closure#0}, core[3433a92f17b11c25]::iter::adapters::map::map_try_fold<(&core[3433a92f17b11c25]::option::Option<rustc_span[e77f64a58ae1dba3]::symbol::Symbol>, &rustc_middle[8e80a05929e71d30]::ty::assoc::AssocItem), &rustc_middle[8e80a05929e71d30]::ty::assoc::AssocItem, (), core[3433a92f17b11c25]::ops::control_flow::ControlFlow<()>, <rustc_middle[8e80a05929e71d30]::ty::assoc::AssocItems>::in_definition_order::{closure#0}, core[3433a92f17b11c25]::iter::traits::iterator::Iterator::any::check<&rustc_middle[8e80a05929e71d30]::ty::assoc::AssocItem, <dyn rustc_hir_analysis[28e1860b7f9e1bd2]::hir_ty_lowering::HirTyLowerer>::probe_traits_that_match_assoc_ty::{closure#0}::{closure#0}>::{closure#0}>::{closure#0}>::{closure#0}, core[3433a92f17b11c25]::ops::control_flow::ControlFlow<()>>
                               at /home/matthias/vcs/github/rust/library/core/src/iter/traits/iterator.rs:2384:21

<snip>  


 126:     0x74f2f3e75f8c - rustc_hir_analysis[28e1860b7f9e1bd2]::check_crate::{closure#3}
                               at /home/matthias/vcs/github/rust/compiler/rustc_hir_analysis/src/lib.rs:232:13
 127:     0x74f2f3e75f8c - <rustc_middle[8e80a05929e71d30]::ty::context::TyCtxt>::par_hir_body_owners::<rustc_hir_analysis[28e1860b7f9e1bd2]::check_crate::{closure#3}>::{closure#0}
                               at /home/matthias/vcs/github/rust/compiler/rustc_middle/src/hir/map.rs:340:79
 128:     0x74f2f3e6d36b - rustc_data_structures[8ead172b8b87331e]::sync::parallel::par_for_each_in::<&rustc_span[e77f64a58ae1dba3]::def_id::LocalDefId, &[rustc_span[e77f64a58ae1dba3]::def_id::LocalDefId], <rustc_middle[8e80a05929e71d30]::ty::context::TyCtxt>::par_hir_body_owners<rustc_hir_analysis[28e1860b7f9e1bd2]::check_crate::{closure#3}>::{closure#0}>::{closure#0}::{closure#1}::{closure#0}
                               at /home/matthias/vcs/github/rust/compiler/rustc_data_structures/src/sync/parallel.rs:172:30
 129:     0x74f2f3e6d36b - <core[3433a92f17b11c25]::panic::unwind_safe::AssertUnwindSafe<rustc_data_structures[8ead172b8b87331e]::sync::parallel::par_for_each_in<&rustc_span[e77f64a58ae1dba3]::def_id::LocalDefId, &[rustc_span[e77f64a58ae1dba3]::def_id::LocalDefId], <rustc_middle[8e80a05929e71d30]::ty::context::TyCtxt>::par_hir_body_owners<rustc_hir_analysis[28e1860b7f9e1bd2]::check_crate::{closure#3}>::{closure#0}>::{closure#0}::{closure#1}::{closure#0}> as core[3433a92f17b11c25]::ops::function::FnOnce<()>>::call_once
                               at /home/matthias/vcs/github/rust/library/core/src/panic/unwind_safe.rs:272:9
 130:     0x74f2f3e6d36b - std[f60f9d482cb5fed2]::panicking::try::do_call::<core[3433a92f17b11c25]::panic::unwind_safe::AssertUnwindSafe<rustc_data_structures[8ead172b8b87331e]::sync::parallel::par_for_each_in<&rustc_span[e77f64a58ae1dba3]::def_id::LocalDefId, &[rustc_span[e77f64a58ae1dba3]::def_id::LocalDefId], <rustc_middle[8e80a05929e71d30]::ty::context::TyCtxt>::par_hir_body_owners<rustc_hir_analysis[28e1860b7f9e1bd2]::check_crate::{closure#3}>::{closure#0}>::{closure#0}::{closure#1}::{closure#0}>, ()>
                               at /home/matthias/vcs/github/rust/library/std/src/panicking.rs:589:40
 131:     0x74f2f3e6d36b - std[f60f9d482cb5fed2]::panicking::try::<(), core[3433a92f17b11c25]::panic::unwind_safe::AssertUnwindSafe<rustc_data_structures[8ead172b8b87331e]::sync::parallel::par_for_each_in<&rustc_span[e77f64a58ae1dba3]::def_id::LocalDefId, &[rustc_span[e77f64a58ae1dba3]::def_id::LocalDefId], <rustc_middle[8e80a05929e71d30]::ty::context::TyCtxt>::par_hir_body_owners<rustc_hir_analysis[28e1860b7f9e1bd2]::check_crate::{closure#3}>::{closure#0}>::{closure#0}::{closure#1}::{closure#0}>>
                               at /home/matthias/vcs/github/rust/library/std/src/panicking.rs:552:19
 132:     0x74f2f3e6d36b - std[f60f9d482cb5fed2]::panic::catch_unwind::<core[3433a92f17b11c25]::panic::unwind_safe::AssertUnwindSafe<rustc_data_structures[8ead172b8b87331e]::sync::parallel::par_for_each_in<&rustc_span[e77f64a58ae1dba3]::def_id::LocalDefId, &[rustc_span[e77f64a58ae1dba3]::def_id::LocalDefId], <rustc_middle[8e80a05929e71d30]::ty::context::TyCtxt>::par_hir_body_owners<rustc_hir_analysis[28e1860b7f9e1bd2]::check_crate::{closure#3}>::{closure#0}>::{closure#0}::{closure#1}::{closure#0}>, ()>
                               at /home/matthias/vcs/github/rust/library/std/src/panic.rs:359:14
 133:     0x74f2f3e6d36b - <rustc_data_structures[8ead172b8b87331e]::sync::parallel::ParallelGuard>::run::<(), rustc_data_structures[8ead172b8b87331e]::sync::parallel::par_for_each_in<&rustc_span[e77f64a58ae1dba3]::def_id::LocalDefId, &[rustc_span[e77f64a58ae1dba3]::def_id::LocalDefId], <rustc_middle[8e80a05929e71d30]::ty::context::TyCtxt>::par_hir_body_owners<rustc_hir_analysis[28e1860b7f9e1bd2]::check_crate::{closure#3}>::{closure#0}>::{closure#0}::{closure#1}::{closure#0}>
                               at /home/matthias/vcs/github/rust/compiler/rustc_data_structures/src/sync/parallel.rs:25:9
 134:     0x74f2f3e6d36b - rustc_data_structures[8ead172b8b87331e]::sync::parallel::par_for_each_in::<&rustc_span[e77f64a58ae1dba3]::def_id::LocalDefId, &[rustc_span[e77f64a58ae1dba3]::def_id::LocalDefId], <rustc_middle[8e80a05929e71d30]::ty::context::TyCtxt>::par_hir_body_owners<rustc_hir_analysis[28e1860b7f9e1bd2]::check_crate::{closure#3}>::{closure#0}>::{closure#0}::{closure#1}
                               at /home/matthias/vcs/github/rust/compiler/rustc_data_structures/src/sync/parallel.rs:172:17
 135:     0x74f2f3e6d36b - <core[3433a92f17b11c25]::slice::iter::Iter<rustc_span[e77f64a58ae1dba3]::def_id::LocalDefId> as core[3433a92f17b11c25]::iter::traits::iterator::Iterator>::for_each::<rustc_data_structures[8ead172b8b87331e]::sync::parallel::par_for_each_in<&rustc_span[e77f64a58ae1dba3]::def_id::LocalDefId, &[rustc_span[e77f64a58ae1dba3]::def_id::LocalDefId], <rustc_middle[8e80a05929e71d30]::ty::context::TyCtxt>::par_hir_body_owners<rustc_hir_analysis[28e1860b7f9e1bd2]::check_crate::{closure#3}>::{closure#0}>::{closure#0}::{closure#1}>
                               at /home/matthias/vcs/github/rust/library/core/src/slice/iter/macros.rs:277:21
 136:     0x74f2f3e6d36b - rustc_data_structures[8ead172b8b87331e]::sync::parallel::par_for_each_in::<&rustc_span[e77f64a58ae1dba3]::def_id::LocalDefId, &[rustc_span[e77f64a58ae1dba3]::def_id::LocalDefId], <rustc_middle[8e80a05929e71d30]::ty::context::TyCtxt>::par_hir_body_owners<rustc_hir_analysis[28e1860b7f9e1bd2]::check_crate::{closure#3}>::{closure#0}>::{closure#0}
                               at /home/matthias/vcs/github/rust/compiler/rustc_data_structures/src/sync/parallel.rs:171:13
 137:     0x74f2f3e6d36b - rustc_data_structures[8ead172b8b87331e]::sync::parallel::parallel_guard::<(), rustc_data_structures[8ead172b8b87331e]::sync::parallel::par_for_each_in<&rustc_span[e77f64a58ae1dba3]::def_id::LocalDefId, &[rustc_span[e77f64a58ae1dba3]::def_id::LocalDefId], <rustc_middle[8e80a05929e71d30]::ty::context::TyCtxt>::par_hir_body_owners<rustc_hir_analysis[28e1860b7f9e1bd2]::check_crate::{closure#3}>::{closure#0}>::{closure#0}>
                               at /home/matthias/vcs/github/rust/compiler/rustc_data_structures/src/sync/parallel.rs:41:15
 138:     0x74f2f3e6d36b - rustc_data_structures[8ead172b8b87331e]::sync::parallel::par_for_each_in::<&rustc_span[e77f64a58ae1dba3]::def_id::LocalDefId, &[rustc_span[e77f64a58ae1dba3]::def_id::LocalDefId], <rustc_middle[8e80a05929e71d30]::ty::context::TyCtxt>::par_hir_body_owners<rustc_hir_analysis[28e1860b7f9e1bd2]::check_crate::{closure#3}>::{closure#0}>
                               at /home/matthias/vcs/github/rust/compiler/rustc_data_structures/src/sync/parallel.rs:166:5
 139:     0x74f2f3f3ebb4 - <rustc_middle[8e80a05929e71d30]::ty::context::TyCtxt>::par_hir_body_owners::<rustc_hir_analysis[28e1860b7f9e1bd2]::check_crate::{closure#3}>
                               at /home/matthias/vcs/github/rust/compiler/rustc_middle/src/hir/map.rs:340:9
 
<snip>

 183:     0x74f2f32c9448 - <rustc_middle[8e80a05929e71d30]::ty::context::GlobalCtxt>::enter::<rustc_interface[a2b0c3829ae2eb7d]::passes::create_and_enter_global_ctxt<core[3433a92f17b11c25]::option::Option<rustc_interface[a2b0c3829ae2eb7d]::queries::Linker>, rustc_driver_impl[4b320e172352ba9d]::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}, core[3433a92f17b11c25]::option::Option<rustc_interface[a2b0c3829ae2eb7d]::queries::Linker>>::{closure#1}
                               at /home/matthias/vcs/github/rust/compiler/rustc_middle/src/ty/context.rs:1446:37
 184:     0x74f2f32c9448 - rustc_middle[8e80a05929e71d30]::ty::context::tls::enter_context::<<rustc_middle[8e80a05929e71d30]::ty::context::GlobalCtxt>::enter<rustc_interface[a2b0c3829ae2eb7d]::passes::create_and_enter_global_ctxt<core[3433a92f17b11c25]::option::Option<rustc_interface[a2b0c3829ae2eb7d]::queries::Linker>, rustc_driver_impl[4b320e172352ba9d]::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}, core[3433a92f17b11c25]::option::Option<rustc_interface[a2b0c3829ae2eb7d]::queries::Linker>>::{closure#1}, core[3433a92f17b11c25]::option::Option<rustc_interface[a2b0c3829ae2eb7d]::queries::Linker>>::{closure#0}
                               at /home/matthias/vcs/github/rust/compiler/rustc_middle/src/ty/context/tls.rs:60:9
 185:     0x74f2f32c9448 - <std[f60f9d482cb5fed2]::thread::local::LocalKey<core[3433a92f17b11c25]::cell::Cell<*const ()>>>::try_with::<rustc_middle[8e80a05929e71d30]::ty::context::tls::enter_context<<rustc_middle[8e80a05929e71d30]::ty::context::GlobalCtxt>::enter<rustc_interface[a2b0c3829ae2eb7d]::passes::create_and_enter_global_ctxt<core[3433a92f17b11c25]::option::Option<rustc_interface[a2b0c3829ae2eb7d]::queries::Linker>, rustc_driver_impl[4b320e172352ba9d]::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}, core[3433a92f17b11c25]::option::Option<rustc_interface[a2b0c3829ae2eb7d]::queries::Linker>>::{closure#1}, core[3433a92f17b11c25]::option::Option<rustc_interface[a2b0c3829ae2eb7d]::queries::Linker>>::{closure#0}, core[3433a92f17b11c25]::option::Option<rustc_interface[a2b0c3829ae2eb7d]::queries::Linker>>
                               at /home/matthias/vcs/github/rust/library/std/src/thread/local.rs:311:12
 186:     0x74f2f32c9448 - <std[f60f9d482cb5fed2]::thread::local::LocalKey<core[3433a92f17b11c25]::cell::Cell<*const ()>>>::with::<rustc_middle[8e80a05929e71d30]::ty::context::tls::enter_context<<rustc_middle[8e80a05929e71d30]::ty::context::GlobalCtxt>::enter<rustc_interface[a2b0c3829ae2eb7d]::passes::create_and_enter_global_ctxt<core[3433a92f17b11c25]::option::Option<rustc_interface[a2b0c3829ae2eb7d]::queries::Linker>, rustc_driver_impl[4b320e172352ba9d]::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}, core[3433a92f17b11c25]::option::Option<rustc_interface[a2b0c3829ae2eb7d]::queries::Linker>>::{closure#1}, core[3433a92f17b11c25]::option::Option<rustc_interface[a2b0c3829ae2eb7d]::queries::Linker>>::{closure#0}, core[3433a92f17b11c25]::option::Option<rustc_interface[a2b0c3829ae2eb7d]::queries::Linker>>
                               at /home/matthias/vcs/github/rust/library/std/src/thread/local.rs:275:15
 187:     0x74f2f3294c62 - rustc_middle[8e80a05929e71d30]::ty::context::tls::enter_context::<<rustc_middle[8e80a05929e71d30]::ty::context::GlobalCtxt>::enter<rustc_interface[a2b0c3829ae2eb7d]::passes::create_and_enter_global_ctxt<core[3433a92f17b11c25]::option::Option<rustc_interface[a2b0c3829ae2eb7d]::queries::Linker>, rustc_driver_impl[4b320e172352ba9d]::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}, core[3433a92f17b11c25]::option::Option<rustc_interface[a2b0c3829ae2eb7d]::queries::Linker>>::{closure#1}, core[3433a92f17b11c25]::option::Option<rustc_interface[a2b0c3829ae2eb7d]::queries::Linker>>
                               at /home/matthias/vcs/github/rust/compiler/rustc_middle/src/ty/context/tls.rs:57:5
 188:     0x74f2f3294c62 - <rustc_middle[8e80a05929e71d30]::ty::context::GlobalCtxt>::enter::<rustc_interface[a2b0c3829ae2eb7d]::passes::create_and_enter_global_ctxt<core[3433a92f17b11c25]::option::Option<rustc_interface[a2b0c3829ae2eb7d]::queries::Linker>, rustc_driver_impl[4b320e172352ba9d]::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}, core[3433a92f17b11c25]::option::Option<rustc_interface[a2b0c3829ae2eb7d]::queries::Linker>>
                               at /home/matthias/vcs/github/rust/compiler/rustc_middle/src/ty/context.rs:1446:9
 189:     0x74f2f3294c62 - <rustc_middle[8e80a05929e71d30]::ty::context::TyCtxt>::create_global_ctxt::<core[3433a92f17b11c25]::option::Option<rustc_interface[a2b0c3829ae2eb7d]::queries::Linker>, rustc_interface[a2b0c3829ae2eb7d]::passes::create_and_enter_global_ctxt<core[3433a92f17b11c25]::option::Option<rustc_interface[a2b0c3829ae2eb7d]::queries::Linker>, rustc_driver_impl[4b320e172352ba9d]::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}>
                               at /home/matthias/vcs/github/rust/compiler/rustc_middle/src/ty/context.rs:1664:9
 190:     0x74f2f3292e82 - rustc_interface[a2b0c3829ae2eb7d]::passes::create_and_enter_global_ctxt::<core[3433a92f17b11c25]::option::Option<rustc_interface[a2b0c3829ae2eb7d]::queries::Linker>, rustc_driver_impl[4b320e172352ba9d]::run_compiler::{closure#0}::{closure#2}>::{closure#2}
                               at /home/matthias/vcs/github/rust/compiler/rustc_interface/src/passes.rs:850:9
 191:     0x74f2f3292e82 - <rustc_interface[a2b0c3829ae2eb7d]::passes::create_and_enter_global_ctxt<core[3433a92f17b11c25]::option::Option<rustc_interface[a2b0c3829ae2eb7d]::queries::Linker>, rustc_driver_impl[4b320e172352ba9d]::run_compiler::{closure#0}::{closure#2}>::{closure#2} as core[3433a92f17b11c25]::ops::function::FnOnce<(&rustc_session[454d65d1bea7e803]::session::Session, rustc_middle[8e80a05929e71d30]::ty::context::CurrentGcx, &std[f60f9d482cb5fed2]::sync::once_lock::OnceLock<rustc_middle[8e80a05929e71d30]::ty::context::GlobalCtxt>, &rustc_data_structures[8ead172b8b87331e]::sync::worker_local::WorkerLocal<rustc_middle[8e80a05929e71d30]::arena::Arena>, &rustc_data_structures[8ead172b8b87331e]::sync::worker_local::WorkerLocal<rustc_hir[6997dbbcdb3d6577]::Arena>, rustc_driver_impl[4b320e172352ba9d]::run_compiler::{closure#0}::{closure#2})>>::call_once::{shim:vtable#0}
                               at /home/matthias/vcs/github/rust/library/core/src/ops/function.rs:250:5
 192:     0x74f2f32dcc67 - <alloc[a8793daebe823be9]::boxed::Box<dyn for<'a> core[3433a92f17b11c25]::ops::function::FnOnce<(&'a rustc_session[454d65d1bea7e803]::session::Session, rustc_middle[8e80a05929e71d30]::ty::context::CurrentGcx, &'a std[f60f9d482cb5fed2]::sync::once_lock::OnceLock<rustc_middle[8e80a05929e71d30]::ty::context::GlobalCtxt<'a>>, &'a rustc_data_structures[8ead172b8b87331e]::sync::worker_local::WorkerLocal<rustc_middle[8e80a05929e71d30]::arena::Arena<'a>>, &'a rustc_data_structures[8ead172b8b87331e]::sync::worker_local::WorkerLocal<rustc_hir[6997dbbcdb3d6577]::Arena<'a>>, rustc_driver_impl[4b320e172352ba9d]::run_compiler::{closure#0}::{closure#2}), Output = core[3433a92f17b11c25]::option::Option<rustc_interface[a2b0c3829ae2eb7d]::queries::Linker>>> as core[3433a92f17b11c25]::ops::function::FnOnce<(&rustc_session[454d65d1bea7e803]::session::Session, rustc_middle[8e80a05929e71d30]::ty::context::CurrentGcx, &std[f60f9d482cb5fed2]::sync::once_lock::OnceLock<rustc_middle[8e80a05929e71d30]::ty::context::GlobalCtxt>, &rustc_data_structures[8ead172b8b87331e]::sync::worker_local::WorkerLocal<rustc_middle[8e80a05929e71d30]::arena::Arena>, &rustc_data_structures[8ead172b8b87331e]::sync::worker_local::WorkerLocal<rustc_hir[6997dbbcdb3d6577]::Arena>, rustc_driver_impl[4b320e172352ba9d]::run_compiler::{closure#0}::{closure#2})>>::call_once
                               at /home/matthias/vcs/github/rust/library/alloc/src/boxed.rs:1966:9
 193:     0x74f2f3291b0d - rustc_interface[a2b0c3829ae2eb7d]::passes::create_and_enter_global_ctxt::<core[3433a92f17b11c25]::option::Option<rustc_interface[a2b0c3829ae2eb7d]::queries::Linker>, rustc_driver_impl[4b320e172352ba9d]::run_compiler::{closure#0}::{closure#2}>
                               at /home/matthias/vcs/github/rust/compiler/rustc_interface/src/passes.rs:890:5
 194:     0x74f2f3254cdc - rustc_driver_impl[4b320e172352ba9d]::run_compiler::{closure#0}
                               at /home/matthias/vcs/github/rust/compiler/rustc_driver_impl/src/lib.rs:340:22
 195:     0x74f2f3254cdc - rustc_interface[a2b0c3829ae2eb7d]::interface::run_compiler::<(), rustc_driver_impl[4b320e172352ba9d]::run_compiler::{closure#0}>::{closure#1}::{closure#0}
                               at /home/matthias/vcs/github/rust/compiler/rustc_interface/src/interface.rs:521:80
 196:     0x74f2f3254cdc - <core[3433a92f17b11c25]::panic::unwind_safe::AssertUnwindSafe<rustc_interface[a2b0c3829ae2eb7d]::interface::run_compiler<(), rustc_driver_impl[4b320e172352ba9d]::run_compiler::{closure#0}>::{closure#1}::{closure#0}> as core[3433a92f17b11c25]::ops::function::FnOnce<()>>::call_once
                               at /home/matthias/vcs/github/rust/library/core/src/panic/unwind_safe.rs:272:9
 197:     0x74f2f3254cdc - std[f60f9d482cb5fed2]::panicking::try::do_call::<core[3433a92f17b11c25]::panic::unwind_safe::AssertUnwindSafe<rustc_interface[a2b0c3829ae2eb7d]::interface::run_compiler<(), rustc_driver_impl[4b320e172352ba9d]::run_compiler::{closure#0}>::{closure#1}::{closure#0}>, ()>
                               at /home/matthias/vcs/github/rust/library/std/src/panicking.rs:589:40
 198:     0x74f2f3254cdc - std[f60f9d482cb5fed2]::panicking::try::<(), core[3433a92f17b11c25]::panic::unwind_safe::AssertUnwindSafe<rustc_interface[a2b0c3829ae2eb7d]::interface::run_compiler<(), rustc_driver_impl[4b320e172352ba9d]::run_compiler::{closure#0}>::{closure#1}::{closure#0}>>
                               at /home/matthias/vcs/github/rust/library/std/src/panicking.rs:552:19
 199:     0x74f2f3254cdc - std[f60f9d482cb5fed2]::panic::catch_unwind::<core[3433a92f17b11c25]::panic::unwind_safe::AssertUnwindSafe<rustc_interface[a2b0c3829ae2eb7d]::interface::run_compiler<(), rustc_driver_impl[4b320e172352ba9d]::run_compiler::{closure#0}>::{closure#1}::{closure#0}>, ()>
                               at /home/matthias/vcs/github/rust/library/std/src/panic.rs:359:14
 200:     0x74f2f3254cdc - rustc_interface[a2b0c3829ae2eb7d]::interface::run_compiler::<(), rustc_driver_impl[4b320e172352ba9d]::run_compiler::{closure#0}>::{closure#1}
                               at /home/matthias/vcs/github/rust/compiler/rustc_interface/src/interface.rs:521:23
 201:     0x74f2f3254cdc - rustc_interface[a2b0c3829ae2eb7d]::util::run_in_thread_pool_with_globals::<rustc_interface[a2b0c3829ae2eb7d]::interface::run_compiler<(), rustc_driver_impl[4b320e172352ba9d]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}
                               at /home/matthias/vcs/github/rust/compiler/rustc_interface/src/util.rs:185:17
 202:     0x74f2f3254cdc - rustc_interface[a2b0c3829ae2eb7d]::util::run_in_thread_with_globals::<rustc_interface[a2b0c3829ae2eb7d]::util::run_in_thread_pool_with_globals<rustc_interface[a2b0c3829ae2eb7d]::interface::run_compiler<(), rustc_driver_impl[4b320e172352ba9d]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}::{closure#0}
                               at /home/matthias/vcs/github/rust/compiler/rustc_interface/src/util.rs:142:24
 203:     0x74f2f3254cdc - <scoped_tls[c07c3cd9f178fa0e]::ScopedKey<rustc_span[e77f64a58ae1dba3]::SessionGlobals>>::set::<rustc_interface[a2b0c3829ae2eb7d]::util::run_in_thread_with_globals<rustc_interface[a2b0c3829ae2eb7d]::util::run_in_thread_pool_with_globals<rustc_interface[a2b0c3829ae2eb7d]::interface::run_compiler<(), rustc_driver_impl[4b320e172352ba9d]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}::{closure#0}, ()>
                               at /home/matthias/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/scoped-tls-1.0.1/src/lib.rs:137:9
 204:     0x74f2f32f14c5 - rustc_span[e77f64a58ae1dba3]::create_session_globals_then::<(), rustc_interface[a2b0c3829ae2eb7d]::util::run_in_thread_with_globals<rustc_interface[a2b0c3829ae2eb7d]::util::run_in_thread_pool_with_globals<rustc_interface[a2b0c3829ae2eb7d]::interface::run_compiler<(), rustc_driver_impl[4b320e172352ba9d]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}::{closure#0}>
                               at /home/matthias/vcs/github/rust/compiler/rustc_span/src/lib.rs:146:5
 205:     0x74f2f32f14c5 - rustc_interface[a2b0c3829ae2eb7d]::util::run_in_thread_with_globals::<rustc_interface[a2b0c3829ae2eb7d]::util::run_in_thread_pool_with_globals<rustc_interface[a2b0c3829ae2eb7d]::interface::run_compiler<(), rustc_driver_impl[4b320e172352ba9d]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}
                               at /home/matthias/vcs/github/rust/compiler/rustc_interface/src/util.rs:138:17
 206:     0x74f2f32f14c5 - std[f60f9d482cb5fed2]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[a2b0c3829ae2eb7d]::util::run_in_thread_with_globals<rustc_interface[a2b0c3829ae2eb7d]::util::run_in_thread_pool_with_globals<rustc_interface[a2b0c3829ae2eb7d]::interface::run_compiler<(), rustc_driver_impl[4b320e172352ba9d]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
                               at /home/matthias/vcs/github/rust/library/std/src/sys/backtrace.rs:152:18
 207:     0x74f2f3260ae3 - <std[f60f9d482cb5fed2]::thread::Builder>::spawn_unchecked_::<rustc_interface[a2b0c3829ae2eb7d]::util::run_in_thread_with_globals<rustc_interface[a2b0c3829ae2eb7d]::util::run_in_thread_pool_with_globals<rustc_interface[a2b0c3829ae2eb7d]::interface::run_compiler<(), rustc_driver_impl[4b320e172352ba9d]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1}::{closure#0}
                               at /home/matthias/vcs/github/rust/library/std/src/thread/mod.rs:559:17
 208:     0x74f2f3260ae3 - <core[3433a92f17b11c25]::panic::unwind_safe::AssertUnwindSafe<<std[f60f9d482cb5fed2]::thread::Builder>::spawn_unchecked_<rustc_interface[a2b0c3829ae2eb7d]::util::run_in_thread_with_globals<rustc_interface[a2b0c3829ae2eb7d]::util::run_in_thread_pool_with_globals<rustc_interface[a2b0c3829ae2eb7d]::interface::run_compiler<(), rustc_driver_impl[4b320e172352ba9d]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1}::{closure#0}> as core[3433a92f17b11c25]::ops::function::FnOnce<()>>::call_once
                               at /home/matthias/vcs/github/rust/library/core/src/panic/unwind_safe.rs:272:9
 209:     0x74f2f3260ae3 - std[f60f9d482cb5fed2]::panicking::try::do_call::<core[3433a92f17b11c25]::panic::unwind_safe::AssertUnwindSafe<<std[f60f9d482cb5fed2]::thread::Builder>::spawn_unchecked_<rustc_interface[a2b0c3829ae2eb7d]::util::run_in_thread_with_globals<rustc_interface[a2b0c3829ae2eb7d]::util::run_in_thread_pool_with_globals<rustc_interface[a2b0c3829ae2eb7d]::interface::run_compiler<(), rustc_driver_impl[4b320e172352ba9d]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1}::{closure#0}>, ()>
                               at /home/matthias/vcs/github/rust/library/std/src/panicking.rs:589:40
 210:     0x74f2f3260ae3 - std[f60f9d482cb5fed2]::panicking::try::<(), core[3433a92f17b11c25]::panic::unwind_safe::AssertUnwindSafe<<std[f60f9d482cb5fed2]::thread::Builder>::spawn_unchecked_<rustc_interface[a2b0c3829ae2eb7d]::util::run_in_thread_with_globals<rustc_interface[a2b0c3829ae2eb7d]::util::run_in_thread_pool_with_globals<rustc_interface[a2b0c3829ae2eb7d]::interface::run_compiler<(), rustc_driver_impl[4b320e172352ba9d]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1}::{closure#0}>>
                               at /home/matthias/vcs/github/rust/library/std/src/panicking.rs:552:19
 211:     0x74f2f3260ae3 - std[f60f9d482cb5fed2]::panic::catch_unwind::<core[3433a92f17b11c25]::panic::unwind_safe::AssertUnwindSafe<<std[f60f9d482cb5fed2]::thread::Builder>::spawn_unchecked_<rustc_interface[a2b0c3829ae2eb7d]::util::run_in_thread_with_globals<rustc_interface[a2b0c3829ae2eb7d]::util::run_in_thread_pool_with_globals<rustc_interface[a2b0c3829ae2eb7d]::interface::run_compiler<(), rustc_driver_impl[4b320e172352ba9d]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1}::{closure#0}>, ()>
                               at /home/matthias/vcs/github/rust/library/std/src/panic.rs:359:14
 212:     0x74f2f3260ae3 - <std[f60f9d482cb5fed2]::thread::Builder>::spawn_unchecked_::<rustc_interface[a2b0c3829ae2eb7d]::util::run_in_thread_with_globals<rustc_interface[a2b0c3829ae2eb7d]::util::run_in_thread_pool_with_globals<rustc_interface[a2b0c3829ae2eb7d]::interface::run_compiler<(), rustc_driver_impl[4b320e172352ba9d]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1}
                               at /home/matthias/vcs/github/rust/library/std/src/thread/mod.rs:557:30
 213:     0x74f2f3260ae3 - <<std[f60f9d482cb5fed2]::thread::Builder>::spawn_unchecked_<rustc_interface[a2b0c3829ae2eb7d]::util::run_in_thread_with_globals<rustc_interface[a2b0c3829ae2eb7d]::util::run_in_thread_pool_with_globals<rustc_interface[a2b0c3829ae2eb7d]::interface::run_compiler<(), rustc_driver_impl[4b320e172352ba9d]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[3433a92f17b11c25]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
                               at /home/matthias/vcs/github/rust/library/core/src/ops/function.rs:250:5
 214:     0x74f2f73a4f0d - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::haf7167fcfa2e41b1
                               at /home/matthias/vcs/github/rust/library/alloc/src/boxed.rs:1966:9
 215:     0x74f2f73a4f0d - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h2b0663be4b750e30
                               at /home/matthias/vcs/github/rust/library/alloc/src/boxed.rs:1966:9
 216:     0x74f2f7370def - std::sys::pal::unix::thread::Thread::new::thread_start::h110d9832889fbe0d
                               at /home/matthias/vcs/github/rust/library/std/src/sys/pal/unix/thread.rs:114:17
 217:     0x74f2f24a370a - <unknown>
 218:     0x74f2f2527aac - <unknown>
 219:                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.88.0-dev running on x86_64-unknown-linux-gnu

note: compiler flags: -Z incremental-verify-ich=yes -C incremental=[REDACTED] -C debuginfo=2 -C link-dead-code=true -Z validate-mir

query stack during panic:
#0 [typeck] type-checking `main`
#1 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 1 previous error


@rustbot label +F-return_type_notation

Metadata

Metadata

Labels

C-bugCategory: This is a bug.F-return_type_notation`#[feature(return_type_notation)]`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