Skip to content

Commit a3e88de

Browse files
---
yaml --- r: 226199 b: refs/heads/snap-stage3 c: 8a75dcd h: refs/heads/master i: 226197: a45b881 226195: 6a70a60 226191: 2d9d9dc v: v3
1 parent b294e12 commit a3e88de

File tree

2 files changed

+44
-2
lines changed

2 files changed

+44
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
refs/heads/master: e5d90d98402475b6e154ce216f9efcb80da1a747
3-
refs/heads/snap-stage3: d6b9e0bed95fb747d40c81f53f8c5015f2df97be
3+
refs/heads/snap-stage3: 8a75dcdadfe8c3657c5a6f085a984e1c97b48910
44
refs/heads/try: b53c0f93eedcdedd4fd89bccc5a3a09d1c5cd23e
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
66
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/snap-stage3/src/librustc_resolve/diagnostics.rs

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,49 @@ match 0 {
424424
```
425425
"##,
426426

427+
E0424: r##"
428+
`self` keyword was used in a static method. Example of erroneous code:
429+
430+
```
431+
struct Foo;
432+
433+
impl Foo {
434+
fn bar(self) {}
435+
436+
fn foo() {
437+
self.bar(); // error: `self` is not available in a static method.
438+
}
439+
}
440+
```
441+
442+
Please verify you didn't forget to add `self` in your method's argument
443+
list if your intention wasn't to create a static method. Example:
444+
445+
```
446+
struct Foo;
447+
448+
impl Foo {
449+
fn bar(self) {}
450+
451+
fn foo(self) {
452+
self.bar(); // ok!
453+
}
454+
}
455+
```
456+
457+
Or please verify you didn't misspell the variable's name:
458+
459+
```
460+
struct Foo;
461+
462+
impl Foo {
463+
fn foo(sel: i32) {
464+
println!("{}", sel); // ok!
465+
}
466+
}
467+
```
468+
"##,
469+
427470
E0428: r##"
428471
A type or module has been defined more than once. Example of erroneous
429472
code:
@@ -482,7 +525,6 @@ register_diagnostics! {
482525
E0422, // does not name a structure
483526
E0423, // is a struct variant name, but this expression uses it like a
484527
// function name
485-
E0424, // `self` is not available in a static method.
486528
E0425, // unresolved name
487529
E0426, // use of undeclared label
488530
E0427, // cannot use `ref` binding mode with ...

0 commit comments

Comments
 (0)