Skip to content

Commit 9e71b17

Browse files
author
Nick Hamann
committed
---
yaml --- r: 211341 b: refs/heads/tmp c: 35d979d h: refs/heads/master i: 211339: b624dfe v: v3
1 parent 95916f1 commit 9e71b17

File tree

2 files changed

+12
-25
lines changed

2 files changed

+12
-25
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
3232
refs/heads/beta: 2d00dc3b85aaf81caa3a4e5764c5e185a4dd0a7c
3333
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
3434
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
35-
refs/heads/tmp: d50fa7eff56e6d2b4daae4cf835dc8133b235c35
35+
refs/heads/tmp: 35d979d8f8bb63b6063e30954c7c71ddf863b380
3636
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3737
refs/tags/homu-tmp: 704c2ee730d2e948d11a2edd77e3f35de8329a6e
3838
refs/heads/gate: 97c84447b65164731087ea82685580cc81424412

branches/tmp/src/librustc_typeck/diagnostics.rs

Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -65,40 +65,27 @@ impl Foo for Bar {
6565
"##,
6666

6767
E0053: r##"
68-
For any given method of a trait, the mutabilities of the parameters must match
69-
between the trait definition and the implementation.
68+
The parameters of any trait method must match between a trait implementation
69+
and the trait definition.
7070
71-
Here's an example where the mutability of the `self` parameter is wrong:
71+
Here are a couple examples of this error:
7272
7373
```
74-
trait Foo { fn foo(&self); }
75-
76-
struct Bar;
77-
78-
impl Foo for Bar {
79-
// error, the signature should be `fn foo(&self)` instead
80-
fn foo(&mut self) { }
74+
trait Foo {
75+
fn foo(x: u16);
76+
fn bar(&self);
8177
}
8278
83-
fn main() {}
84-
```
85-
86-
Here's another example, this time for a non-`self` parameter:
87-
88-
```
89-
trait Foo { fn foo(x: &mut bool) -> bool; }
90-
9179
struct Bar;
9280
9381
impl Foo for Bar {
94-
// error, the type of `x` should be `&mut bool` instead
95-
fn foo(x: &bool) -> bool { *x }
96-
}
82+
// error, expected u16, found i16
83+
fn foo(x: i16) { }
9784
98-
fn main() {}
85+
// error, values differ in mutability
86+
fn foo(&mut self) { }
87+
}
9988
```
100-
101-
10289
"##,
10390

10491
E0054: r##"

0 commit comments

Comments
 (0)