Skip to content

Commit b2aefb8

Browse files
committed
Auto merge of #6345 - giraffate:follow_up_of_rustup, r=flip1995
Revert "Add `rustfmt::skip` as a work around" This reverts commit 0e80341. Fixed by rustfmt v1.4.27 available in the latest nightly (2020-11-18). Refer to rust-lang/rustfmt#4528. changelog: none
2 parents 8c2e2fd + 6494bd0 commit b2aefb8

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

tests/ui/cast_ref_to_mut.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
#![allow(clippy::no_effect)]
33

44
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-
//
95
// N.B., mutability can be easily incorrect in FFI calls -- as
106
// in C, the default is mutable pointers.
117
fn ffi(c: *mut u8);

tests/ui/cast_ref_to_mut.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
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
33
|
44
LL | (*(a as *const _ as *mut String)).push_str(" world");
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
77
= note: `-D clippy::cast-ref-to-mut` implied by `-D warnings`
88

99
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
1111
|
1212
LL | *(a as *const _ as *mut _) = String::from("Replaced");
1313
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
1414

1515
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
1717
|
1818
LL | *(a as *const _ as *mut String) += " world";
1919
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0 commit comments

Comments
 (0)