Closed
Description
rustc 1.0.0-nightly (2b01a37 2015-02-21) (built 2015-02-22)
I create file with content:
use std::hash::SipHasher;
use std::hash::Hasher;
fn main() {
}
fn compile_fail() {
let hasher = SipHasher::new();
hasher.write(&[0, 1, 2]);
}
fn compile_work() {
let sip_hasher = SipHasher::new();
let hasher: &mut Hasher = &mut sip_hasher;
hasher.write(&[0, 1, 2]);
}
And have compilation errors:
private.rs:9:2: 9:26 error: method `write` is private
private.rs:9 hasher.write(&[0, 1, 2]);
^~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
I do not understand what is happening due to this error, because this cast is essentially doing nothing.