Skip to content

Document when items can be omitted from trait impls #1932

Open
@traviscross

Description

@traviscross

The Reference says:

A trait implementation must define all non-default associated items declared by the implemented trait, may redefine default associated items defined by the implemented trait, and cannot define any other items.

However, the compiler accepts:

trait Tr {
    type Ty where Self: Sized;
    fn f() where Self: Sized;
}

trait A {}
impl Tr for dyn A {}

cc @ehuss rust-lang/rust#135480 #1933 rust-lang/rust#127251

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugIncorrect statements, terminology, or rendering issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions