projecting to assoc type of supertrait that is implemented differently for trait object goes wrong #131891
Labels
A-associated-items
Area: Associated items (types, constants & functions)
A-trait-objects
Area: trait objects, vtable layout
C-bug
Category: This is a bug.
I-unsound
Issue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/Soundness
requires-nightly
This issue requires a nightly compiler in some way.
T-types
Relevant to the types team, which will review and decide on the PR/issue.
I tried this code: playground
I expected to see this happen: The type of
m
is()
(orTrait
is dyn incompatible).Instead, this happened: The type of
m
isDynMetadata<dyn Trait<Metadata = ()>>
.Presumably this affects all traits with
#[rustc_deny_explicit_impl(implement_via_object = false)]
and associated types.Miri does report UB for this code:
Meta
playground nightly
@rustbot label A-trait-objects A-associated-items T-types I-unsound requires-nightly -needs-triage
The text was updated successfully, but these errors were encountered: