rust/tests/ui/impl-trait/in-trait/bad-item-bound-within-rpitit.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

31 lines
1.0 KiB
Plaintext
Raw Normal View History

error[E0276]: impl has stricter requirements than trait
--> $DIR/bad-item-bound-within-rpitit.rs:16:13
|
LL | type Item<'a>
| ------------- definition of `Item` from trait
...
LL | 'b: 'a;
| ^^ impl has extra requirement `'b: 'a`
|
help: copy the `where` clause predicates from the trait
|
LL | where Self: 'b;
| ~~~~~~~~~~~~~~
error[E0477]: the type `&'a I` does not fulfill the required lifetime
--> $DIR/bad-item-bound-within-rpitit.rs:19:23
|
LL | fn iter(&self) -> impl 'a + Iterator<Item = I::Item<'a>> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: type must outlive the anonymous lifetime as defined here
--> $DIR/bad-item-bound-within-rpitit.rs:10:28
|
LL | fn iter(&self) -> impl '_ + Iterator<Item = Self::Item<'_>>;
| ^^
error: aborting due to 2 previous errors
Some errors have detailed explanations: E0276, E0477.
For more information about an error, try `rustc --explain E0276`.