-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
C-bugCategory: This is a bug.Category: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.This issue may need triage. Remove it if it has been sufficiently triaged.
Description
auto-reduced (treereduce-rust):
struct ActuallySuper;
trait Super<Q> {
type Assoc;
}
trait Dyn {}
impl<T, U> Dyn for dyn Foo<T, U> + '_ {}
trait Foo<T, U>: Super<ActuallySuper, Assoc = T>
where
<Self as Mirror>::Assoc: Super,
{
fn transmute(&self, t: T) -> <Self as Super>::Assoc;
}
trait Mirror {
type Assoc: ?Sized;
}
impl<T: Super<ActuallySuper, Assoc = T>> Mirror for T {}
original code
original:
use core::marker::PhantomData;
fn transmute<T, U>(t: T) -> U {
(&PhantomData::<T> as &dyn Foo<T, U>).transmute(t)
}
struct ActuallySuper;
struct NotActuallySuper;
trait Super<Q> {
type Assoc;
}
trait Dyn {
type Out;
}
impl<T, U> Dyn for dyn Foo<T, U> + '_ {
type Out = U;
}
impl<S: Dyn<Out = U> + ?Sized, U> Super<NotActuallySuper> for S {
type Assoc = U;
}
trait Foo<T, U>: Super<ActuallySuper, Assoc = T> where <Self as Mirror>::Assoc: Super<NotActuallySuper> {
fn transmute(&self, t: T) -> <Self as Super<NotActuallySuper>>::Assoc;
}
trait Mirror {
type Assoc: ?Sized;
}
impl<T: Super<ActuallySuper, Assoc = T>> Mirror for T {
type Assoc = T;
}
impl<T, U> Foo<T, U> for PhantomData<T> {
fn transmute(&self, t: T) -> T {
t
}
}
impl<T> Super<ActuallySuper> for PhantomData<T> {
type Assoc = T;
}
impl<T> Super<NotActuallySuper> for PhantomData<T> {
type Assoc = T;
}
fn main() {
let x = String::from("hello, world");
let s = transmute::<&str, &'static str>(x.as_str());
drop(x);
println!("> {s}");
}
Version information
rustc 1.91.0-nightly (f34ba774c 2025-08-03)
binary: rustc
commit-hash: f34ba774c78ea32b7c40598b8ad23e75cdac42a6
commit-date: 2025-08-03
host: x86_64-unknown-linux-gnu
release: 1.91.0-nightly
LLVM version: 20.1.8
Possibly related line of code:
rust/compiler/rustc_hir_analysis/src/collect/generics_of.rs
Lines 220 to 232 in f34ba77
Node::Synthetic => span_bug!( | |
tcx.def_span(def_id), | |
"synthetic HIR should have its `generics_of` explicitly fed" | |
), | |
_ => span_bug!(tcx.def_span(def_id), "unhandled node {node:?}"), | |
}; | |
enum Defaults { | |
Allowed, | |
// See #36887 | |
FutureCompatDisallowed, |
Command:
/home/matthias/.rustup/toolchains/master/bin/rustc
Program output
error[E0601]: `main` function not found in crate `mvce`
--> /tmp/icemaker_global_tempdir.YividecqGvDC/rustc_testrunner_tmpdir_reporting.xtUMdAxGNOpm/mvce.rs:20:57
|
20 | impl<T: Super<ActuallySuper, Assoc = T>> Mirror for T {}
| ^ consider adding a `main` function to `/tmp/icemaker_global_tempdir.YividecqGvDC/rustc_testrunner_tmpdir_reporting.xtUMdAxGNOpm/mvce.rs`
error[E0107]: missing generics for trait `Super`
--> /tmp/icemaker_global_tempdir.YividecqGvDC/rustc_testrunner_tmpdir_reporting.xtUMdAxGNOpm/mvce.rs:12:30
|
12 | <Self as Mirror>::Assoc: Super,
| ^^^^^ expected 1 generic argument
|
note: trait defined here, with 1 generic parameter: `Q`
--> /tmp/icemaker_global_tempdir.YividecqGvDC/rustc_testrunner_tmpdir_reporting.xtUMdAxGNOpm/mvce.rs:3:7
|
3 | trait Super<Q> {
| ^^^^^ -
help: add missing generic argument
|
12 | <Self as Mirror>::Assoc: Super<Q>,
| +++
error[E0107]: missing generics for trait `Super`
--> /tmp/icemaker_global_tempdir.YividecqGvDC/rustc_testrunner_tmpdir_reporting.xtUMdAxGNOpm/mvce.rs:14:43
|
14 | fn transmute(&self, t: T) -> <Self as Super>::Assoc;
| ^^^^^ expected 1 generic argument
|
note: trait defined here, with 1 generic parameter: `Q`
--> /tmp/icemaker_global_tempdir.YividecqGvDC/rustc_testrunner_tmpdir_reporting.xtUMdAxGNOpm/mvce.rs:3:7
|
3 | trait Super<Q> {
| ^^^^^ -
help: add missing generic argument
|
14 | fn transmute(&self, t: T) -> <Self as Super<Q>>::Assoc;
| +++
error: internal compiler error: compiler/rustc_hir_analysis/src/collect/generics_of.rs:226:14: unhandled node Crate(Mod { spans: ModSpans { inner_span: /tmp/icemaker_global_tempdir.YividecqGvDC/rustc_testrunner_tmpdir_reporting.xtUMdAxGNOpm/mvce.rs:1:1: 20:57 (#0), inject_use_span: no-___location (#0) }, item_ids: [ItemId { owner_id: DefId(0:1 ~ mvce[718f]::std) }, ItemId { owner_id: DefId(0:2 ~ mvce[718f]::{use#0}) }, ItemId { owner_id: DefId(0:3 ~ mvce[718f]::ActuallySuper) }, ItemId { owner_id: DefId(0:5 ~ mvce[718f]::Super) }, ItemId { owner_id: DefId(0:8 ~ mvce[718f]::Dyn) }, ItemId { owner_id: DefId(0:9 ~ mvce[718f]::{impl#0}) }, ItemId { owner_id: DefId(0:12 ~ mvce[718f]::Foo) }, ItemId { owner_id: DefId(0:16 ~ mvce[718f]::Mirror) }, ItemId { owner_id: DefId(0:18 ~ mvce[718f]::{impl#1}) }] })
--> /tmp/icemaker_global_tempdir.YividecqGvDC/rustc_testrunner_tmpdir_reporting.xtUMdAxGNOpm/mvce.rs:1:1
|
1 | / struct ActuallySuper;
2 | |
3 | | trait Super<Q> {
4 | | type Assoc;
... |
20 | | impl<T: Super<ActuallySuper, Assoc = T>> Mirror for T {}
| |________________________________________________________^
thread 'rustc' panicked at compiler/rustc_hir_analysis/src/collect/generics_of.rs:226:14:
Box<dyn Any>
stack backtrace:
0: 0x7effbd80a223 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::he94d81f4cc76bf03
1: 0x7effbe002d77 - core::fmt::write::h255510a3ffb8d55d
2: 0x7effbd7ffe03 - std::io::Write::write_fmt::hf8ded1300f0b71a8
3: 0x7effbd80a082 - std::sys::backtrace::BacktraceLock::print::h3bdc2b992c7e0515
4: 0x7effbd80db27 - std::panicking::default_hook::{{closure}}::h876682ce5f8046c9
5: 0x7effbd80d68b - std::panicking::default_hook::h708aafadea70e31d
6: 0x7effbc87eac3 - std[a2e6032cce42d97f]::panicking::update_hook::<alloc[ff7d08515ebedc7]::boxed::Box<rustc_driver_impl[de6ab808e8043f3f]::install_ice_hook::{closure#1}>>::{closure#0}
7: 0x7effbd80e36e - std::panicking::rust_panic_with_hook::hbc7edc3b462870f0
8: 0x7effbc8b7f91 - std[a2e6032cce42d97f]::panicking::begin_panic::<rustc_errors[3211728c3614e99e]::ExplicitBug>::{closure#0}
9: 0x7effbc8acf26 - std[a2e6032cce42d97f]::sys::backtrace::__rust_end_short_backtrace::<std[a2e6032cce42d97f]::panicking::begin_panic<rustc_errors[3211728c3614e99e]::ExplicitBug>::{closure#0}, !>
10: 0x7effbc8acdb7 - std[a2e6032cce42d97f]::panicking::begin_panic::<rustc_errors[3211728c3614e99e]::ExplicitBug>
11: 0x7effbc8c1c31 - <rustc_errors[3211728c3614e99e]::diagnostic::BugAbort as rustc_errors[3211728c3614e99e]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
12: 0x7effbce3bb6c - <rustc_errors[3211728c3614e99e]::DiagCtxtHandle>::span_bug::<rustc_span[91be5049b842f401]::span_encoding::Span, alloc[ff7d08515ebedc7]::string::String>
13: 0x7effbced0757 - rustc_middle[e3248139c571040]::util::bug::opt_span_bug_fmt::<rustc_span[91be5049b842f401]::span_encoding::Span>::{closure#0}
14: 0x7effbceafefa - rustc_middle[e3248139c571040]::ty::context::tls::with_opt::<rustc_middle[e3248139c571040]::util::bug::opt_span_bug_fmt<rustc_span[91be5049b842f401]::span_encoding::Span>::{closure#0}, !>::{closure#0}
15: 0x7effbceafd6b - rustc_middle[e3248139c571040]::ty::context::tls::with_context_opt::<rustc_middle[e3248139c571040]::ty::context::tls::with_opt<rustc_middle[e3248139c571040]::util::bug::opt_span_bug_fmt<rustc_span[91be5049b842f401]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
16: 0x7effbad16ac7 - rustc_middle[e3248139c571040]::util::bug::span_bug_fmt::<rustc_span[91be5049b842f401]::span_encoding::Span>
17: 0x7effbaff39f0 - rustc_hir_analysis[7c52b57a28bd59dd]::collect::generics_of::generics_of
18: 0x7effbe017de9 - rustc_query_impl[3fd9c6a4ad24362]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[3fd9c6a4ad24362]::query_impl::generics_of::dynamic_query::{closure#2}::{closure#0}, rustc_middle[e3248139c571040]::query::erase::Erased<[u8; 8usize]>>
19: 0x7effbe0184e5 - rustc_query_system[7e37a266f75ec588]::query::plumbing::try_execute_query::<rustc_query_impl[3fd9c6a4ad24362]::DynamicConfig<rustc_query_system[7e37a266f75ec588]::query::caches::DefIdCache<rustc_middle[e3248139c571040]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[3fd9c6a4ad24362]::plumbing::QueryCtxt, false>
20: 0x7effbe01821d - rustc_query_impl[3fd9c6a4ad24362]::query_impl::generics_of::get_query_non_incr::__rust_end_short_backtrace
21: 0x7effbd5e3b7e - <rustc_trait_selection[2c4c2ad9bb59d34]::error_reporting::TypeErrCtxt>::note_and_explain_type_err
22: 0x7effbc1a16c8 - <rustc_trait_selection[2c4c2ad9bb59d34]::error_reporting::TypeErrCtxt>::note_type_err
23: 0x7effbd68689e - <rustc_trait_selection[2c4c2ad9bb59d34]::error_reporting::TypeErrCtxt>::report_fulfillment_errors
24: 0x7effbeae7213 - rustc_trait_selection[2c4c2ad9bb59d34]::traits::do_normalize_predicates
25: 0x7effbe83eba5 - rustc_trait_selection[2c4c2ad9bb59d34]::traits::normalize_param_env_or_error
26: 0x7effbe82545f - rustc_trait_selection[2c4c2ad9bb59d34]::traits::dyn_compatibility::virtual_call_violations_for_method
27: 0x7effbf07ce9a - rustc_trait_selection[2c4c2ad9bb59d34]::traits::dyn_compatibility::dyn_compatibility_violations_for_assoc_item
28: 0x7effbf07cb2e - <core[606ee596359a9bc5]::iter::adapters::flatten::FlatMap<core[606ee596359a9bc5]::iter::adapters::map::Map<core[606ee596359a9bc5]::iter::adapters::map::Map<core[606ee596359a9bc5]::slice::iter::Iter<(core[606ee596359a9bc5]::option::Option<rustc_span[91be5049b842f401]::symbol::Symbol>, rustc_middle[e3248139c571040]::ty::assoc::AssocItem)>, <rustc_data_structures[a57f2e4fad990afb]::sorted_map::index_map::SortedIndexMultiMap<u32, core[606ee596359a9bc5]::option::Option<rustc_span[91be5049b842f401]::symbol::Symbol>, rustc_middle[e3248139c571040]::ty::assoc::AssocItem>>::iter::{closure#0}>, <rustc_middle[e3248139c571040]::ty::assoc::AssocItems>::in_definition_order::{closure#0}>, alloc[ff7d08515ebedc7]::vec::Vec<rustc_middle[e3248139c571040]::traits::DynCompatibilityViolation>, rustc_trait_selection[2c4c2ad9bb59d34]::traits::dyn_compatibility::dyn_compatibility_violations_for_trait::{closure#0}::{closure#0}> as core[606ee596359a9bc5]::iter::traits::iterator::Iterator>::next
29: 0x7effbf07b105 - <core[606ee596359a9bc5]::iter::adapters::GenericShunt<core[606ee596359a9bc5]::iter::adapters::map::Map<core[606ee596359a9bc5]::iter::adapters::flatten::FlatMap<core[606ee596359a9bc5]::iter::sources::from_fn::FromFn<rustc_type_ir[d433dbb56c274b65]::elaborate::supertrait_def_ids<rustc_middle[e3248139c571040]::ty::context::TyCtxt>::{closure#0}>, alloc[ff7d08515ebedc7]::vec::Vec<rustc_middle[e3248139c571040]::traits::DynCompatibilityViolation>, rustc_trait_selection[2c4c2ad9bb59d34]::traits::dyn_compatibility::dyn_compatibility_violations::{closure#0}>, core[606ee596359a9bc5]::result::Result<rustc_middle[e3248139c571040]::traits::DynCompatibilityViolation, !>::Ok>, core[606ee596359a9bc5]::result::Result<core[606ee596359a9bc5]::convert::Infallible, !>> as core[606ee596359a9bc5]::iter::traits::iterator::Iterator>::next
30: 0x7effbf07a47d - rustc_trait_selection[2c4c2ad9bb59d34]::traits::dyn_compatibility::dyn_compatibility_violations
31: 0x7effbf07a370 - rustc_query_impl[3fd9c6a4ad24362]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[3fd9c6a4ad24362]::query_impl::dyn_compatibility_violations::dynamic_query::{closure#2}::{closure#0}, rustc_middle[e3248139c571040]::query::erase::Erased<[u8; 16usize]>>
32: 0x7effbf07a357 - <rustc_query_impl[3fd9c6a4ad24362]::query_impl::dyn_compatibility_violations::dynamic_query::{closure#2} as core[606ee596359a9bc5]::ops::function::FnOnce<(rustc_middle[e3248139c571040]::ty::context::TyCtxt, rustc_span[91be5049b842f401]::def_id::DefId)>>::call_once
33: 0x7effbe19493b - rustc_query_system[7e37a266f75ec588]::query::plumbing::try_execute_query::<rustc_query_impl[3fd9c6a4ad24362]::DynamicConfig<rustc_query_system[7e37a266f75ec588]::query::caches::DefIdCache<rustc_middle[e3248139c571040]::query::erase::Erased<[u8; 16usize]>>, false, false, false>, rustc_query_impl[3fd9c6a4ad24362]::plumbing::QueryCtxt, false>
34: 0x7effbf08dfec - rustc_query_impl[3fd9c6a4ad24362]::query_impl::dyn_compatibility_violations::get_query_non_incr::__rust_end_short_backtrace
35: 0x7effbf08e0b8 - rustc_trait_selection[2c4c2ad9bb59d34]::traits::dyn_compatibility::is_dyn_compatible
36: 0x7effbf08e021 - rustc_query_impl[3fd9c6a4ad24362]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[3fd9c6a4ad24362]::query_impl::is_dyn_compatible::dynamic_query::{closure#2}::{closure#0}, rustc_middle[e3248139c571040]::query::erase::Erased<[u8; 1usize]>>
37: 0x7effbe72f950 - rustc_query_system[7e37a266f75ec588]::query::plumbing::try_execute_query::<rustc_query_impl[3fd9c6a4ad24362]::DynamicConfig<rustc_query_system[7e37a266f75ec588]::query::caches::DefIdCache<rustc_middle[e3248139c571040]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[3fd9c6a4ad24362]::plumbing::QueryCtxt, false>
38: 0x7effbe732658 - rustc_query_impl[3fd9c6a4ad24362]::query_impl::is_dyn_compatible::get_query_non_incr::__rust_end_short_backtrace
39: 0x7effbe1f6df9 - rustc_hir_analysis[7c52b57a28bd59dd]::coherence::coherent_trait
40: 0x7effbe1f5e0b - rustc_query_impl[3fd9c6a4ad24362]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[3fd9c6a4ad24362]::query_impl::coherent_trait::dynamic_query::{closure#2}::{closure#0}, rustc_middle[e3248139c571040]::query::erase::Erased<[u8; 1usize]>>
41: 0x7effbe72f950 - rustc_query_system[7e37a266f75ec588]::query::plumbing::try_execute_query::<rustc_query_impl[3fd9c6a4ad24362]::DynamicConfig<rustc_query_system[7e37a266f75ec588]::query::caches::DefIdCache<rustc_middle[e3248139c571040]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[3fd9c6a4ad24362]::plumbing::QueryCtxt, false>
42: 0x7effbe72e724 - rustc_query_impl[3fd9c6a4ad24362]::query_impl::coherent_trait::get_query_non_incr::__rust_end_short_backtrace
43: 0x7effbe9162ed - rustc_hir_analysis[7c52b57a28bd59dd]::check::check::check_item_type
44: 0x7effbe90ff1b - rustc_hir_analysis[7c52b57a28bd59dd]::check::wfcheck::check_well_formed
45: 0x7effbe90fefd - rustc_query_impl[3fd9c6a4ad24362]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[3fd9c6a4ad24362]::query_impl::check_well_formed::dynamic_query::{closure#2}::{closure#0}, rustc_middle[e3248139c571040]::query::erase::Erased<[u8; 1usize]>>
46: 0x7effbe90f732 - rustc_query_system[7e37a266f75ec588]::query::plumbing::try_execute_query::<rustc_query_impl[3fd9c6a4ad24362]::DynamicConfig<rustc_data_structures[a57f2e4fad990afb]::vec_cache::VecCache<rustc_span[91be5049b842f401]::def_id::LocalDefId, rustc_middle[e3248139c571040]::query::erase::Erased<[u8; 1usize]>, rustc_query_system[7e37a266f75ec588]::dep_graph::graph::DepNodeIndex>, false, false, false>, rustc_query_impl[3fd9c6a4ad24362]::plumbing::QueryCtxt, false>
47: 0x7effbe90f256 - rustc_query_impl[3fd9c6a4ad24362]::query_impl::check_well_formed::get_query_non_incr::__rust_end_short_backtrace
48: 0x7effbe90bf23 - rustc_hir_analysis[7c52b57a28bd59dd]::check::wfcheck::check_type_wf
49: 0x7effbe90be1d - rustc_query_impl[3fd9c6a4ad24362]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[3fd9c6a4ad24362]::query_impl::check_type_wf::dynamic_query::{closure#2}::{closure#0}, rustc_middle[e3248139c571040]::query::erase::Erased<[u8; 1usize]>>
50: 0x7effbf10ac7c - rustc_query_system[7e37a266f75ec588]::query::plumbing::try_execute_query::<rustc_query_impl[3fd9c6a4ad24362]::DynamicConfig<rustc_query_system[7e37a266f75ec588]::query::caches::SingleCache<rustc_middle[e3248139c571040]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[3fd9c6a4ad24362]::plumbing::QueryCtxt, false>
51: 0x7effbf10aa76 - rustc_query_impl[3fd9c6a4ad24362]::query_impl::check_type_wf::get_query_non_incr::__rust_end_short_backtrace
52: 0x7effbe580639 - rustc_hir_analysis[7c52b57a28bd59dd]::check_crate
53: 0x7effbe585384 - rustc_interface[373d4675362b8f62]::passes::analysis
54: 0x7effbe585047 - rustc_query_impl[3fd9c6a4ad24362]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[3fd9c6a4ad24362]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[e3248139c571040]::query::erase::Erased<[u8; 0usize]>>
55: 0x7effbf10b9c8 - rustc_query_system[7e37a266f75ec588]::query::plumbing::try_execute_query::<rustc_query_impl[3fd9c6a4ad24362]::DynamicConfig<rustc_query_system[7e37a266f75ec588]::query::caches::SingleCache<rustc_middle[e3248139c571040]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[3fd9c6a4ad24362]::plumbing::QueryCtxt, false>
56: 0x7effbf10b636 - rustc_query_impl[3fd9c6a4ad24362]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
57: 0x7effbf36724b - rustc_interface[373d4675362b8f62]::passes::create_and_enter_global_ctxt::<core[606ee596359a9bc5]::option::Option<rustc_interface[373d4675362b8f62]::queries::Linker>, rustc_driver_impl[de6ab808e8043f3f]::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}
58: 0x7effbf356e71 - rustc_interface[373d4675362b8f62]::interface::run_compiler::<(), rustc_driver_impl[de6ab808e8043f3f]::run_compiler::{closure#0}>::{closure#1}
59: 0x7effbf1b3241 - std[a2e6032cce42d97f]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[373d4675362b8f62]::util::run_in_thread_with_globals<rustc_interface[373d4675362b8f62]::util::run_in_thread_pool_with_globals<rustc_interface[373d4675362b8f62]::interface::run_compiler<(), rustc_driver_impl[de6ab808e8043f3f]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
60: 0x7effbf1b2f22 - <<std[a2e6032cce42d97f]::thread::Builder>::spawn_unchecked_<rustc_interface[373d4675362b8f62]::util::run_in_thread_with_globals<rustc_interface[373d4675362b8f62]::util::run_in_thread_pool_with_globals<rustc_interface[373d4675362b8f62]::interface::run_compiler<(), rustc_driver_impl[de6ab808e8043f3f]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[606ee596359a9bc5]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
61: 0x7effbf1b9085 - std::sys::pal::unix::thread::Thread::new::thread_start::hf6a510012528f331
62: 0x7effb8aa57eb - <unknown>
63: 0x7effb8b2918c - <unknown>
64: 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 make sure that you have updated to the latest nightly
note: rustc 1.91.0-nightly (f34ba774c 2025-08-03) running on x86_64-unknown-linux-gnu
query stack during panic:
#0 [generics_of] computing generics of ``
#1 [dyn_compatibility_violations] determining dyn-compatibility of trait `Foo`
#2 [is_dyn_compatible] checking if trait `Foo` is dyn-compatible
#3 [coherent_trait] coherence checking all impls of trait `Dyn`
#4 [check_well_formed] checking that `<impl at /tmp/icemaker_global_tempdir.YividecqGvDC/rustc_testrunner_tmpdir_reporting.xtUMdAxGNOpm/mvce.rs:8:1: 8:38>` is well-formed
#5 [check_type_wf] checking that types are well-formed
#6 [analysis] running analysis passes on this crate
end of query stack
error[E0271]: type mismatch resolving `<Self as Super<ActuallySuper>>::Assoc == Self`
--> /tmp/icemaker_global_tempdir.YividecqGvDC/rustc_testrunner_tmpdir_reporting.xtUMdAxGNOpm/mvce.rs:10:1
|
10 | trait Foo<T, U>: Super<ActuallySuper, Assoc = T>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected type parameter `Self`, found type parameter `T`
|
= note: expected type parameter `Self`
found type parameter `T`
= note: a type parameter was expected, but a different one was found; you might be missing a type parameter or trait bound
= note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters
note: required for `Self` to implement `Mirror`
--> /tmp/icemaker_global_tempdir.YividecqGvDC/rustc_testrunner_tmpdir_reporting.xtUMdAxGNOpm/mvce.rs:20:42
|
20 | impl<T: Super<ActuallySuper, Assoc = T>> Mirror for T {}
| --------- ^^^^^^ ^
| |
| unsatisfied trait bound introduced here
error[E0277]: the size for values of type `Self` cannot be known at compilation time
--> /tmp/icemaker_global_tempdir.YividecqGvDC/rustc_testrunner_tmpdir_reporting.xtUMdAxGNOpm/mvce.rs:10:1
|
10 | trait Foo<T, U>: Super<ActuallySuper, Assoc = T>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
note: required for `Self` to implement `Mirror`
--> /tmp/icemaker_global_tempdir.YividecqGvDC/rustc_testrunner_tmpdir_reporting.xtUMdAxGNOpm/mvce.rs:20:42
|
20 | impl<T: Super<ActuallySuper, Assoc = T>> Mirror for T {}
| - ^^^^^^ ^
| |
| unsatisfied trait bound introduced here
help: consider further restricting `Self`
|
10 | trait Foo<T, U>: Super<ActuallySuper, Assoc = T> + Sized
| +++++++
error[E0271]: type mismatch resolving `<Self as Super<ActuallySuper>>::Assoc == Self`
--> /tmp/icemaker_global_tempdir.YividecqGvDC/rustc_testrunner_tmpdir_reporting.xtUMdAxGNOpm/mvce.rs:12:30
|
10 | trait Foo<T, U>: Super<ActuallySuper, Assoc = T>
| ------------------------------------------------
| | |
| | found type parameter
| expected type parameter
11 | where
12 | <Self as Mirror>::Assoc: Super,
| ^^^^^ expected type parameter `Self`, found type parameter `T`
|
= note: expected type parameter `Self`
found type parameter `T`
= note: a type parameter was expected, but a different one was found; you might be missing a type parameter or trait bound
= note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters
note: required for `Self` to implement `Mirror`
--> /tmp/icemaker_global_tempdir.YividecqGvDC/rustc_testrunner_tmpdir_reporting.xtUMdAxGNOpm/mvce.rs:20:42
|
20 | impl<T: Super<ActuallySuper, Assoc = T>> Mirror for T {}
| --------- ^^^^^^ ^
| |
| unsatisfied trait bound introduced here
error[E0277]: the size for values of type `Self` cannot be known at compilation time
--> /tmp/icemaker_global_tempdir.YividecqGvDC/rustc_testrunner_tmpdir_reporting.xtUMdAxGNOpm/mvce.rs:12:30
|
12 | <Self as Mirror>::Assoc: Super,
| ^^^^^ doesn't have a size known at compile-time
|
note: required for `Self` to implement `Mirror`
--> /tmp/icemaker_global_tempdir.YividecqGvDC/rustc_testrunner_tmpdir_reporting.xtUMdAxGNOpm/mvce.rs:20:42
|
20 | impl<T: Super<ActuallySuper, Assoc = T>> Mirror for T {}
| - ^^^^^^ ^
| |
| unsatisfied trait bound introduced here
help: consider further restricting `Self`
|
10 | trait Foo<T, U>: Super<ActuallySuper, Assoc = T> + Sized
| +++++++
error[E0046]: not all trait items implemented, missing: `Assoc`
--> /tmp/icemaker_global_tempdir.YividecqGvDC/rustc_testrunner_tmpdir_reporting.xtUMdAxGNOpm/mvce.rs:20:1
|
18 | type Assoc: ?Sized;
| ------------------ `Assoc` from trait
19 | }
20 | impl<T: Super<ActuallySuper, Assoc = T>> Mirror for T {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `Assoc` in implementation
error: aborting due to 9 previous errors
Some errors have detailed explanations: E0046, E0107, E0271, E0277, E0601.
For more information about an error, try `rustc --explain E0046`.
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.This issue may need triage. Remove it if it has been sufficiently triaged.