Repository: rust
Issue: Confusing "conflicting implementations" error when conflict occurs via `Into<...>` constraint
Labels: A-diagnostics,T-compiler

Given [the following code on Rust Playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=6563d311412de66f8eb8eede9bb30a6b):

```rust
struct WrapByteTuple {
    tuple: (u8,),
}

impl From<(u8,)> for WrapByteTuple {
    fn from(tuple: (u8,)) -> Self {
        Self {
            tuple
        }
    }
}

struct WrapByteTupleList {
    contents: Vec<WrapByteTuple>,
}

impl<I, T> From<I> for WrapByteTupleList
where
    T: Into<WrapByteTuple>,
    I: IntoIterator<Item = T>
{
    fn from(list: I) -> Self {
        let mut contents = Vec::new();
        contents.extend(list.into_iter().map(Into::into));
        Self {
            contents
        }
    }
}

impl<T> From<T> for WrapByteTupleList
where
    T: Into<WrapByteTuple>
{
    fn from(into_wraptuple: T) -> Self {
        Self {
            contents: vec![into_wraptuple.into()]
        }
    }
}

fn main() {
    let byte_tuple = (b'0',);
    let byte_tuple_vec = vec![byte_tuple];
    let list: WrapByteTupleList = byte_tuple_vec.into();
    
    let byte_tuple = (b'0',);
    let list: WrapByteTupleList = byte_tuple.into();
}
```

The current output is:

```
error[[E0119]](https://doc.rust-lang.org/stable/error-index.html#E0119): conflicting implementations of trait `std::convert::From<_>` for type `WrapByteTupleList`
  --> src/main.rs:34:1
   |
17 | / impl<I, T> From<I> for WrapByteTupleList
18 | | where
19 | |     T: Into<WrapByteTuple>,
20 | |     I: IntoIterator<Item = T>
...  |
28 | |     }
29 | | }
   | |_- first implementation here
...
34 | / impl<T> From<T> for WrapByteTupleList
35 | | where
36 | |     T: Into<WrapByteTuple>
37 | | {
...  |
42 | |     }
43 | | }
   | |_^ conflicting implementation for `WrapByteTupleList`
```

Ideally the output should look like:

```diff
 error[E0119]: conflicting implementations of trait `std::convert::From<_>` for type `WrapByteTupleList`
   --> src/main.rs:34:1
    |
 17 | / impl<I, T> From<I> for WrapByteTupleList
 18 | | where
 19 | |     T: Into<WrapByteTuple>,
 20 | |     I: IntoIterator<Item = T>
 ...  |
 28 | |     }
 29 | | }
    | |_- first implementation here
 ...
 34 | / impl<T> From<T> for WrapByteTupleList
 35 | | where
 36 | |     T: Into<WrapByteTuple>
 37 | | {
 ...  |
 42 | |     }
 43 | | }
    | |_^ conflicting implementation for `WrapByteTupleList`
+...
+ 5 |   impl From<(u8,)> for WrapByteTuple {
+   |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ due to the implementation of From<_> for type 'WrapByteTuple'
+   |
+   = note: upstream crates may add a new impl of trait `std::iter::Iterator` for type `(u8,)` in future versions
```

Adding to the above code an implementation on a concrete type:
```rust
// This one adds the helpful text:
// note: upstream crates may add a new impl of trait `std::iter::Iterator` for type `(u8,)` in future versions
impl From<(u8,)> for WrapByteTupleList {
    fn from(byte_tuple: (u8,)) -> Self {
        Self {
            contents: vec![byte_tuple]
        }
    }
}
```
Gives the following, more helpful error message.
```
error[[E0119]](https://doc.rust-lang.org/stable/error-index.html#E0119): conflicting implementations of trait `std::convert::From<(u8,)>` for type `WrapByteTupleList`
  --> src/main.rs:47:1
   |
17 | / impl<I, T> From<I> for WrapByteTupleList
18 | | where
19 | |     T: Into<WrapByteTuple>,
20 | |     I: IntoIterator<Item = T>
...  |
28 | |     }
29 | | }
   | |_- first implementation here
...
47 |   impl From<(u8,)> for WrapByteTupleList {
   |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `WrapByteTupleList`
   |
   = note: upstream crates may add a new impl of trait `std::iter::Iterator` for type `(u8,)` in future versions
   = note: upstream crates may add a new impl of trait `std::iter::Iterator` for type `(u8,)` in future versions
```

Both implementations are in [the Playground code](https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=6563d311412de66f8eb8eede9bb30a6b), and both errors appear there.

The second error explains (relatively) clearly that the conflict occurs due to a reserved `IntoIterator<_>` implementation for tuples. In my actual code, I didn't have the benefit of the second error. The first error doesn't give any clues as to why the conflict exists, so I played around with implementations on concrete types until I got the note about tuple iterators. It would have been very helpful of the compiler to tell me that the conflict actually occurred due to my use of `Into` on a type that implements `From<(...,)>`.