-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unify binop errors wording #60497
Comments
How should one go about implementing this? Somehow sorting the operator order to pick consistently? Or better to always show the two hints for both orderings? |
We could do it by picking and matching wording from both errors to make them consistent with each other. The E0277 one can be updated by changing the rust/src/librustc_typeck/check/op.rs Lines 329 to 422 in ef9a876
I think in the end E0369 should mimic E0277 and not worry about adding the type labels to E0277. |
I'll work on this but I don't catch better wording. One of options is to change E0369 |
@rustbot claim |
@JohnTitor I believe that doing the following should be enough to close this ticket:
The @LeSeulArtichaut feel free to reach out if you need help with this. |
@LeSeulArtichaut it is ok if you only tackle a subset of all the binops, we can get back to These go through different parts of typeck, which is why they produce different results. |
…, r=estebank Do not emit note suggesting to implement operation trait to foreign type When a binary operation isn't valid, you will get a lint proposing to add a trait implementation to make the operation possible. However, this cannot be done for foreign types, such as types from `core` or `std`. For example: ``` = note: an implementation of `std::ops::Add` might be missing for `std::option::Option<i8>` ``` As mentioned in rust-lang#60497 (comment): > The note suggesting implementing Add<i8> should only be emitted if Option<i8> were local to the current crate, which it isn't, so in this case it shouldn't be emitted. (I will use the CI to check tests for me, or my computer will just burn... and running IDEs is not possible on a pile of ashes) r? @estebank
The following two errors are actually the same problem but have different output because they are handled in different parts of the compiler. We should unify the output to have similar, if not the same, text.
This issue has been assigned to @LeSeulArtichaut via this comment.
The text was updated successfully, but these errors were encountered: