remove random newlines from error messages, fix compile-fail test
That kind of formatting seems like the job of other code.
This commit is contained in:
parent
d7bb575b06
commit
9e4649ebf8
7 changed files with 10 additions and 15 deletions
|
|
@ -114,15 +114,15 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
|
|||
(Some(ret_span), _) => {
|
||||
(ty_sub.span,
|
||||
ret_span,
|
||||
format!("this parameter and the return type are declared
|
||||
with different lifetimes...",),
|
||||
format!("this parameter and the return type are declared \
|
||||
with different lifetimes...",),
|
||||
format!("...but data{} is returned here", span_label_var1))
|
||||
}
|
||||
(_, Some(ret_span)) => {
|
||||
(ty_sup.span,
|
||||
ret_span,
|
||||
format!("this parameter and the return type are declared
|
||||
with different lifetimes...",),
|
||||
format!("this parameter and the return type are declared \
|
||||
with different lifetimes...",),
|
||||
format!("...but data{} is returned here", span_label_var1))
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ fn load1<'a,'b>(a: &'a MyBox<SomeTrait>,
|
|||
b: &'b MyBox<SomeTrait>)
|
||||
-> &'b MyBox<SomeTrait>
|
||||
{
|
||||
a //~ ERROR E0312
|
||||
a //~ ERROR lifetime mismatch
|
||||
}
|
||||
|
||||
fn load2<'a>(ss: &MyBox<SomeTrait+'a>) -> MyBox<SomeTrait+'a> {
|
||||
|
|
|
|||
|
|
@ -4,8 +4,7 @@ error[E0623]: lifetime mismatch
|
|||
19 | fn foo<'a>(x: &i32, y: &'a i32) -> &'a i32 {
|
||||
| ---- -------
|
||||
| |
|
||||
| this parameter and the return type are declared
|
||||
with different lifetimes...
|
||||
| this parameter and the return type are declared with different lifetimes...
|
||||
20 |
|
||||
21 | if x > y { x } else { y }
|
||||
| ^ ...but data from `x` is returned here
|
||||
|
|
|
|||
|
|
@ -4,8 +4,7 @@ error[E0623]: lifetime mismatch
|
|||
16 | fn foo<'a>(&self, x: &'a i32) -> &i32 {
|
||||
| ------- ----
|
||||
| |
|
||||
| this parameter and the return type are declared
|
||||
with different lifetimes...
|
||||
| this parameter and the return type are declared with different lifetimes...
|
||||
17 |
|
||||
18 | x
|
||||
| ^ ...but data from `x` is returned here
|
||||
|
|
|
|||
|
|
@ -4,8 +4,7 @@ error[E0623]: lifetime mismatch
|
|||
16 | fn foo<'a>(&self, x: &'a Foo) -> &'a Foo {
|
||||
| ----- -------
|
||||
| |
|
||||
| this parameter and the return type are declared
|
||||
with different lifetimes...
|
||||
| this parameter and the return type are declared with different lifetimes...
|
||||
17 |
|
||||
18 | if true { x } else { self }
|
||||
| ^^^^ ...but data from `self` is returned here
|
||||
|
|
|
|||
|
|
@ -4,8 +4,7 @@ error[E0623]: lifetime mismatch
|
|||
16 | fn foo<'a>(&self, x: &i32) -> &i32 {
|
||||
| ---- ----
|
||||
| |
|
||||
| this parameter and the return type are declared
|
||||
with different lifetimes...
|
||||
| this parameter and the return type are declared with different lifetimes...
|
||||
17 | x
|
||||
| ^ ...but data from `x` is returned here
|
||||
|
||||
|
|
|
|||
|
|
@ -4,8 +4,7 @@ error[E0623]: lifetime mismatch
|
|||
16 | fn foo<'a>(&self, x: &Foo) -> &Foo {
|
||||
| ---- ----
|
||||
| |
|
||||
| this parameter and the return type are declared
|
||||
with different lifetimes...
|
||||
| this parameter and the return type are declared with different lifetimes...
|
||||
17 | if true { x } else { self }
|
||||
| ^ ...but data from `x` is returned here
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue