rust/tests/ui/coercion/coerce-mut.rs

11 lines
215 B
Rust
Raw Normal View History

2015-01-20 13:56:53 +00:00
fn f(x: &mut i32) {}
fn main() {
let x = 0;
f(&x);
//~^ ERROR mismatched types
//~| expected mutable reference `&mut i32`
//~| found reference `&{integer}`
2016-08-19 23:05:37 +00:00
//~| types differ in mutability
2015-01-20 13:56:53 +00:00
}