Closed
Description
The compiler reports the wrong error message in this sample (which I don't know whether should be errornous or not; I'm just learning Rust):
fn main() {
let a = @5; // immutable
let mut d = @mut 5; // mutable variable, mutable box
*d += 5; // error message about this line, though this is fine
d = a; // error doesn't appear if this isn't mentioned
io::println(fmt!("a, d:\t%d, %d", *a,*d));
}
The message reported is:
dhardy@L10036:~/code/small/rust$ rust run mut.rs
mut.rs:5:4: 5:6 error: assigning to dereference of const @ pointer
mut.rs:5 *d += 5;
^~
error: aborting due to previous error
I'm using the compiler from commit 5f13e9c.