-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Trait bounds on struct type parameters aren't always enforced (depending on the order of impls) #21837
Copy link
Copy link
Closed
Labels
A-type-systemArea: Type systemArea: Type systemE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.P-mediumMedium priorityMedium priority
Metadata
Metadata
Assignees
Labels
A-type-systemArea: Type systemArea: Type systemE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.P-mediumMedium priorityMedium priority
Type
Fields
Give feedbackNo fields configured for issues without a type.
The following compiles without issue, even though the impl of
Trait2is missing a trait bound thatTimplementsBound:However, if you switch the order of the impls...
You suddenly start getting this error:
I did not expect the ordering of the impls to matter here. I'm using
rustc 1.0.0-nightly (1d00c545e 2015-01-30 19:56:34 +0000).