Closed
Description
This code:
use std::rt::io;
fn foo(a: &mut io::Writer) {
a.write([])
}
fn main(){}
Yields this error:
foo.rs:4:4: 4:5 error: cannot borrow immutable argument as mutable
foo.rs:4 a.write([])
^
error: aborting due to previous error
Which doesn't make sense to me because a
shouldn't have to be mutable because it's already a pointer to a mutable thing (which is what io::Writer
wants)
cc @msullivan