Skip to content

Commit

Permalink
Fix typo and improve explanation
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Jul 23, 2015
1 parent 8a75dcd commit 0efc7f1
Showing 1 changed file with 8 additions and 18 deletions.
26 changes: 8 additions & 18 deletions src/librustc_resolve/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -410,9 +410,10 @@ match 0 {
}
```
Compiler needs to know the pattern value at compile's time, which is
not possible with a `static` variable. So please verify you didn't
misspell the variable's name or use a `const` instead. Example:
The compiler needs to know the value of the pattern at compile time,
which is not possible with a `static` variable. Please verify that the
variable is spelled correctly and if so, try to use a `const` instead.
Example:
```
const FOO : i32 = 0;
Expand All @@ -425,7 +426,7 @@ match 0 {
"##,

E0424: r##"
`self` keyword was used in a static method. Example of erroneous code:
The `self` keyword was used in a static method. Example of erroneous code:
```
struct Foo;
Expand All @@ -439,8 +440,9 @@ impl Foo {
}
```
Please verify you didn't forget to add `self` in your method's argument
list if your intention wasn't to create a static method. Example:
Please check if the method's argument list should have contained self,
&self, or &mut self (in case you didn't want to create a static method),
and add it if so. Example:
```
struct Foo;
Expand All @@ -453,18 +455,6 @@ impl Foo {
}
}
```
Or please verify you didn't misspell the variable's name:
```
struct Foo;
impl Foo {
fn foo(sel: i32) {
println!("{}", sel); // ok!
}
}
```
"##,

E0428: r##"
Expand Down

0 comments on commit 0efc7f1

Please sign in to comment.