Closed
Description
Code
struct Hello;
trait Foo {
type Data: i32;
}
impl Hello::What {}
With natrix = "1.0.0"
as a dependency in the project.
Meta
rustc --version --verbose
:
rustc 1.88.0-nightly (077cedc2a 2025-04-19)
binary: rustc
commit-hash: 077cedc2afa8ac0b727b7a6cbe012940ba228deb
commit-date: 2025-04-19
host: x86_64-unknown-linux-gnu
release: 1.88.0-nightly
LLVM version: 20.1.2
Error Output
thread 'rustc' panicked at compiler/rustc_middle/src/ty/assoc.rs:43:25:
name of non-Rpitit assoc item
Backtrace
error[E0404]: expected trait, found builtin type `i32`
--> src/lib.rs:4:16
|
4 | type Data: i32;
| ^^^ not a trait
thread 'rustc' panicked at compiler/rustc_middle/src/ty/assoc.rs:43:25:
name of non-Rpitit assoc item
stack backtrace:
0: 0x7f74440c8db3 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::hfaf8ed89211e6e1f
1: 0x7f7444805b07 - core::fmt::write::h2da0a0da460f5037
2: 0x7f7445ca2491 - std::io::Write::write_fmt::h4507b1cbf0ceb6dd
3: 0x7f74440c8c12 - std::sys::backtrace::BacktraceLock::print::h41d0ebab53bd7768
4: 0x7f74440cc58a - std::panicking::default_hook::{{closure}}::h4431b1eedebd3951
5: 0x7f74440cc10f - std::panicking::default_hook::h897735e88042dbbc
6: 0x7f7443148b93 - std[cfbc79774844d935]::panicking::update_hook::<alloc[9883a7069eddc933]::boxed::Box<rustc_driver_impl[4168e4092cb5e4c5]::install_ice_hook::{closure#1}>>::{closure#0}
7: 0x7f74440cce03 - std::panicking::rust_panic_with_hook::hdfd38210fc20e43b
8: 0x7f74440ccafa - std::panicking::begin_panic_handler::{{closure}}::hc72899d25392f7bc
9: 0x7f74440c9279 - std::sys::backtrace::__rust_end_short_backtrace::hd11e673a53554045
10: 0x7f74440cc7bd - __rustc[6dc022cbd14ae54d]::rust_begin_unwind
11: 0x7f7440a870c0 - core::panicking::panic_fmt::h88a862c704395f75
12: 0x7f7441e3b3cb - core::option::expect_failed::h23bc92f892e77f28
13: 0x7f74461191b3 - <rustc_middle[dbe9dbab0f97c09d]::ty::assoc::AssocItem>::ident.cold
14: 0x7f7443298901 - <core[8f5efdd3e17dd637]::iter::adapters::flatten::FlattenCompat<_, _> as core[8f5efdd3e17dd637]::iter::traits::iterator::Iterator>::try_fold::flatten::<core[8f5efdd3e17dd637]::iter::adapters::copied::Copied<core[8f5efdd3e17dd637]::slice::iter::Iter<rustc_span[cb8fd5489eeaf0e3]::def_id::DefId>>, (), core[8f5efdd3e17dd637]::ops::control_flow::ControlFlow<rustc_span[cb8fd5489eeaf0e3]::def_id::DefId>, core[8f5efdd3e17dd637]::iter::traits::iterator::Iterator::find::check<rustc_span[cb8fd5489eeaf0e3]::def_id::DefId, &mut <dyn rustc_hir_analysis[98c22e4b0d6d5cdc]::hir_ty_lowering::HirTyLowerer>::probe_traits_that_match_assoc_ty::{closure#0}>::{closure#0}>::{closure#0}
15: 0x7f74432c885f - <core[8f5efdd3e17dd637]::iter::adapters::map::Map<core[8f5efdd3e17dd637]::iter::adapters::filter::Filter<core[8f5efdd3e17dd637]::iter::adapters::flatten::FlatMap<core[8f5efdd3e17dd637]::iter::adapters::chain::Chain<core[8f5efdd3e17dd637]::iter::sources::once::Once<rustc_span[cb8fd5489eeaf0e3]::def_id::CrateNum>, core[8f5efdd3e17dd637]::iter::adapters::copied::Copied<core[8f5efdd3e17dd637]::slice::iter::Iter<rustc_span[cb8fd5489eeaf0e3]::def_id::CrateNum>>>, core[8f5efdd3e17dd637]::iter::adapters::copied::Copied<core[8f5efdd3e17dd637]::slice::iter::Iter<rustc_span[cb8fd5489eeaf0e3]::def_id::DefId>>, <rustc_middle[dbe9dbab0f97c09d]::ty::context::TyCtxt>::all_traits::{closure#0}>, <dyn rustc_hir_analysis[98c22e4b0d6d5cdc]::hir_ty_lowering::HirTyLowerer>::probe_traits_that_match_assoc_ty::{closure#0}>, <dyn rustc_hir_analysis[98c22e4b0d6d5cdc]::hir_ty_lowering::HirTyLowerer>::probe_traits_that_match_assoc_ty::{closure#1}> as core[8f5efdd3e17dd637]::iter::traits::iterator::Iterator>::next
16: 0x7f7443288114 - <core[8f5efdd3e17dd637]::iter::adapters::map::Map<core[8f5efdd3e17dd637]::iter::adapters::filter::Filter<core[8f5efdd3e17dd637]::iter::adapters::flatten::FlatMap<core[8f5efdd3e17dd637]::iter::adapters::chain::Chain<core[8f5efdd3e17dd637]::iter::sources::once::Once<rustc_span[cb8fd5489eeaf0e3]::def_id::CrateNum>, core[8f5efdd3e17dd637]::iter::adapters::copied::Copied<core[8f5efdd3e17dd637]::slice::iter::Iter<rustc_span[cb8fd5489eeaf0e3]::def_id::CrateNum>>>, core[8f5efdd3e17dd637]::iter::adapters::copied::Copied<core[8f5efdd3e17dd637]::slice::iter::Iter<rustc_span[cb8fd5489eeaf0e3]::def_id::DefId>>, <rustc_middle[dbe9dbab0f97c09d]::ty::context::TyCtxt>::all_traits::{closure#0}>, <dyn rustc_hir_analysis[98c22e4b0d6d5cdc]::hir_ty_lowering::HirTyLowerer>::probe_traits_that_match_assoc_ty::{closure#0}>, <dyn rustc_hir_analysis[98c22e4b0d6d5cdc]::hir_ty_lowering::HirTyLowerer>::probe_traits_that_match_assoc_ty::{closure#1}> as core[8f5efdd3e17dd637]::iter::traits::iterator::Iterator>::collect::<alloc[9883a7069eddc933]::vec::Vec<alloc[9883a7069eddc933]::string::String>>
17: 0x7f744557da32 - <dyn rustc_hir_analysis[98c22e4b0d6d5cdc]::hir_ty_lowering::HirTyLowerer>::lower_assoc_path_shared::{closure#0}
18: 0x7f7445579000 - <dyn rustc_hir_analysis[98c22e4b0d6d5cdc]::hir_ty_lowering::HirTyLowerer>::lower_assoc_path_ty
19: 0x7f7444ae21d0 - <dyn rustc_hir_analysis[98c22e4b0d6d5cdc]::hir_ty_lowering::HirTyLowerer>::lower_ty
20: 0x7f7444aca94b - rustc_hir_analysis[98c22e4b0d6d5cdc]::collect::type_of::type_of
21: 0x7f7444ac9f78 - rustc_query_impl[8687e3a7a5e012fc]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[8687e3a7a5e012fc]::query_impl::type_of::dynamic_query::{closure#2}::{closure#0}, rustc_middle[dbe9dbab0f97c09d]::query::erase::Erased<[u8; 8usize]>>
22: 0x7f7444a708cd - rustc_query_system[aee8ed8ba3f3d4a4]::query::plumbing::try_execute_query::<rustc_query_impl[8687e3a7a5e012fc]::DynamicConfig<rustc_query_system[aee8ed8ba3f3d4a4]::query::caches::DefIdCache<rustc_middle[dbe9dbab0f97c09d]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[8687e3a7a5e012fc]::plumbing::QueryCtxt, true>
23: 0x7f7444a6c77d - rustc_query_impl[8687e3a7a5e012fc]::query_impl::type_of::get_query_incr::__rust_end_short_backtrace
24: 0x7f744514adfd - <rustc_hir_analysis[98c22e4b0d6d5cdc]::collect::CollectItemTypesVisitor as rustc_hir[6df87b3874aa120f]::intravisit::Visitor>::visit_item
25: 0x7f744513e0e3 - rustc_hir_analysis[98c22e4b0d6d5cdc]::check::wfcheck::check_well_formed
26: 0x7f744513deeb - rustc_query_impl[8687e3a7a5e012fc]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[8687e3a7a5e012fc]::query_impl::check_well_formed::dynamic_query::{closure#2}::{closure#0}, rustc_middle[dbe9dbab0f97c09d]::query::erase::Erased<[u8; 1usize]>>
27: 0x7f7444a65dbe - rustc_query_system[aee8ed8ba3f3d4a4]::query::plumbing::try_execute_query::<rustc_query_impl[8687e3a7a5e012fc]::DynamicConfig<rustc_data_structures[a4e62dcbac3a6fff]::vec_cache::VecCache<rustc_span[cb8fd5489eeaf0e3]::def_id::LocalDefId, rustc_middle[dbe9dbab0f97c09d]::query::erase::Erased<[u8; 1usize]>, rustc_query_system[aee8ed8ba3f3d4a4]::dep_graph::graph::DepNodeIndex>, false, false, false>, rustc_query_impl[8687e3a7a5e012fc]::plumbing::QueryCtxt, true>
28: 0x7f7444a6556f - rustc_query_impl[8687e3a7a5e012fc]::query_impl::check_well_formed::get_query_incr::__rust_end_short_backtrace
29: 0x7f74451396e5 - rustc_hir_analysis[98c22e4b0d6d5cdc]::check::wfcheck::check_mod_type_wf
30: 0x7f74451394dd - rustc_query_impl[8687e3a7a5e012fc]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[8687e3a7a5e012fc]::query_impl::check_mod_type_wf::dynamic_query::{closure#2}::{closure#0}, rustc_middle[dbe9dbab0f97c09d]::query::erase::Erased<[u8; 1usize]>>
31: 0x7f74458cf775 - rustc_query_system[aee8ed8ba3f3d4a4]::query::plumbing::try_execute_query::<rustc_query_impl[8687e3a7a5e012fc]::DynamicConfig<rustc_query_system[aee8ed8ba3f3d4a4]::query::caches::DefaultCache<rustc_span[cb8fd5489eeaf0e3]::def_id::LocalModDefId, rustc_middle[dbe9dbab0f97c09d]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[8687e3a7a5e012fc]::plumbing::QueryCtxt, true>
32: 0x7f74458d0240 - rustc_query_impl[8687e3a7a5e012fc]::query_impl::check_mod_type_wf::get_query_incr::__rust_end_short_backtrace
33: 0x7f7444a3dd32 - rustc_hir_analysis[98c22e4b0d6d5cdc]::check_crate
34: 0x7f74451fbef4 - rustc_interface[9462fce10cf7ee10]::passes::run_required_analyses
35: 0x7f744569305e - rustc_interface[9462fce10cf7ee10]::passes::analysis
36: 0x7f744569302d - rustc_query_impl[8687e3a7a5e012fc]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[8687e3a7a5e012fc]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[dbe9dbab0f97c09d]::query::erase::Erased<[u8; 0usize]>>
37: 0x7f7445b1c8fd - rustc_query_system[aee8ed8ba3f3d4a4]::query::plumbing::try_execute_query::<rustc_query_impl[8687e3a7a5e012fc]::DynamicConfig<rustc_query_system[aee8ed8ba3f3d4a4]::query::caches::SingleCache<rustc_middle[dbe9dbab0f97c09d]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[8687e3a7a5e012fc]::plumbing::QueryCtxt, true>
38: 0x7f7445b1c221 - rustc_query_impl[8687e3a7a5e012fc]::query_impl::analysis::get_query_incr::__rust_end_short_backtrace
39: 0x7f74456c20be - rustc_interface[9462fce10cf7ee10]::passes::create_and_enter_global_ctxt::<core[8f5efdd3e17dd637]::option::Option<rustc_interface[9462fce10cf7ee10]::queries::Linker>, rustc_driver_impl[4168e4092cb5e4c5]::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}
40: 0x7f74459188c4 - rustc_interface[9462fce10cf7ee10]::interface::run_compiler::<(), rustc_driver_impl[4168e4092cb5e4c5]::run_compiler::{closure#0}>::{closure#1}
41: 0x7f7445703c68 - std[cfbc79774844d935]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[9462fce10cf7ee10]::util::run_in_thread_with_globals<rustc_interface[9462fce10cf7ee10]::util::run_in_thread_pool_with_globals<rustc_interface[9462fce10cf7ee10]::interface::run_compiler<(), rustc_driver_impl[4168e4092cb5e4c5]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
42: 0x7f74457040b4 - <<std[cfbc79774844d935]::thread::Builder>::spawn_unchecked_<rustc_interface[9462fce10cf7ee10]::util::run_in_thread_with_globals<rustc_interface[9462fce10cf7ee10]::util::run_in_thread_pool_with_globals<rustc_interface[9462fce10cf7ee10]::interface::run_compiler<(), rustc_driver_impl[4168e4092cb5e4c5]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[8f5efdd3e17dd637]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
43: 0x7f74457054b7 - std::sys::pal::unix::thread::Thread::new::thread_start::h924abcfa8ac99dff
44: 0x7f743f6a370a - <unknown>
45: 0x7f743f727aac - <unknown>
46: 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: please attach the file at `/tmp/fail/rustc-ice-2025-04-20T03_08_58-1902919.txt` to your bug report
note: compiler flags: --crate-type lib -C embed-bitcode=no -C debuginfo=2 -C incremental=[REDACTED]
note: some of the compiler flags provided by cargo are hidden
query stack during panic:
#0 [type_of] computing type of `<impl at src/lib.rs:10:1: 10:17>`
#1 [check_well_formed] checking that `<impl at src/lib.rs:10:1: 10:17>` is well-formed
#2 [check_mod_type_wf] checking that types are well-formed in top-level module
#3 [analysis] running analysis passes on this crate
end of query stack
For more information about this error, try `rustc --explain E0404`.
Metadata
Metadata
Assignees
Labels
Category: This is a bug.Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Status: This bug is tracked inside the repo by a `known-bug` test.Status: A Minimal Complete and Verifiable Example has been found for this issueRelevant to the compiler team, which will review and decide on the PR/issue.