-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Do not emit note suggesting to implement operation trait to foreign type #69217
Conversation
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
Can you run |
I’ll address test failures and review ASAP. |
Update tests Extend to other operations Refractor check in a separate function Fix more tests
c4b77a6
to
2e07892
Compare
Done! |
@bors r+ |
📌 Commit 2e07892 has been approved by |
…, 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
Rollup of 6 pull requests Successful merges: - #69146 (Always const qualify literals by type) - #69159 (Select an appropriate unused lifetime name in suggestion) - #69194 (parse: fuse associated and extern items up to defaultness) - #69211 (parser: Simplify treatment of macro variables in `Parser::bump`) - #69217 (Do not emit note suggesting to implement operation trait to foreign type) - #69236 (parse: recover `mut (x @ y)` as `(mut x @ mut y)`.) Failed merges: r? @ghost
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
orstd
.For example:
As mentioned in #60497 (comment):
(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