about summary refs log tree commit diff
path: root/tests/ui/coercion/ptr-mutability-errors.stderr
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/coercion/ptr-mutability-errors.stderr')
-rw-r--r--tests/ui/coercion/ptr-mutability-errors.stderr36
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/ui/coercion/ptr-mutability-errors.stderr b/tests/ui/coercion/ptr-mutability-errors.stderr
new file mode 100644
index 00000000000..8de41d2c382
--- /dev/null
+++ b/tests/ui/coercion/ptr-mutability-errors.stderr
@@ -0,0 +1,36 @@
+error[E0308]: mismatched types
+  --> $DIR/ptr-coercion.rs:9:25
+   |
+LL |     let x: *mut isize = x;
+   |            ----------   ^ types differ in mutability
+   |            |
+   |            expected due to this
+   |
+   = note: expected raw pointer `*mut isize`
+              found raw pointer `*const isize`
+
+error[E0308]: mismatched types
+  --> $DIR/ptr-coercion.rs:15:25
+   |
+LL |     let x: *mut isize = &42;
+   |            ----------   ^^^ types differ in mutability
+   |            |
+   |            expected due to this
+   |
+   = note: expected raw pointer `*mut isize`
+                found reference `&isize`
+
+error[E0308]: mismatched types
+  --> $DIR/ptr-coercion.rs:21:25
+   |
+LL |     let x: *mut isize = x;
+   |            ----------   ^ types differ in mutability
+   |            |
+   |            expected due to this
+   |
+   = note: expected raw pointer `*mut isize`
+              found raw pointer `*const isize`
+
+error: aborting due to 3 previous errors
+
+For more information about this error, try `rustc --explain E0308`.