]> git.proxmox.com Git - rustc.git/blob - src/test/ui/nll/closure-requirements/return-wrong-bound-region.stderr
New upstream version 1.48.0~beta.8+dfsg1
[rustc.git] / src / test / ui / nll / closure-requirements / return-wrong-bound-region.stderr
1 note: no external requirements
2 --> $DIR/return-wrong-bound-region.rs:11:16
3 |
4 LL | expect_sig(|a, b| b); // ought to return `a`
5 | ^^^^^^^^
6 |
7 = note: defining type: test::{closure#0} with closure substs [
8 i16,
9 for<'r, 's> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BrNamed('r)) i32, &ReLateBound(DebruijnIndex(0), BrNamed('s)) i32)) -> &ReLateBound(DebruijnIndex(0), BrNamed('r)) i32,
10 (),
11 ]
12
13 error: lifetime may not live long enough
14 --> $DIR/return-wrong-bound-region.rs:11:23
15 |
16 LL | expect_sig(|a, b| b); // ought to return `a`
17 | - - ^ closure was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
18 | | |
19 | | has type `&'1 i32`
20 | has type `&'2 i32`
21
22 note: no external requirements
23 --> $DIR/return-wrong-bound-region.rs:10:1
24 |
25 LL | / fn test() {
26 LL | | expect_sig(|a, b| b); // ought to return `a`
27 LL | |
28 LL | | }
29 | |_^
30 |
31 = note: defining type: test
32
33 error: aborting due to previous error
34