Use span of the closure args in free region errors

This commit is contained in:
Matthew Jasper 2018-08-05 14:33:38 +01:00
parent ddcf17e1ed
commit f72b8a44c5
6 changed files with 91 additions and 55 deletions

View file

@ -8,9 +8,8 @@ error: unsatisfied lifetime constraints
--> $DIR/E0621-does-not-trigger-for-closures.rs:25:26
|
LL | invoke(&x, |a, b| if a > b { a } else { b }); //~ ERROR E0495
| ----------^^^^^-----------------
| | | |
| | | requires that `'1` must outlive `'2`
| ------ ^^^^^ requires that `'1` must outlive `'2`
| | |
| | has type `&'1 i32`
| lifetime `'2` appears in return type