summaryrefslogtreecommitdiffstats
path: root/src/test/ui/coercion/coerce-mut.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/coercion/coerce-mut.rs')
-rw-r--r--src/test/ui/coercion/coerce-mut.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/test/ui/coercion/coerce-mut.rs b/src/test/ui/coercion/coerce-mut.rs
new file mode 100644
index 000000000..43f0b5585
--- /dev/null
+++ b/src/test/ui/coercion/coerce-mut.rs
@@ -0,0 +1,10 @@
+fn f(x: &mut i32) {}
+
+fn main() {
+ let x = 0;
+ f(&x);
+ //~^ ERROR mismatched types
+ //~| expected mutable reference `&mut i32`
+ //~| found reference `&{integer}`
+ //~| types differ in mutability
+}