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