-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-dyn-traitArea: trait objects, vtable layoutArea: trait objects, vtable layoutA-trait-systemArea: Trait systemArea: Trait systemC-bugCategory: This is a bug.Category: This is a bug.T-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.
Description
pub trait Trait: Supertrait {}
trait Impossible {}
impl<F: ?Sized + Impossible> Trait for F {}
pub trait Supertrait {}
impl<T: ?Sized + Trait + Impossible> Supertrait for T {}
fn needs_supertrait<T: ?Sized + Supertrait>() {}
fn needs_trait<T: ?Sized + Trait>() {}
fn main() {
needs_trait::<dyn Trait>(); // Comment this and it'll fail
needs_supertrait::<dyn Trait>();
needs_trait::<dyn Trait>();
}
Trying to prove dyn Trait: Trait
only after we prove dyn Trait: Supertrait
will cause the goal to fail. This seems bad.
Metadata
Metadata
Assignees
Labels
A-dyn-traitArea: trait objects, vtable layoutArea: trait objects, vtable layoutA-trait-systemArea: Trait systemArea: Trait systemC-bugCategory: This is a bug.Category: This is a bug.T-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.