Closed
Description
Consider:
use std::iter::FromIterator;
struct X;
impl FromIterator<()> for X {
}
which causes the following error on stable and nightly:
error[E0046]: not all trait items implemented, missing: `from_iter`
--> src/main.rs:3:1
|
3 | impl FromIterator<()> for X {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `from_iter` in implementation
|
= note: `from_iter` from trait: `fn(T) -> Self`
It would be super helpful to print the other relevant bounds for this method:
pub trait FromIterator<A> {
fn from_iter<T>(iter: T) -> Self
where
T: IntoIterator<Item = A>;
}
Just trying to add a partial definition fn from_iter<I>(i: I) -> Self { Self }
will be accepted without any bound on I
. Of course you can't really do anything with it yet. Thus it would be pleasant to remind the user what bound they probably need.