dyn Trait + Send+ Send should equal dyn Trait + Send #47010
Labels
A-trait-system
Area: Trait system
C-feature-request
Category: A feature request, i.e: not implemented / a PR.
T-lang
Relevant to the language team, which will review and decide on the PR/issue.
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
andSend2
be equivalent.The text was updated successfully, but these errors were encountered: