File tree Expand file tree Collapse file tree 2 files changed +12
-25
lines changed
branches/stable/src/librustc_typeck Expand file tree Collapse file tree 2 files changed +12
-25
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,6 @@ refs/heads/tmp: e5d90d98402475b6e154ce216f9efcb80da1a747
29
29
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
30
30
refs/tags/homu-tmp: 1fe32ca12c51afcd761d9962f51a74ff0d07a591
31
31
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32
- refs/heads/stable: d50fa7eff56e6d2b4daae4cf835dc8133b235c35
32
+ refs/heads/stable: 35d979d8f8bb63b6063e30954c7c71ddf863b380
33
33
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375
34
34
refs/tags/1.1.0: bc3c16f09287e5545c1d3f76b7abd54f2eca868b
Original file line number Diff line number Diff line change @@ -65,40 +65,27 @@ impl Foo for Bar {
65
65
"## ,
66
66
67
67
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.
70
70
71
- Here's an example where the mutability of the `self` parameter is wrong :
71
+ Here are a couple examples of this error :
72
72
73
73
```
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);
81
77
}
82
78
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
-
91
79
struct Bar;
92
80
93
81
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) { }
97
84
98
- fn main() {}
85
+ // error, values differ in mutability
86
+ fn foo(&mut self) { }
87
+ }
99
88
```
100
-
101
-
102
89
"## ,
103
90
104
91
E0054 : r##"
You can’t perform that action at this time.
0 commit comments