]> git.lizzy.rs Git - rust.git/blob - src/test/ui/nll/closure-requirements/return-wrong-bound-region.stderr
Auto merge of #52046 - cramertj:fix-generator-mir, r=eddyb
[rust.git] / src / test / ui / nll / closure-requirements / return-wrong-bound-region.stderr
1 warning: not reporting region error due to nll
2   --> $DIR/return-wrong-bound-region.rs:21:23
3    |
4 LL |     expect_sig(|a, b| b); // ought to return `a`
5    |                       ^
6
7 error: unsatisfied lifetime constraints
8   --> $DIR/return-wrong-bound-region.rs:21:23
9    |
10 LL |     expect_sig(|a, b| b); // ought to return `a`
11    |                 -  -  ^ free region requires that `'1` must outlive `'2`
12    |                 |  |
13    |                 |  lifetime `'1` appears in this argument
14    |                 lifetime `'2` appears in this argument
15
16 note: No external requirements
17   --> $DIR/return-wrong-bound-region.rs:21:16
18    |
19 LL |     expect_sig(|a, b| b); // ought to return `a`
20    |                ^^^^^^^^
21    |
22    = note: defining type: DefId(0/1:9 ~ return_wrong_bound_region[317d]::test[0]::{{closure}}[0]) with closure substs [
23                i16,
24                for<'r, 's> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 'r)) i32, &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 's)) i32)) -> &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 'r)) i32
25            ]
26
27 note: No external requirements
28   --> $DIR/return-wrong-bound-region.rs:20:1
29    |
30 LL | / fn test() {
31 LL | |     expect_sig(|a, b| b); // ought to return `a`
32 LL | |     //~^ WARN not reporting region error due to nll
33 LL | |     //~| ERROR
34 LL | | }
35    | |_^
36    |
37    = note: defining type: DefId(0/0:3 ~ return_wrong_bound_region[317d]::test[0]) with substs []
38
39 error: aborting due to previous error
40