]> git.proxmox.com Git - rustc.git/blob - src/test/ui/impl-trait/static-return-lifetime-infered.stderr
New upstream version 1.59.0+dfsg1
[rustc.git] / src / test / ui / impl-trait / static-return-lifetime-infered.stderr
1 error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds
2 --> $DIR/static-return-lifetime-infered.rs:6:35
3 |
4 LL | fn iter_values_anon(&self) -> impl Iterator<Item=u32> {
5 | ----- ^^^^^^^^^^^^^^^^^^^^^^^
6 | |
7 | hidden type `Map<std::slice::Iter<'_, (u32, u32)>, [closure@$DIR/static-return-lifetime-infered.rs:9:27: 9:34]>` captures the anonymous lifetime defined here
8 |
9 help: to declare that the `impl Trait` captures `'_`, you can add an explicit `'_` lifetime bound
10 |
11 LL | fn iter_values_anon(&self) -> impl Iterator<Item=u32> + '_ {
12 | ++++
13
14 error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds
15 --> $DIR/static-return-lifetime-infered.rs:6:35
16 |
17 LL | fn iter_values_anon(&self) -> impl Iterator<Item=u32> {
18 | ----- ^^^^^^^^^^^^^^^^^^^^^^^
19 | |
20 | hidden type `Map<std::slice::Iter<'_, (u32, u32)>, [closure@$DIR/static-return-lifetime-infered.rs:9:27: 9:34]>` captures the anonymous lifetime defined here
21 |
22 help: to declare that the `impl Trait` captures `'_`, you can add an explicit `'_` lifetime bound
23 |
24 LL | fn iter_values_anon(&self) -> impl Iterator<Item=u32> + '_ {
25 | ++++
26
27 error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds
28 --> $DIR/static-return-lifetime-infered.rs:11:37
29 |
30 LL | fn iter_values<'a>(&'a self) -> impl Iterator<Item=u32> {
31 | -- ^^^^^^^^^^^^^^^^^^^^^^^
32 | |
33 | hidden type `Map<std::slice::Iter<'a, (u32, u32)>, [closure@$DIR/static-return-lifetime-infered.rs:14:27: 14:34]>` captures the lifetime `'a` as defined here
34 |
35 help: to declare that the `impl Trait` captures `'a`, you can add an explicit `'a` lifetime bound
36 |
37 LL | fn iter_values<'a>(&'a self) -> impl Iterator<Item=u32> + 'a {
38 | ++++
39
40 error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds
41 --> $DIR/static-return-lifetime-infered.rs:11:37
42 |
43 LL | fn iter_values<'a>(&'a self) -> impl Iterator<Item=u32> {
44 | -- ^^^^^^^^^^^^^^^^^^^^^^^
45 | |
46 | hidden type `Map<std::slice::Iter<'a, (u32, u32)>, [closure@$DIR/static-return-lifetime-infered.rs:14:27: 14:34]>` captures the lifetime `'a` as defined here
47 |
48 help: to declare that the `impl Trait` captures `'a`, you can add an explicit `'a` lifetime bound
49 |
50 LL | fn iter_values<'a>(&'a self) -> impl Iterator<Item=u32> + 'a {
51 | ++++
52
53 error: aborting due to 4 previous errors
54
55 For more information about this error, try `rustc --explain E0700`.