File tree 2 files changed +7
-3
lines changed
2 files changed +7
-3
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
+ //
5
9
// N.B., mutability can be easily incorrect in FFI calls -- as
6
10
// in C, the default is mutable pointers.
7
11
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:18 :9
2
+ --> $DIR/cast_ref_to_mut.rs:22 :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:19 :9
10
+ --> $DIR/cast_ref_to_mut.rs:23 :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:20 :9
16
+ --> $DIR/cast_ref_to_mut.rs:24 :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