]> git.lizzy.rs Git - rust.git/blob - tests/ui/as_ptr_cast_mut.stderr
Add `as_ptr_cast_mut` lint
[rust.git] / tests / ui / as_ptr_cast_mut.stderr
1 error: casting the result of `as_ptr` to *mut u8
2   --> $DIR/as_ptr_cast_mut.rs:21:13
3    |
4 LL |     let _ = string.as_ptr() as *mut u8;
5    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `string.as_mut_ptr()`
6    |
7    = note: `-D clippy::as-ptr-cast-mut` implied by `-D warnings`
8
9 error: casting the result of `as_ptr` to *mut i8
10   --> $DIR/as_ptr_cast_mut.rs:22:22
11    |
12 LL |     let _: *mut i8 = string.as_ptr() as *mut _;
13    |                      ^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `string.as_mut_ptr()`
14
15 error: aborting due to 2 previous errors
16