diff options
| author | Matthew Jasper <mjjasper1@gmail.com> | 2018-08-05 14:33:38 +0100 |
|---|---|---|
| committer | Matthew Jasper <mjjasper1@gmail.com> | 2018-08-05 14:33:38 +0100 |
| commit | f72b8a44c51313d384deefcda753df668f2e265e (patch) | |
| tree | 614c7ac810f1a856109e586a1d713f22f193e088 /src/test | |
| parent | ddcf17e1ed577bad26e92db3c25499620f853a49 (diff) | |
| download | rust-f72b8a44c51313d384deefcda753df668f2e265e.tar.gz rust-f72b8a44c51313d384deefcda753df668f2e265e.zip | |
Use span of the closure args in free region errors
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/ui/error-codes/E0621-does-not-trigger-for-closures.nll.stderr | 5 | ||||
| -rw-r--r-- | src/test/ui/issue-40510-1.nll.stderr | 20 | ||||
| -rw-r--r-- | src/test/ui/issue-40510-3.nll.stderr | 25 | ||||
| -rw-r--r-- | src/test/ui/issue-49824.nll.stderr | 25 | ||||
| -rw-r--r-- | src/test/ui/nll/issue-48238.stderr | 9 |
5 files changed, 38 insertions, 46 deletions
diff --git a/src/test/ui/error-codes/E0621-does-not-trigger-for-closures.nll.stderr b/src/test/ui/error-codes/E0621-does-not-trigger-for-closures.nll.stderr index 0ac295c54bc..27a51cb83fb 100644 --- a/src/test/ui/error-codes/E0621-does-not-trigger-for-closures.nll.stderr +++ b/src/test/ui/error-codes/E0621-does-not-trigger-for-closures.nll.stderr @@ -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 diff --git a/src/test/ui/issue-40510-1.nll.stderr b/src/test/ui/issue-40510-1.nll.stderr index 312ec6e742e..7eb6a0e7fb2 100644 --- a/src/test/ui/issue-40510-1.nll.stderr +++ b/src/test/ui/issue-40510-1.nll.stderr @@ -1,17 +1,15 @@ error: unsatisfied lifetime constraints --> $DIR/issue-40510-1.rs:18:9 | -LL | || { - | _____- - | |_____| - | || -LL | || &mut x - | || ^^^^^^ return requires that `'1` must outlive `'2` -LL | || }; - | || - - | ||_____| - | |______lifetime `'1` represents the closure body - | lifetime `'2` appears in return type +LL | || { + | -- + | | + | lifetime `'1` represents this closure's body + | lifetime `'2` appears in return type +LL | &mut x + | ^^^^^^ return requires that `'1` must outlive `'2` + | + = note: closure implements `FnMut`, so references to captured variables can't escape the closure error: aborting due to previous error diff --git a/src/test/ui/issue-40510-3.nll.stderr b/src/test/ui/issue-40510-3.nll.stderr index eb44850e639..ae3ae3a27ab 100644 --- a/src/test/ui/issue-40510-3.nll.stderr +++ b/src/test/ui/issue-40510-3.nll.stderr @@ -1,20 +1,17 @@ error: unsatisfied lifetime constraints --> $DIR/issue-40510-3.rs:18:9 | -LL | || { - | _____- - | |_____| - | || -LL | || || { - | ||_________^ -LL | ||| x.push(()) -LL | ||| } - | |||_________^ requires that `'1` must outlive `'2` -LL | || }; - | || - - | ||_____| - | |______lifetime `'1` represents the closure body - | lifetime `'2` appears in return type +LL | || { + | -- + | | + | lifetime `'1` represents this closure's body + | lifetime `'2` appears in return type +LL | / || { +LL | | x.push(()) +LL | | } + | |_________^ requires that `'1` must outlive `'2` + | + = note: closure implements `FnMut`, so references to captured variables can't escape the closure error: aborting due to previous error diff --git a/src/test/ui/issue-49824.nll.stderr b/src/test/ui/issue-49824.nll.stderr index 59345754e9f..432036c9d90 100644 --- a/src/test/ui/issue-49824.nll.stderr +++ b/src/test/ui/issue-49824.nll.stderr @@ -1,20 +1,17 @@ error: unsatisfied lifetime constraints --> $DIR/issue-49824.rs:22:9 | -LL | || { - | _____- - | |_____| - | || -LL | || || { - | ||_________^ -LL | ||| let _y = &mut x; -LL | ||| } - | |||_________^ requires that `'1` must outlive `'2` -LL | || }; - | || - - | ||_____| - | |______lifetime `'1` represents the closure body - | lifetime `'2` appears in return type +LL | || { + | -- + | | + | lifetime `'1` represents this closure's body + | lifetime `'2` appears in return type +LL | / || { +LL | | let _y = &mut x; +LL | | } + | |_________^ requires that `'1` must outlive `'2` + | + = note: closure implements `FnMut`, so references to captured variables can't escape the closure error: aborting due to previous error diff --git a/src/test/ui/nll/issue-48238.stderr b/src/test/ui/nll/issue-48238.stderr index 7bdac345e90..4baa9044424 100644 --- a/src/test/ui/nll/issue-48238.stderr +++ b/src/test/ui/nll/issue-48238.stderr @@ -2,11 +2,12 @@ error: unsatisfied lifetime constraints --> $DIR/issue-48238.rs:21:13 | LL | move || use_val(&orig); //~ ERROR - | --------^^^^^^^^^^^^^^ - | | | - | | argument requires that `'1` must outlive `'2` - | lifetime `'1` represents the closure body + | ------- ^^^^^^^^^^^^^^ argument requires that `'1` must outlive `'2` + | | + | lifetime `'1` represents this closure's body | lifetime `'2` appears in return type + | + = note: closure implements `Fn`, so references to captured variables can't escape the closure error: aborting due to previous error |
