Skip to content

Commit

Permalink
Move E0594 to new error code system
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Nov 18, 2019
1 parent cd13335 commit c981c99
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2,578 deletions.
2 changes: 1 addition & 1 deletion src/librustc_error_codes/error_codes.rs
Expand Up @@ -318,6 +318,7 @@ E0590: include_str!("./error_codes/E0590.md"),
E0591: include_str!("./error_codes/E0591.md"),
E0592: include_str!("./error_codes/E0592.md"),
E0593: include_str!("./error_codes/E0593.md"),
E0594: include_str!("./error_codes/E0594.md"),
E0595: include_str!("./error_codes/E0595.md"),
E0596: include_str!("./error_codes/E0596.md"),
E0597: include_str!("./error_codes/E0597.md"),
Expand Down Expand Up @@ -566,7 +567,6 @@ E0744: include_str!("./error_codes/E0744.md"),
// E0563, // cannot determine a type for this `impl Trait` removed in 6383de15
// E0564, // only named lifetimes are allowed in `impl Trait`,
// but `{}` was found in the type `{}`
E0594, // cannot assign to {}
// E0598, // lifetime of {} is too short to guarantee its contents can be...
// E0611, // merged into E0616
// E0612, // merged into E0609
Expand Down
23 changes: 23 additions & 0 deletions src/librustc_error_codes/error_codes/E0594.md
@@ -0,0 +1,23 @@
A non-mutable value was assigned a value.

Erroneous code example:

```compile_fail,E0594
struct SolarSystem {
earth: i32,
}
let ss = SolarSystem { earth: 3 };
ss.earth = 2; // error!
```

To fix this error, declare `ss` as mutable by using the `mut` keyword:

```
struct SolarSystem {
earth: i32,
}
let mut ss = SolarSystem { earth: 3 }; // declaring `ss` as mutable
ss.earth = 2; // ok!
```

0 comments on commit c981c99

Please sign in to comment.