about summary refs log tree commit diff
path: root/src/test/ui/impl-trait
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-06-30 16:52:12 +0000
committerbors <bors@rust-lang.org>2018-06-30 16:52:12 +0000
commit8772747c5f3a5809aea9abdb1586613b751db9ac (patch)
tree830525cc6ddda31909db27b7aa5072d78004f7a7 /src/test/ui/impl-trait
parent96b47337d9deebdb9cbca909e7772672062021e5 (diff)
parent8449c5ab8a83cfa1f89c8f7810a42a54130c844d (diff)
downloadrust-8772747c5f3a5809aea9abdb1586613b751db9ac.tar.gz
rust-8772747c5f3a5809aea9abdb1586613b751db9ac.zip
Auto merge of #51862 - estebank:lifetime-spans, r=nikomatsakis
Point to lifetime spans on lifetime errors
Diffstat (limited to 'src/test/ui/impl-trait')
-rw-r--r--src/test/ui/impl-trait/region-escape-via-bound.stderr13
-rw-r--r--src/test/ui/impl-trait/static-return-lifetime-infered.stderr8
2 files changed, 8 insertions, 13 deletions
diff --git a/src/test/ui/impl-trait/region-escape-via-bound.stderr b/src/test/ui/impl-trait/region-escape-via-bound.stderr
index b673111d219..92464a24301 100644
--- a/src/test/ui/impl-trait/region-escape-via-bound.stderr
+++ b/src/test/ui/impl-trait/region-escape-via-bound.stderr
@@ -4,16 +4,11 @@ error[E0700]: hidden type for `impl Trait` captures lifetime that does not appea
 LL | fn foo(x: Cell<&'x u32>) -> impl Trait<'y>
    |                             ^^^^^^^^^^^^^^
    |
-note: hidden type `std::cell::Cell<&'x u32>` captures the lifetime 'x as defined on the function body at 26:1
-  --> $DIR/region-escape-via-bound.rs:26:1
+note: hidden type `std::cell::Cell<&'x u32>` captures the lifetime 'x as defined on the function body at 28:7
+  --> $DIR/region-escape-via-bound.rs:28:7
    |
-LL | / fn foo(x: Cell<&'x u32>) -> impl Trait<'y>
-LL | |     //~^ ERROR hidden type for `impl Trait` captures lifetime that does not appear in bounds [E0700]
-LL | | where 'x: 'y
-LL | | {
-LL | |     x
-LL | | }
-   | |_^
+LL | where 'x: 'y
+   |       ^^
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/impl-trait/static-return-lifetime-infered.stderr b/src/test/ui/impl-trait/static-return-lifetime-infered.stderr
index 2795bb92ed5..083ad03ff85 100644
--- a/src/test/ui/impl-trait/static-return-lifetime-infered.stderr
+++ b/src/test/ui/impl-trait/static-return-lifetime-infered.stderr
@@ -30,12 +30,12 @@ LL |         self.x.iter().map(|a| a.0)
    |         |
    |         ...but this borrow...
    |
-note: ...can't outlive the lifetime 'a as defined on the method body at 20:5
-  --> $DIR/static-return-lifetime-infered.rs:20:5
+note: ...can't outlive the lifetime 'a as defined on the method body at 20:20
+  --> $DIR/static-return-lifetime-infered.rs:20:20
    |
 LL |     fn iter_values<'a>(&'a self) -> impl Iterator<Item=u32> {
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-help: you can add a constraint to the return type to make it last less than `'static` and match the lifetime 'a as defined on the method body at 20:5
+   |                    ^^
+help: you can add a constraint to the return type to make it last less than `'static` and match the lifetime 'a as defined on the method body at 20:20
    |
 LL |     fn iter_values<'a>(&'a self) -> impl Iterator<Item=u32> + 'a {
    |                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^