summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/as_ptr_cast_mut.stderr
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/clippy/tests/ui/as_ptr_cast_mut.stderr')
-rw-r--r--src/tools/clippy/tests/ui/as_ptr_cast_mut.stderr16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/ui/as_ptr_cast_mut.stderr b/src/tools/clippy/tests/ui/as_ptr_cast_mut.stderr
new file mode 100644
index 000000000..2189c3d2f
--- /dev/null
+++ b/src/tools/clippy/tests/ui/as_ptr_cast_mut.stderr
@@ -0,0 +1,16 @@
+error: casting the result of `as_ptr` to *mut u8
+ --> $DIR/as_ptr_cast_mut.rs:21:13
+ |
+LL | let _ = string.as_ptr() as *mut u8;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `string.as_mut_ptr()`
+ |
+ = note: `-D clippy::as-ptr-cast-mut` implied by `-D warnings`
+
+error: casting the result of `as_ptr` to *mut i8
+ --> $DIR/as_ptr_cast_mut.rs:22:22
+ |
+LL | let _: *mut i8 = string.as_ptr() as *mut _;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `string.as_mut_ptr()`
+
+error: aborting due to 2 previous errors
+