Skip to content

Commit 33a30f2

Browse files
author
Nick Hamann
committed
Improve error explanations for E0049, E0050, E0166.
1 parent cbeda68 commit 33a30f2

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/librustc_typeck/diagnostics.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ but the implementation of `foo` for the type `Bar` is missing this parameter:
2828
2929
```
3030
trait Foo {
31-
fn foo<T: Default>(T) -> Self;
31+
fn foo<T: Default>(x: T) -> Self;
3232
}
3333
3434
struct Bar;
@@ -51,7 +51,7 @@ the `u8` parameter:
5151
5252
```
5353
trait Foo {
54-
fn foo(&self, u8) -> bool;
54+
fn foo(&self, x: u8) -> bool;
5555
}
5656
5757
struct Bar;
@@ -336,9 +336,9 @@ return type in its signature. For example:
336336
fn foo() -> ! { return; } // error
337337
```
338338
339-
For a function that diverges, every control path in the function must end
340-
with a call to `panic!()` or another diverging function. Attempting to return
341-
from a diverging function is an error.
339+
For a function that diverges, every control path in the function must never
340+
return, for example with a `loop` that never breaks or a call to another
341+
diverging function (such as `panic!()`).
342342
"##,
343343

344344
E0184: r##"

0 commit comments

Comments
 (0)