fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
1.4 KiB33 linesraw
1error[E0276]: impl has stricter requirements than trait
2  --> $DIR/bad-item-bound-within-rpitit.rs:16:13
3   |
4LL |     type Item<'a>
5   |     ------------- definition of `Item` from trait
6...
7LL |         'b: 'a;
8   |             ^^ impl has extra requirement `'b: 'a`
9   |
10help: copy the `where` clause predicates from the trait
11   |
12LL |     where Self: 'b;
13   |     ~~~~~~~~~~~~~~
14
15warning: impl trait in impl method signature does not match trait method signature
16  --> $DIR/bad-item-bound-within-rpitit.rs:19:28
17   |
18LL |     fn iter(&self) -> impl '_ + Iterator<Item = Self::Item<'_>>;
19   |                       ----------------------------------------- return type from trait method defined here
20...
21LL |     fn iter(&self) -> impl 'a + Iterator<Item = I::Item<'a>> {
22   |                            ^^ this bound is stronger than that defined on the trait
23   |
24   = note: add `#[allow(refining_impl_trait)]` if it is intended for this to be part of the public API of this crate
25   = note: `#[warn(refining_impl_trait)]` on by default
26help: replace the return type so that it matches the trait
27   |
28LL |     fn iter(&self) -> impl Iterator<Item = <Self as Iterable>::Item<'_>> + '_ {
29   |                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
30
31error: aborting due to previous error; 1 warning emitted
32
33For more information about this error, try `rustc --explain E0276`.