Skip to content

Commit 9e4649e

Browse files
committed
remove random newlines from error messages, fix compile-fail test
That kind of formatting seems like the job of other code.
1 parent d7bb575 commit 9e4649e

7 files changed

+10
-15
lines changed

src/librustc/infer/error_reporting/different_lifetimes.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -114,15 +114,15 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
114114
(Some(ret_span), _) => {
115115
(ty_sub.span,
116116
ret_span,
117-
format!("this parameter and the return type are declared
118-
with different lifetimes...",),
117+
format!("this parameter and the return type are declared \
118+
with different lifetimes...",),
119119
format!("...but data{} is returned here", span_label_var1))
120120
}
121121
(_, Some(ret_span)) => {
122122
(ty_sup.span,
123123
ret_span,
124-
format!("this parameter and the return type are declared
125-
with different lifetimes...",),
124+
format!("this parameter and the return type are declared \
125+
with different lifetimes...",),
126126
format!("...but data{} is returned here", span_label_var1))
127127
}
128128
};

src/test/compile-fail/object-lifetime-default-mybox.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ fn load1<'a,'b>(a: &'a MyBox<SomeTrait>,
3434
b: &'b MyBox<SomeTrait>)
3535
-> &'b MyBox<SomeTrait>
3636
{
37-
a //~ ERROR E0312
37+
a //~ ERROR lifetime mismatch
3838
}
3939

4040
fn load2<'a>(ss: &MyBox<SomeTrait+'a>) -> MyBox<SomeTrait+'a> {

src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl.stderr

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ error[E0623]: lifetime mismatch
44
19 | fn foo<'a>(x: &i32, y: &'a i32) -> &'a i32 {
55
| ---- -------
66
| |
7-
| this parameter and the return type are declared
8-
with different lifetimes...
7+
| this parameter and the return type are declared with different lifetimes...
98
20 |
109
21 | if x > y { x } else { y }
1110
| ^ ...but data from `x` is returned here

src/test/ui/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.stderr

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ error[E0623]: lifetime mismatch
44
16 | fn foo<'a>(&self, x: &'a i32) -> &i32 {
55
| ------- ----
66
| |
7-
| this parameter and the return type are declared
8-
with different lifetimes...
7+
| this parameter and the return type are declared with different lifetimes...
98
17 |
109
18 | x
1110
| ^ ...but data from `x` is returned here

src/test/ui/lifetime-errors/ex1-return-one-existing-name-self-is-anon.stderr

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ error[E0623]: lifetime mismatch
44
16 | fn foo<'a>(&self, x: &'a Foo) -> &'a Foo {
55
| ----- -------
66
| |
7-
| this parameter and the return type are declared
8-
with different lifetimes...
7+
| this parameter and the return type are declared with different lifetimes...
98
17 |
109
18 | if true { x } else { self }
1110
| ^^^^ ...but data from `self` is returned here

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

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ error[E0623]: lifetime mismatch
44
16 | fn foo<'a>(&self, x: &i32) -> &i32 {
55
| ---- ----
66
| |
7-
| this parameter and the return type are declared
8-
with different lifetimes...
7+
| this parameter and the return type are declared with different lifetimes...
98
17 | x
109
| ^ ...but data from `x` is returned here
1110

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

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ error[E0623]: lifetime mismatch
44
16 | fn foo<'a>(&self, x: &Foo) -> &Foo {
55
| ---- ----
66
| |
7-
| this parameter and the return type are declared
8-
with different lifetimes...
7+
| this parameter and the return type are declared with different lifetimes...
98
17 | if true { x } else { self }
109
| ^ ...but data from `x` is returned here
1110

0 commit comments

Comments
 (0)