File tree Expand file tree Collapse file tree 2 files changed +3
-7
lines changed Expand file tree Collapse file tree 2 files changed +3
-7
lines changed Original file line number Diff line number Diff line change 2
2
#![ allow( clippy:: no_effect) ]
3
3
4
4
extern "C" {
5
- #[ rustfmt:: skip]
6
- // TODO: This `rustfmt::skip` is a work around of #6336 because
7
- // the following comments are checked by rustfmt for some reason.
8
- //
9
5
// N.B., mutability can be easily incorrect in FFI calls -- as
10
6
// in C, the default is mutable pointers.
11
7
fn ffi ( c : * mut u8 ) ;
Original file line number Diff line number Diff line change 1
1
error: casting `&T` to `&mut T` may cause undefined behavior, consider instead using an `UnsafeCell`
2
- --> $DIR/cast_ref_to_mut.rs:22 :9
2
+ --> $DIR/cast_ref_to_mut.rs:18 :9
3
3
|
4
4
LL | (*(a as *const _ as *mut String)).push_str(" world");
5
5
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6
6
|
7
7
= note: `-D clippy::cast-ref-to-mut` implied by `-D warnings`
8
8
9
9
error: casting `&T` to `&mut T` may cause undefined behavior, consider instead using an `UnsafeCell`
10
- --> $DIR/cast_ref_to_mut.rs:23 :9
10
+ --> $DIR/cast_ref_to_mut.rs:19 :9
11
11
|
12
12
LL | *(a as *const _ as *mut _) = String::from("Replaced");
13
13
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
14
14
15
15
error: casting `&T` to `&mut T` may cause undefined behavior, consider instead using an `UnsafeCell`
16
- --> $DIR/cast_ref_to_mut.rs:24 :9
16
+ --> $DIR/cast_ref_to_mut.rs:20 :9
17
17
|
18
18
LL | *(a as *const _ as *mut String) += " world";
19
19
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
You can’t perform that action at this time.
0 commit comments