about summary refs log tree commit diff
path: root/src/test/ui/impl-trait
diff options
context:
space:
mode:
authorDavid Wood <david@davidtw.co>2018-07-24 16:22:41 +0200
committerDavid Wood <david@davidtw.co>2018-07-27 12:48:47 +0200
commitb377e7bbfbf584de4c1a775fd41b957cbd2e057b (patch)
treecc971126db8d0f01669a998725f74e515a2654a3 /src/test/ui/impl-trait
parent055aaaf765eee0eb951b55898d943ff7dde3d4ae (diff)
downloadrust-b377e7bbfbf584de4c1a775fd41b957cbd2e057b.tar.gz
rust-b377e7bbfbf584de4c1a775fd41b957cbd2e057b.zip
Change label from closure to function where appropriate.
Diffstat (limited to 'src/test/ui/impl-trait')
-rw-r--r--src/test/ui/impl-trait/static-return-lifetime-infered.nll.stderr12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/test/ui/impl-trait/static-return-lifetime-infered.nll.stderr b/src/test/ui/impl-trait/static-return-lifetime-infered.nll.stderr
index c6f8d2e519c..123a93636d2 100644
--- a/src/test/ui/impl-trait/static-return-lifetime-infered.nll.stderr
+++ b/src/test/ui/impl-trait/static-return-lifetime-infered.nll.stderr
@@ -10,21 +10,19 @@ warning: not reporting region error due to nll
 LL |         self.x.iter().map(|a| a.0)
    |                ^^^^
 
-error: borrowed data escapes outside of closure
+error: unsatisfied lifetime constraints
   --> $DIR/static-return-lifetime-infered.rs:17:9
    |
 LL |     fn iter_values_anon(&self) -> impl Iterator<Item=u32> {
-   |                         ----- `self` is a reference that is only valid in the closure body
+   |                         - let's call the lifetime of this reference `'1`
 LL |         self.x.iter().map(|a| a.0)
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^ `self` escapes the closure body here
+   |         ^^^^^^^^^^^^^ free region requires that `'1` must outlive `'static`
 
-error: borrowed data escapes outside of closure
+error: unsatisfied lifetime constraints
   --> $DIR/static-return-lifetime-infered.rs:21:9
    |
-LL |     fn iter_values<'a>(&'a self) -> impl Iterator<Item=u32> {
-   |                        -------- `self` is a reference that is only valid in the closure body
 LL |         self.x.iter().map(|a| a.0)
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^ `self` escapes the closure body here
+   |         ^^^^^^^^^^^^^ free region requires that `'a` must outlive `'static`
 
 error: aborting due to 2 previous errors