Skip to content

Commit cfe1668

Browse files
committed
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
2 parents ad36f8f + cb93cc6 commit cfe1668

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

src/librustc/infer/error_reporting/anon_anon_conflict.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,10 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
7777

7878
struct_span_err!(self.tcx.sess, span, E0623, "lifetime mismatch")
7979
.span_label(ty1.span,
80-
format!("these references must have the same lifetime"))
80+
format!("these references are not declared with the same lifetime..."))
8181
.span_label(ty2.span, format!(""))
8282
.span_label(span,
83-
format!("data{}flows{}here", span_label_var1, span_label_var2))
83+
format!("...but data{}flows{}here", span_label_var1, span_label_var2))
8484
.emit();
8585
} else {
8686
return false;

src/test/ui/lifetime-errors/ex3-both-anon-regions-2.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ error[E0623]: lifetime mismatch
22
--> $DIR/ex3-both-anon-regions-2.rs:12:9
33
|
44
11 | fn foo((v, w): (&u8, &u8), x: &u8) {
5-
| --- --- these references must have the same lifetime
5+
| --- --- these references are not declared with the same lifetime...
66
12 | v = x;
7-
| ^ data from `x` flows here
7+
| ^ ...but data from `x` flows here
88

99
error: aborting due to previous error
1010

src/test/ui/lifetime-errors/ex3-both-anon-regions-3.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ error[E0623]: lifetime mismatch
22
--> $DIR/ex3-both-anon-regions-3.rs:12:9
33
|
44
11 | fn foo((v, w): (&u8, &u8), (x, y): (&u8, &u8)) {
5-
| --- --- these references must have the same lifetime
5+
| --- --- these references are not declared with the same lifetime...
66
12 | v = x;
7-
| ^ data flows here
7+
| ^ ...but data flows here
88

99
error: aborting due to previous error
1010

src/test/ui/lifetime-errors/ex3-both-anon-regions-4.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@ error[E0623]: lifetime mismatch
44
--> $DIR/ex3-both-anon-regions-4.rs:12:13
55
|
66
11 | fn foo(z: &mut Vec<(&u8,&u8)>, (x, y): (&u8, &u8)) {
7-
| --- --- these references must have the same lifetime
7+
| --- --- these references are not declared with the same lifetime...
88
12 | z.push((x,y));
9-
| ^ data flows into `z` here
9+
| ^ ...but data flows into `z` here
1010

1111
error[E0623]: lifetime mismatch
1212
--> $DIR/ex3-both-anon-regions-4.rs:12:15
1313
|
1414
11 | fn foo(z: &mut Vec<(&u8,&u8)>, (x, y): (&u8, &u8)) {
15-
| --- --- these references must have the same lifetime
15+
| --- --- these references are not declared with the same lifetime...
1616
12 | z.push((x,y));
17-
| ^ data flows into `z` here
17+
| ^ ...but data flows into `z` here
1818

1919
error: aborting due to 3 previous errors
2020

src/test/ui/lifetime-errors/ex3-both-anon-regions.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ error[E0623]: lifetime mismatch
22
--> $DIR/ex3-both-anon-regions.rs:12:12
33
|
44
11 | fn foo(x: &mut Vec<&u8>, y: &u8) {
5-
| --- --- these references must have the same lifetime
5+
| --- --- these references are not declared with the same lifetime...
66
12 | x.push(y);
7-
| ^ data from `y` flows into `x` here
7+
| ^ ...but data from `y` flows into `x` here
88

99
error: aborting due to previous error
1010

0 commit comments

Comments
 (0)