Skip to content

Commit

Permalink
Auto merge of rust-lang#27475 - AgostonSzepessy:master, r=alexcrichton
Browse files Browse the repository at this point in the history
  • Loading branch information
bors committed Aug 3, 2015
2 parents 2a309b7 + 74787b9 commit ea5cc76
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion src/librustc_borrowck/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,35 @@ fn main() {
To fix this, ensure that any declared variables are initialized before being
used.
"##,

E0384: r##"
This error occurs when an attempt is made to reassign an immutable variable.
For example:
```
fn main(){
let x = 3;
x = 5; // error, reassignment of immutable variable
}
```
By default, variables in Rust are immutable. To fix this error, add the keyword
`mut` after the keyword `let` when declaring the variable. For example:
```
fn main(){
let mut x = 3;
x = 5;
}
```
"##

}

register_diagnostics! {
E0382, // use of partially/collaterally moved value
E0383, // partial reinitialization of uninitialized structure
E0384, // reassignment of immutable variable
E0385, // {} in an aliasable location
E0386, // {} in an immutable container
E0387, // {} in a captured outer variable in an `Fn` closure
Expand Down

0 comments on commit ea5cc76

Please sign in to comment.