about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2017-07-29 19:41:53 +0000
committerbors <bors@rust-lang.org>2017-07-29 19:41:53 +0000
commitcfe1668ca3ddb3dc57b1af319e258a16664486fa (patch)
treea2c7d99d2a919903b2e75ef4d54d6015c8c3fbdf
parentad36f8febad77942b4f1f0e2ba0f422b69276d7b (diff)
parentcb93cc62999eda4145a878f26e3fe912b2dcbb22 (diff)
downloadrust-cfe1668ca3ddb3dc57b1af319e258a16664486fa.tar.gz
rust-cfe1668ca3ddb3dc57b1af319e258a16664486fa.zip
Auto merge of #43541 - gaurikholkar:lifetime_errors, r=nikomatsakis
Changing E0623 error message - both anonymous lifetime regions

Changing the error message to
```
error[E0623]: lifetime mismatch
  --> $DIR/ex3-both-anon-regions.rs:12:12
   |
11 | fn foo(x: &mut Vec<&u8>, y: &u8) {
   |                    ---      --- these references are not declared with the same lifetime...
12 |     x.push(y);
   |            ^ ...but data from `y` flows into `x` here

error: aborting due to previous error
```
cc @nikomatsakis @aturon @jonathandturner

r? @nikomatsakis
-rw-r--r--src/librustc/infer/error_reporting/anon_anon_conflict.rs4
-rw-r--r--src/test/ui/lifetime-errors/ex3-both-anon-regions-2.stderr4
-rw-r--r--src/test/ui/lifetime-errors/ex3-both-anon-regions-3.stderr4
-rw-r--r--src/test/ui/lifetime-errors/ex3-both-anon-regions-4.stderr8
-rw-r--r--src/test/ui/lifetime-errors/ex3-both-anon-regions.stderr4
5 files changed, 12 insertions, 12 deletions
diff --git a/src/librustc/infer/error_reporting/anon_anon_conflict.rs b/src/librustc/infer/error_reporting/anon_anon_conflict.rs
index 1017f2bd0e6..2e910968818 100644
--- a/src/librustc/infer/error_reporting/anon_anon_conflict.rs
+++ b/src/librustc/infer/error_reporting/anon_anon_conflict.rs
@@ -77,10 +77,10 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
 
             struct_span_err!(self.tcx.sess, span, E0623, "lifetime mismatch")
                 .span_label(ty1.span,
-                            format!("these references must have the same lifetime"))
+                            format!("these references are not declared with the same lifetime..."))
                 .span_label(ty2.span, format!(""))
                 .span_label(span,
-                            format!("data{}flows{}here", span_label_var1, span_label_var2))
+                            format!("...but data{}flows{}here", span_label_var1, span_label_var2))
                 .emit();
         } else {
             return false;
diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-2.stderr b/src/test/ui/lifetime-errors/ex3-both-anon-regions-2.stderr
index 8dd906afdc4..4c878f3c0dc 100644
--- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-2.stderr
+++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-2.stderr
@@ -2,9 +2,9 @@ error[E0623]: lifetime mismatch
   --> $DIR/ex3-both-anon-regions-2.rs:12:9
    |
 11 | fn foo((v, w): (&u8, &u8), x: &u8) {
-   |                 ---           --- these references must have the same lifetime
+   |                 ---           --- these references are not declared with the same lifetime...
 12 |     v = x;
-   |         ^ data from `x` flows here
+   |         ^ ...but data from `x` flows here
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-3.stderr b/src/test/ui/lifetime-errors/ex3-both-anon-regions-3.stderr
index 66c3ca45499..08506b8befa 100644
--- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-3.stderr
+++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-3.stderr
@@ -2,9 +2,9 @@ error[E0623]: lifetime mismatch
   --> $DIR/ex3-both-anon-regions-3.rs:12:9
    |
 11 | fn foo((v, w): (&u8, &u8), (x, y): (&u8, &u8)) {
-   |                 ---                 --- these references must have the same lifetime
+   |                 ---                 --- these references are not declared with the same lifetime...
 12 |     v = x;
-   |         ^ data flows here
+   |         ^ ...but data flows here
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-4.stderr b/src/test/ui/lifetime-errors/ex3-both-anon-regions-4.stderr
index b969797b374..9c2630fc811 100644
--- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-4.stderr
+++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-4.stderr
@@ -4,17 +4,17 @@ error[E0623]: lifetime mismatch
   --> $DIR/ex3-both-anon-regions-4.rs:12:13
    |
 11 | fn foo(z: &mut Vec<(&u8,&u8)>, (x, y): (&u8, &u8)) {
-   |                     ---                 --- these references must have the same lifetime
+   |                     ---                 --- these references are not declared with the same lifetime...
 12 |     z.push((x,y));
-   |             ^ data flows into `z` here
+   |             ^ ...but data flows into `z` here
 
 error[E0623]: lifetime mismatch
   --> $DIR/ex3-both-anon-regions-4.rs:12:15
    |
 11 | fn foo(z: &mut Vec<(&u8,&u8)>, (x, y): (&u8, &u8)) {
-   |                         ---                  --- these references must have the same lifetime
+   |                         ---                  --- these references are not declared with the same lifetime...
 12 |     z.push((x,y));
-   |               ^ data flows into `z` here
+   |               ^ ...but data flows into `z` here
 
 error: aborting due to 3 previous errors
 
diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions.stderr b/src/test/ui/lifetime-errors/ex3-both-anon-regions.stderr
index e38e2ef07ad..a183d1fffc0 100644
--- a/src/test/ui/lifetime-errors/ex3-both-anon-regions.stderr
+++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions.stderr
@@ -2,9 +2,9 @@ error[E0623]: lifetime mismatch
   --> $DIR/ex3-both-anon-regions.rs:12:12
    |
 11 | fn foo(x: &mut Vec<&u8>, y: &u8) {
-   |                    ---      --- these references must have the same lifetime
+   |                    ---      --- these references are not declared with the same lifetime...
 12 |     x.push(y);
-   |            ^ data from `y` flows into `x` here
+   |            ^ ...but data from `y` flows into `x` here
 
 error: aborting due to previous error