Skip to content

Commit 86db16b

Browse files
---
yaml --- r: 225975 b: refs/heads/stable c: 04888e7 h: refs/heads/master i: 225973: 0964ede 225971: 0379f25 225967: 290b3dc v: v3
1 parent 1f6e554 commit 86db16b

File tree

2 files changed

+35
-1
lines changed

2 files changed

+35
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ refs/heads/tmp: e5d90d98402475b6e154ce216f9efcb80da1a747
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: 1fe32ca12c51afcd761d9962f51a74ff0d07a591
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32-
refs/heads/stable: 00e115d090180c9fe13856500576978ff3007cda
32+
refs/heads/stable: 04888e7c600fed71d989937cc8f582bea83423a2
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375
3434
refs/tags/1.1.0: bc3c16f09287e5545c1d3f76b7abd54f2eca868b

branches/stable/src/librustc_typeck/diagnostics.rs

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,40 @@ Reference:
211211
http://doc.rust-lang.org/reference.html#trait-objects
212212
"##,
213213

214+
E0035: r##"
215+
You tried to give a type parameter where it wasn't needed. Bad example:
216+
217+
```
218+
struct Test;
219+
220+
impl Test {
221+
fn method(&self) {}
222+
}
223+
224+
fn main() {
225+
let x = Test;
226+
227+
x.method::<i32>(); // Error: Test::method doesn't need type parameter!
228+
}
229+
```
230+
231+
To fix this error, just remove the type parameter:
232+
233+
```
234+
struct Test;
235+
236+
impl Test {
237+
fn method(&self) {}
238+
}
239+
240+
fn main() {
241+
let x = Test;
242+
243+
x.method(); // OK, we're good!
244+
}
245+
```
246+
"##,
247+
214248
E0036: r##"
215249
This error occurrs when you pass too many or not enough type parameters to
216250
a method. Example:

0 commit comments

Comments
 (0)