Skip to content

Commit

Permalink
Revert "Add rustfmt::skip as a work around"
Browse files Browse the repository at this point in the history
This reverts commit 0e80341.

Fixed by rust-lang/rustfmt#4528.
  • Loading branch information
giraffate committed Nov 18, 2020
1 parent 8c2e2fd commit 6494bd0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
4 changes: 0 additions & 4 deletions tests/ui/cast_ref_to_mut.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
#![allow(clippy::no_effect)]

extern "C" {
#[rustfmt::skip]
// TODO: This `rustfmt::skip` is a work around of #6336 because
// the following comments are checked by rustfmt for some reason.
//
// N.B., mutability can be easily incorrect in FFI calls -- as
// in C, the default is mutable pointers.
fn ffi(c: *mut u8);
Expand Down
6 changes: 3 additions & 3 deletions tests/ui/cast_ref_to_mut.stderr
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
error: casting `&T` to `&mut T` may cause undefined behavior, consider instead using an `UnsafeCell`
--> $DIR/cast_ref_to_mut.rs:22:9
--> $DIR/cast_ref_to_mut.rs:18:9
|
LL | (*(a as *const _ as *mut String)).push_str(" world");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `-D clippy::cast-ref-to-mut` implied by `-D warnings`

error: casting `&T` to `&mut T` may cause undefined behavior, consider instead using an `UnsafeCell`
--> $DIR/cast_ref_to_mut.rs:23:9
--> $DIR/cast_ref_to_mut.rs:19:9
|
LL | *(a as *const _ as *mut _) = String::from("Replaced");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^

error: casting `&T` to `&mut T` may cause undefined behavior, consider instead using an `UnsafeCell`
--> $DIR/cast_ref_to_mut.rs:24:9
--> $DIR/cast_ref_to_mut.rs:20:9
|
LL | *(a as *const _ as *mut String) += " world";
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down

0 comments on commit 6494bd0

Please sign in to comment.