Skip to content

dyn Trait + Send+ Send should equal dyn Trait + Send #47010

Closed
@Havvy

Description

@Havvy

For some trait, Trait, the following is a legal type: type Send2 = Trait + Send + Send.

Not only that, but the type is actually distinct from type Send1 = Trait + Send. E.g., you can put inherent methods on both, and call them distinctly. I've a full example of this here.

Unfortunately, this is already in stable Rust, but at the same time, I don't think anybody is actually relying on this corner of the language. It should be an error to have the same trait twice in a trait object (except perhaps via generics), or at least make cases like Send1 and Send2 be equivalent.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-trait-systemArea: Trait systemC-feature-requestCategory: A feature request, i.e: not implemented / a PR.T-langRelevant to the language team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions