Possible bug with operator overloading on traits/associated types #52025
Labels
A-associated-items
Area: Associated items (types, constants & functions)
E-needs-test
Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
See the following playground code:
https://play.rust-lang.org/?gist=bf70f00b6d1998921a4571bd331f6530
If you run it, it works. There are two bits commented out, a trait bounds for an
Add<f32>
and anoperator overload for
Add<f32>
. If you put those back in, you get an error trying to use the + operator.It seems like the 2nd Add trait bound nullifies the first.
This occurs with 1.27stable and nightly as of this post. Ubuntu.
The text was updated successfully, but these errors were encountered: