Files
rust/compiler
bors d37afad0cc Auto merge of #79606 - ThePuzzlemaker:issue-79458-fix, r=scottmcm
Do not show negative polarity trait implementations in diagnostic messages for similar implementations

This fixes #79458.

Previously, this code:
```rust
#[derive(Clone)]
struct Foo<'a, T> {
    x: &'a mut T,
}
```
would have suggested that `<&mut T as Clone>` was an implementation that was found. This is due to the fact that the standard library now has `impl<'_, T> !Clone for &'_ mut T`, and explicit negative polarity implementations were not filtered out in diagnostic output when suggesting similar implementations.

This PR fixes this issue by filtering out negative polarity trait implementations in `find_similar_impl_candidates` within `rustc_trait_selection::traits::error_reporting::InferCtxtPrivExt<'tcx>`. It also adds a UI regression test for this issue and fixes UI tests that had incorrectly been modified to expect the invalid output.

r? `@scottmcm`
2020-12-02 07:37:40 +00:00
..
2020-09-11 09:37:51 -07:00
2020-11-26 21:32:29 +01:00
2020-11-22 13:45:14 +00:00
2020-10-30 10:13:41 -04:00
2020-09-23 21:51:56 +02:00
2020-11-26 21:32:27 +01:00
2020-11-25 15:08:51 -05:00
2020-11-26 21:32:27 +01:00