]> git.lizzy.rs Git - rust.git/commit - src/tools/clippy
Rollup merge of #69217 - LeSeulArtichaut:remove-lint-impl-op, r=estebank
authorMazdak Farrokhzad <twingoow@gmail.com>
Tue, 18 Feb 2020 21:16:29 +0000 (22:16 +0100)
committerGitHub <noreply@github.com>
Tue, 18 Feb 2020 21:16:29 +0000 (22:16 +0100)
commitc499570b5d287f10adfeb63580c8c92a1d5329c5
tree21d4a224104ece38e907826acdcfeeba54e7773b
parent1cf0194b4636b734d4b42e54c9325467da82a7fd
parent2e07892c7dd71f2025b68dcf8c144d53b3560511
Rollup merge of #69217 - LeSeulArtichaut:remove-lint-impl-op, 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 https://github.com/rust-lang/rust/issues/60497#issuecomment-562665539:
> 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