about summary refs log tree commit diff
path: root/library/std/src/sys/unix/net.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-12-02 07:37:40 +0000
committerbors <bors@rust-lang.org>2020-12-02 07:37:40 +0000
commitd37afad0cc87bf709ad10c85319296ac53030f03 (patch)
tree6b948a91442c6d872af5b7ef1b835b2760cfd254 /library/std/src/sys/unix/net.rs
parent92e4fb073245a42559e357a3002c596b8b38edf6 (diff)
parentb287806d389d3bc94470c27568ad16dc015769a5 (diff)
downloadrust-d37afad0cc87bf709ad10c85319296ac53030f03.tar.gz
rust-d37afad0cc87bf709ad10c85319296ac53030f03.zip
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`
Diffstat (limited to 'library/std/src/sys/unix/net.rs')
0 files changed, 0 insertions, 0 deletions