mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 23:34:48 +00:00
8 lines
229 B
Rust
8 lines
229 B
Rust
static buf: &mut [u8] = &mut [1u8,2,3,4,5,7]; //~ ERROR mutable references are not allowed
|
|
fn write<T: AsRef<[u8]>>(buffer: T) { }
|
|
|
|
fn main() {
|
|
write(&buf);
|
|
buf[0]=2; //~ ERROR E0594
|
|
}
|