-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
projecting to assoc type of supertrait that is implemented differently for trait object goes wrong #131891
Copy link
Copy link
Closed
Labels
A-associated-itemsArea: Associated items (types, constants & functions)Area: Associated items (types, constants & functions)A-dyn-traitArea: trait objects, vtable layoutArea: trait objects, vtable layoutC-bugCategory: This is a bug.Category: This is a bug.F-ptr_metadata`#![feature(ptr_metadata)]``#![feature(ptr_metadata)]`I-unsoundIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessT-typesRelevant to the types team, which will review and decide on the PR/issue.Relevant to the types team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-associated-itemsArea: Associated items (types, constants & functions)Area: Associated items (types, constants & functions)A-dyn-traitArea: trait objects, vtable layoutArea: trait objects, vtable layoutC-bugCategory: This is a bug.Category: This is a bug.F-ptr_metadata`#![feature(ptr_metadata)]``#![feature(ptr_metadata)]`I-unsoundIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessT-typesRelevant to the types team, which will review and decide on the PR/issue.Relevant to the types team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
I tried this code: playground
I expected to see this happen: The type of
mis()(orTraitis dyn incompatible).Instead, this happened: The type of
misDynMetadata<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