]> git.lizzy.rs Git - rust.git/blob - src/test/ui/closures/closure-expected-type/expect-region-supply-region-2.stderr
Update tests
[rust.git] / src / test / ui / closures / closure-expected-type / expect-region-supply-region-2.stderr
1 error[E0308]: mismatched types
2   --> $DIR/expect-region-supply-region-2.rs:14:33
3    |
4 LL |     closure_expecting_bound(|x: &'x u32| {
5    |                                 ^^^^^^^ lifetime mismatch
6    |
7    = note: expected reference `&u32`
8               found reference `&'x u32`
9 note: the anonymous lifetime #2 defined on the body at 14:29...
10   --> $DIR/expect-region-supply-region-2.rs:14:29
11    |
12 LL |       closure_expecting_bound(|x: &'x u32| {
13    |  _____________________________^
14 LL | |
15 LL | |
16 LL | |
17 ...  |
18 LL | |         f = Some(x);
19 LL | |     });
20    | |_____^
21 note: ...does not necessarily outlive the lifetime `'x` as defined on the function body at 9:30
22   --> $DIR/expect-region-supply-region-2.rs:9:30
23    |
24 LL | fn expect_bound_supply_named<'x>() {
25    |                              ^^
26
27 error[E0308]: mismatched types
28   --> $DIR/expect-region-supply-region-2.rs:14:33
29    |
30 LL |     closure_expecting_bound(|x: &'x u32| {
31    |                                 ^^^^^^^ lifetime mismatch
32    |
33    = note: expected reference `&u32`
34               found reference `&'x u32`
35 note: the lifetime `'x` as defined on the function body at 9:30...
36   --> $DIR/expect-region-supply-region-2.rs:9:30
37    |
38 LL | fn expect_bound_supply_named<'x>() {
39    |                              ^^
40 note: ...does not necessarily outlive the anonymous lifetime #2 defined on the body at 14:29
41   --> $DIR/expect-region-supply-region-2.rs:14:29
42    |
43 LL |       closure_expecting_bound(|x: &'x u32| {
44    |  _____________________________^
45 LL | |
46 LL | |
47 LL | |
48 ...  |
49 LL | |         f = Some(x);
50 LL | |     });
51    | |_____^
52
53 error: aborting due to 2 previous errors
54
55 For more information about this error, try `rustc --explain E0308`.