blob: ca794d92666f2ed32fb274f0bb07ae024e47749e [file] [log] [blame]
note: No external requirements
--> $DIR/return-wrong-bound-region.rs:11:16
|
LL | expect_sig(|a, b| b); // ought to return `a`
| ^^^^^^^^
|
= note: defining type: test::{{closure}}#0 with closure substs [
i16,
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,
]
error: lifetime may not live long enough
--> $DIR/return-wrong-bound-region.rs:11:23
|
LL | expect_sig(|a, b| b); // ought to return `a`
| - - ^ closure was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
| | |
| | has type `&'1 i32`
| has type `&'2 i32`
note: No external requirements
--> $DIR/return-wrong-bound-region.rs:10:1
|
LL | / fn test() {
LL | | expect_sig(|a, b| b); // ought to return `a`
LL | |
LL | | }
| |_^
|
= note: defining type: test
error: aborting due to previous error