diff options
| author | Takayuki Nakata <f.seasons017@gmail.com> | 2020-11-18 12:36:47 +0900 |
|---|---|---|
| committer | Takayuki Nakata <f.seasons017@gmail.com> | 2020-11-18 12:36:47 +0900 |
| commit | 6494bd0bac72b621fc4db64d68c94c8199e97afe (patch) | |
| tree | 243776200fc89020b22280f4a81b7d190ea3f69d | |
| parent | 8c2e2fd4ec55e41afb0ea15497adce1166476c8f (diff) | |
| download | rust-6494bd0bac72b621fc4db64d68c94c8199e97afe.tar.gz rust-6494bd0bac72b621fc4db64d68c94c8199e97afe.zip | |
Revert "Add `rustfmt::skip` as a work around"
This reverts commit 0e803417f997ba35c0045704dd347e64c2a1786c. Fixed by https://github.com/rust-lang/rustfmt/issues/4528.
| -rw-r--r-- | tests/ui/cast_ref_to_mut.rs | 4 | ||||
| -rw-r--r-- | tests/ui/cast_ref_to_mut.stderr | 6 |
2 files changed, 3 insertions, 7 deletions
diff --git a/tests/ui/cast_ref_to_mut.rs b/tests/ui/cast_ref_to_mut.rs index 0ede958d170..089e5cfabe4 100644 --- a/tests/ui/cast_ref_to_mut.rs +++ b/tests/ui/cast_ref_to_mut.rs @@ -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); diff --git a/tests/ui/cast_ref_to_mut.stderr b/tests/ui/cast_ref_to_mut.stderr index d36aa0e00ee..aacd99437d9 100644 --- a/tests/ui/cast_ref_to_mut.stderr +++ b/tests/ui/cast_ref_to_mut.stderr @@ -1,5 +1,5 @@ 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"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -7,13 +7,13 @@ 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"; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
