Auto merge of #2242 - dtolnay-contrib:rustfmtskip, r=RalfJung

Add rustfmt::skip to some files

Extracted from https://github.com/rust-lang/miri/pull/2097.

Five of the files being skipped here are because rustfmt is buggy (https://github.com/rust-lang/rustfmt/issues/5391; see the error messages below). The other two have clearly preferable manual formatting.

```console
error[internal]: left behind trailing whitespace
  --> tests/fail/validity/transmute_through_ptr.rs:18:18:1
   |
18 |
   | ^^^^
   |

warning: rustfmt has failed to format. See previous 1 errors.

error[internal]: left behind trailing whitespace
  --> tests/fail/stacked_borrows/illegal_read2.rs:10:10:1
   |
10 |
   | ^^^^
   |

warning: rustfmt has failed to format. See previous 1 errors.

error[internal]: left behind trailing whitespace
  --> tests/fail/stacked_borrows/illegal_read5.rs:15:15:1
   |
15 |
   | ^^^^
   |

warning: rustfmt has failed to format. See previous 1 errors.

error[internal]: left behind trailing whitespace
  --> tests/fail/stacked_borrows/illegal_read1.rs:10:10:1
   |
10 |
   | ^^^^
   |

warning: rustfmt has failed to format. See previous 1 errors.

error[internal]: left behind trailing whitespace
 --> /git/miri/tests/fail/erroneous_const2.rs:9:9:1
  |
9 |
  | ^^^^
  |

warning: rustfmt has failed to format. See previous 1 errors.
```
This commit is contained in:
bors 2022-06-20 05:23:46 +00:00
commit fe04faf0ce
7 changed files with 8 additions and 0 deletions

File diff suppressed because one or more lines are too long

View File

@ -4,6 +4,7 @@ const FOO: u32 = [X - Y, Y - X][(X < Y) as usize];
//~^ERROR any use of this value
//~|WARN previously accepted
#[rustfmt::skip] // rustfmt bug: https://github.com/rust-lang/rustfmt/issues/5391
fn main() {
println!("{}", FOO); //~ERROR post-monomorphization error
//~|ERROR evaluation of constant value failed

View File

@ -1,6 +1,7 @@
// A callee may not read the destination of our `&mut` without
// us noticing.
#[rustfmt::skip] // rustfmt bug: https://github.com/rust-lang/rustfmt/issues/5391
fn main() {
let mut x = 15;
let xraw = &mut x as *mut _;

View File

@ -1,6 +1,7 @@
// A callee may not read the destination of our `&mut` without
// us noticing.
#[rustfmt::skip] // rustfmt bug: https://github.com/rust-lang/rustfmt/issues/5391
fn main() {
let mut x = 15;
let xraw = &mut x as *mut _;

View File

@ -5,6 +5,7 @@
use std::cell::RefCell;
use std::{mem, ptr};
#[rustfmt::skip] // rustfmt bug: https://github.com/rust-lang/rustfmt/issues/5391
fn main() {
let rc = RefCell::new(0);
let mut refmut = rc.borrow_mut();

View File

@ -7,6 +7,7 @@ fn evil(x: &mut Bool) {
unsafe { *x = 44; } // out-of-bounds enum tag
}
#[rustfmt::skip] // rustfmt bug: https://github.com/rust-lang/rustfmt/issues/5391
fn main() {
let mut x = Bool::True;
evil(&mut x);

View File

@ -64,6 +64,7 @@ fn more_discriminant_overflow() {
// from the `bool` field of `V1`), overflowing for variants with large enough
// indices (`V3` and `V4`), causing them to be interpreted as other variants.
#[allow(dead_code)]
#[rustfmt::skip] // rustfmt prefers every variant on its own line
pub enum E2<X> {
V1 { f: bool },