about summary refs log tree commit diff
path: root/src/test/ui/lifetime-errors
diff options
context:
space:
mode:
authorPramod Bisht <pramodpsb@outlook.com>2018-08-05 18:44:03 +0000
committerPramod Bisht <pramodpsb@outlook.com>2018-08-05 18:44:03 +0000
commit19401086df0d27bc3462addc3783595b86638514 (patch)
treeb0b3bc956842196adfa910f4e781055f6adfa637 /src/test/ui/lifetime-errors
parent9f9ac89d11a2afaeaa029738b38142124684c89b (diff)
Closes #52413: Provide structured suggestion instead of label
Diffstat (limited to 'src/test/ui/lifetime-errors')
-rw-r--r--src/test/ui/lifetime-errors/42701_one_named_and_one_anonymous.nll.stderr2
-rw-r--r--src/test/ui/lifetime-errors/42701_one_named_and_one_anonymous.stderr2
-rw-r--r--src/test/ui/lifetime-errors/ex1-return-one-existing-name-early-bound-in-struct.nll.stderr2
-rw-r--r--src/test/ui/lifetime-errors/ex1-return-one-existing-name-early-bound-in-struct.stderr2
-rw-r--r--src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-2.nll.stderr2
-rw-r--r--src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-2.stderr2
-rw-r--r--src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-3.nll.stderr7
-rw-r--r--src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-3.stderr2
-rw-r--r--src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-2.nll.stderr2
-rw-r--r--src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-2.stderr2
-rw-r--r--src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-3.nll.stderr2
-rw-r--r--src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-3.stderr2
-rw-r--r--src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else.nll.stderr2
-rw-r--r--src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else.stderr2
-rw-r--r--src/test/ui/lifetime-errors/ex2a-push-one-existing-name-2.nll.stderr2
-rw-r--r--src/test/ui/lifetime-errors/ex2a-push-one-existing-name-2.stderr2
-rw-r--r--src/test/ui/lifetime-errors/ex2a-push-one-existing-name-early-bound.stderr2
-rw-r--r--src/test/ui/lifetime-errors/ex2a-push-one-existing-name.nll.stderr2
-rw-r--r--src/test/ui/lifetime-errors/ex2a-push-one-existing-name.stderr2
19 files changed, 21 insertions, 22 deletions
diff --git a/src/test/ui/lifetime-errors/42701_one_named_and_one_anonymous.nll.stderr b/src/test/ui/lifetime-errors/42701_one_named_and_one_anonymous.nll.stderr
index d422a63bcad..bec5fb2f72a 100644
--- a/src/test/ui/lifetime-errors/42701_one_named_and_one_anonymous.nll.stderr
+++ b/src/test/ui/lifetime-errors/42701_one_named_and_one_anonymous.nll.stderr
@@ -8,7 +8,7 @@ error[E0621]: explicit lifetime required in the type of `x`
   --> $DIR/42701_one_named_and_one_anonymous.rs:16:5
    |
 LL |   fn foo2<'a>(a: &'a Foo, x: &i32) -> &'a i32 {
-   |                           - consider changing the type of `x` to `&'a i32`
+   |                              ---- help: consider changing the type of `x` to : `&'a i32`
 LL | /     if true {
 LL | |         let p: &i32 = &a.field;
 LL | |         &*p
diff --git a/src/test/ui/lifetime-errors/42701_one_named_and_one_anonymous.stderr b/src/test/ui/lifetime-errors/42701_one_named_and_one_anonymous.stderr
index 87cb1748913..b23025ee127 100644
--- a/src/test/ui/lifetime-errors/42701_one_named_and_one_anonymous.stderr
+++ b/src/test/ui/lifetime-errors/42701_one_named_and_one_anonymous.stderr
@@ -2,7 +2,7 @@ error[E0621]: explicit lifetime required in the type of `x`
   --> $DIR/42701_one_named_and_one_anonymous.rs:20:9
    |
 LL | fn foo2<'a>(a: &'a Foo, x: &i32) -> &'a i32 {
-   |                         - consider changing the type of `x` to `&'a i32`
+   |                            ---- help: consider changing the type of `x` to : `&'a i32`
 ...
 LL |         &*x //~ ERROR explicit lifetime
    |         ^^^ lifetime `'a` required
diff --git a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-early-bound-in-struct.nll.stderr b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-early-bound-in-struct.nll.stderr
index e5b001def56..9666e0112ac 100644
--- a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-early-bound-in-struct.nll.stderr
+++ b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-early-bound-in-struct.nll.stderr
@@ -8,7 +8,7 @@ error[E0621]: explicit lifetime required in the type of `other`
   --> $DIR/ex1-return-one-existing-name-early-bound-in-struct.rs:18:15
    |
 LL |     fn bar(&self, other: Foo) -> Foo<'a> {
-   |                   ----- consider changing the type of `other` to `Foo<'a>`
+   |                          --- help: consider changing the type of `other` to : `Foo<'a>`
 LL |         match *self {
    |               ^^^^^ lifetime `'a` required
 
diff --git a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-early-bound-in-struct.stderr b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-early-bound-in-struct.stderr
index 29163361e23..0cce3d204ae 100644
--- a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-early-bound-in-struct.stderr
+++ b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-early-bound-in-struct.stderr
@@ -2,7 +2,7 @@ error[E0621]: explicit lifetime required in the type of `other`
   --> $DIR/ex1-return-one-existing-name-early-bound-in-struct.rs:21:21
    |
 LL |     fn bar(&self, other: Foo) -> Foo<'a> {
-   |                   ----- consider changing the type of `other` to `Foo<'a>`
+   |                          --- help: consider changing the type of `other` to : `Foo<'a>`
 ...
 LL |                     other //~ ERROR explicit lifetime
    |                     ^^^^^ lifetime `'a` required
diff --git a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-2.nll.stderr b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-2.nll.stderr
index e1dfeb0ac6a..667d8548c72 100644
--- a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-2.nll.stderr
+++ b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-2.nll.stderr
@@ -8,7 +8,7 @@ error[E0621]: explicit lifetime required in the type of `x`
   --> $DIR/ex1-return-one-existing-name-if-else-2.rs:12:8
    |
 LL | fn foo<'a>(x: &i32, y: &'a i32) -> &'a i32 {
-   |            - consider changing the type of `x` to `&'a i32`
+   |               ---- help: consider changing the type of `x` to : `&'a i32`
 LL |     if x > y { x } else { y } //~ ERROR explicit lifetime
    |        ^^^^^ lifetime `'a` required
 
diff --git a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-2.stderr b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-2.stderr
index e18156179a2..cfbfd5ac448 100644
--- a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-2.stderr
+++ b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-2.stderr
@@ -2,7 +2,7 @@ error[E0621]: explicit lifetime required in the type of `x`
   --> $DIR/ex1-return-one-existing-name-if-else-2.rs:12:16
    |
 LL | fn foo<'a>(x: &i32, y: &'a i32) -> &'a i32 {
-   |            - consider changing the type of `x` to `&'a i32`
+   |               ---- help: consider changing the type of `x` to : `&'a i32`
 LL |     if x > y { x } else { y } //~ ERROR explicit lifetime
    |                ^ lifetime `'a` required
 
diff --git a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-3.nll.stderr b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-3.nll.stderr
index 4d9517eca60..3e79d3e44df 100644
--- a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-3.nll.stderr
+++ b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-3.nll.stderr
@@ -8,10 +8,9 @@ error[E0621]: explicit lifetime required in parameter type
   --> $DIR/ex1-return-one-existing-name-if-else-3.rs:11:16
    |
 LL | fn foo<'a>((x, y): (&'a i32, &i32)) -> &'a i32 {
-   |            ----^-
-   |            |   |
-   |            |   lifetime `'a` required
-   |            consider changing type to `(&'a i32, &'a i32)`
+   |                ^   --------------- help: consider changing type to : `(&'a i32, &'a i32)`
+   |                |
+   |                lifetime `'a` required
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-3.stderr b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-3.stderr
index f208fb57f5b..70c25be2c30 100644
--- a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-3.stderr
+++ b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-3.stderr
@@ -2,7 +2,7 @@ error[E0621]: explicit lifetime required in parameter type
   --> $DIR/ex1-return-one-existing-name-if-else-3.rs:12:27
    |
 LL | fn foo<'a>((x, y): (&'a i32, &i32)) -> &'a i32 {
-   |            ------ consider changing type to `(&'a i32, &'a i32)`
+   |                    --------------- help: consider changing type to : `(&'a i32, &'a i32)`
 LL |     if x > y { x } else { y } //~ ERROR explicit lifetime
    |                           ^ lifetime `'a` required
 
diff --git a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-2.nll.stderr b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-2.nll.stderr
index e264b3428c9..419644cb60e 100644
--- a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-2.nll.stderr
+++ b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-2.nll.stderr
@@ -8,7 +8,7 @@ error[E0621]: explicit lifetime required in the type of `x`
   --> $DIR/ex1-return-one-existing-name-if-else-using-impl-2.rs:14:7
    |
 LL | fn foo<'a>(x: &i32, y: &'a i32) -> &'a i32 {
-   |            - consider changing the type of `x` to `&'a i32`
+   |               ---- help: consider changing the type of `x` to : `&'a i32`
 LL |    if x > y { x } else { y } //~ ERROR explicit lifetime
    |       ^^^^^ lifetime `'a` required
 
diff --git a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-2.stderr b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-2.stderr
index 7604b9a9017..5c256aab62c 100644
--- a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-2.stderr
+++ b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-2.stderr
@@ -2,7 +2,7 @@ error[E0621]: explicit lifetime required in the type of `x`
   --> $DIR/ex1-return-one-existing-name-if-else-using-impl-2.rs:14:15
    |
 LL | fn foo<'a>(x: &i32, y: &'a i32) -> &'a i32 {
-   |            - consider changing the type of `x` to `&'a i32`
+   |               ---- help: consider changing the type of `x` to : `&'a i32`
 LL |    if x > y { x } else { y } //~ ERROR explicit lifetime
    |               ^ lifetime `'a` required
 
diff --git a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-3.nll.stderr b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-3.nll.stderr
index 6119f3c5605..97ff1879f1b 100644
--- a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-3.nll.stderr
+++ b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-3.nll.stderr
@@ -8,7 +8,7 @@ error[E0621]: explicit lifetime required in the type of `x`
   --> $DIR/ex1-return-one-existing-name-if-else-using-impl-3.rs:18:5
    |
 LL |   fn foo<'a>(&'a self, x: &i32) -> &i32 {
-   |                        - consider changing the type of `x` to `&'a i32`
+   |                           ---- help: consider changing the type of `x` to : `&'a i32`
 LL | 
 LL |     if true { &self.field } else { x } //~ ERROR explicit lifetime
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lifetime `'a` required
diff --git a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-3.stderr b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-3.stderr
index 83c6ff19867..f8654baa86b 100644
--- a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-3.stderr
+++ b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-3.stderr
@@ -2,7 +2,7 @@ error[E0621]: explicit lifetime required in the type of `x`
   --> $DIR/ex1-return-one-existing-name-if-else-using-impl-3.rs:18:36
    |
 LL |   fn foo<'a>(&'a self, x: &i32) -> &i32 {
-   |                        - consider changing the type of `x` to `&'a i32`
+   |                           ---- help: consider changing the type of `x` to : `&'a i32`
 LL | 
 LL |     if true { &self.field } else { x } //~ ERROR explicit lifetime
    |                                    ^ lifetime `'a` required
diff --git a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else.nll.stderr b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else.nll.stderr
index 5e49e4ec4a9..8c429bcbc95 100644
--- a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else.nll.stderr
+++ b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else.nll.stderr
@@ -8,7 +8,7 @@ error[E0621]: explicit lifetime required in the type of `y`
   --> $DIR/ex1-return-one-existing-name-if-else.rs:12:8
    |
 LL | fn foo<'a>(x: &'a i32, y: &i32) -> &'a i32 {
-   |                        - consider changing the type of `y` to `&'a i32`
+   |                           ---- help: consider changing the type of `y` to : `&'a i32`
 LL |     if x > y { x } else { y } //~ ERROR explicit lifetime
    |        ^^^^^ lifetime `'a` required
 
diff --git a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else.stderr b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else.stderr
index 9893eee77e8..cd7719f7047 100644
--- a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else.stderr
+++ b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else.stderr
@@ -2,7 +2,7 @@ error[E0621]: explicit lifetime required in the type of `y`
   --> $DIR/ex1-return-one-existing-name-if-else.rs:12:27
    |
 LL | fn foo<'a>(x: &'a i32, y: &i32) -> &'a i32 {
-   |                        - consider changing the type of `y` to `&'a i32`
+   |                           ---- help: consider changing the type of `y` to : `&'a i32`
 LL |     if x > y { x } else { y } //~ ERROR explicit lifetime
    |                           ^ lifetime `'a` required
 
diff --git a/src/test/ui/lifetime-errors/ex2a-push-one-existing-name-2.nll.stderr b/src/test/ui/lifetime-errors/ex2a-push-one-existing-name-2.nll.stderr
index 087c9eb389b..d9c96a0e47c 100644
--- a/src/test/ui/lifetime-errors/ex2a-push-one-existing-name-2.nll.stderr
+++ b/src/test/ui/lifetime-errors/ex2a-push-one-existing-name-2.nll.stderr
@@ -8,7 +8,7 @@ error[E0621]: explicit lifetime required in the type of `x`
   --> $DIR/ex2a-push-one-existing-name-2.rs:16:5
    |
 LL | fn foo<'a>(x: Ref<i32>, y: &mut Vec<Ref<'a, i32>>) {
-   |            - consider changing the type of `x` to `Ref<'a, i32>`
+   |               -------- help: consider changing the type of `x` to : `Ref<'a, i32>`
 LL |     y.push(x); //~ ERROR explicit lifetime
    |     ^^^^^^^^^ lifetime `'a` required
 
diff --git a/src/test/ui/lifetime-errors/ex2a-push-one-existing-name-2.stderr b/src/test/ui/lifetime-errors/ex2a-push-one-existing-name-2.stderr
index 5c9b7666de6..d6944cc251f 100644
--- a/src/test/ui/lifetime-errors/ex2a-push-one-existing-name-2.stderr
+++ b/src/test/ui/lifetime-errors/ex2a-push-one-existing-name-2.stderr
@@ -2,7 +2,7 @@ error[E0621]: explicit lifetime required in the type of `x`
   --> $DIR/ex2a-push-one-existing-name-2.rs:16:12
    |
 LL | fn foo<'a>(x: Ref<i32>, y: &mut Vec<Ref<'a, i32>>) {
-   |            - consider changing the type of `x` to `Ref<'a, i32>`
+   |               -------- help: consider changing the type of `x` to : `Ref<'a, i32>`
 LL |     y.push(x); //~ ERROR explicit lifetime
    |            ^ lifetime `'a` required
 
diff --git a/src/test/ui/lifetime-errors/ex2a-push-one-existing-name-early-bound.stderr b/src/test/ui/lifetime-errors/ex2a-push-one-existing-name-early-bound.stderr
index 4cfb76f85f2..d6724607669 100644
--- a/src/test/ui/lifetime-errors/ex2a-push-one-existing-name-early-bound.stderr
+++ b/src/test/ui/lifetime-errors/ex2a-push-one-existing-name-early-bound.stderr
@@ -2,7 +2,7 @@ error[E0621]: explicit lifetime required in the type of `y`
   --> $DIR/ex2a-push-one-existing-name-early-bound.rs:17:12
    |
 LL | fn baz<'a, 'b, T>(x: &mut Vec<&'a T>, y: &T)
-   |                                       - consider changing the type of `y` to `&'a T`
+   |                                          -- help: consider changing the type of `y` to : `&'a T`
 ...
 LL |     x.push(y); //~ ERROR explicit lifetime required
    |            ^ lifetime `'a` required
diff --git a/src/test/ui/lifetime-errors/ex2a-push-one-existing-name.nll.stderr b/src/test/ui/lifetime-errors/ex2a-push-one-existing-name.nll.stderr
index 80192af2217..d08a9d6084a 100644
--- a/src/test/ui/lifetime-errors/ex2a-push-one-existing-name.nll.stderr
+++ b/src/test/ui/lifetime-errors/ex2a-push-one-existing-name.nll.stderr
@@ -8,7 +8,7 @@ error[E0621]: explicit lifetime required in the type of `y`
   --> $DIR/ex2a-push-one-existing-name.rs:16:5
    |
 LL | fn foo<'a>(x: &mut Vec<Ref<'a, i32>>, y: Ref<i32>) {
-   |                                       - consider changing the type of `y` to `Ref<'a, i32>`
+   |                                          -------- help: consider changing the type of `y` to : `Ref<'a, i32>`
 LL |     x.push(y); //~ ERROR explicit lifetime
    |     ^^^^^^^^^ lifetime `'a` required
 
diff --git a/src/test/ui/lifetime-errors/ex2a-push-one-existing-name.stderr b/src/test/ui/lifetime-errors/ex2a-push-one-existing-name.stderr
index ede76bca2ba..088605a2b85 100644
--- a/src/test/ui/lifetime-errors/ex2a-push-one-existing-name.stderr
+++ b/src/test/ui/lifetime-errors/ex2a-push-one-existing-name.stderr
@@ -2,7 +2,7 @@ error[E0621]: explicit lifetime required in the type of `y`
   --> $DIR/ex2a-push-one-existing-name.rs:16:12
    |
 LL | fn foo<'a>(x: &mut Vec<Ref<'a, i32>>, y: Ref<i32>) {
-   |                                       - consider changing the type of `y` to `Ref<'a, i32>`
+   |                                          -------- help: consider changing the type of `y` to : `Ref<'a, i32>`
 LL |     x.push(y); //~ ERROR explicit lifetime
    |            ^ lifetime `'a` required