Skip to content

Add rustfmt::skip to some files #2242

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 20, 2022
Merged

Conversation

dtolnay
Copy link
Member

@dtolnay dtolnay commented Jun 20, 2022

Extracted from #2097.

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

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.

@dtolnay
Copy link
Member Author

dtolnay commented Jun 20, 2022

I confirmed that after this PR, find . -name '*.rs' | xargs rustfmt +nightly --edition=2021 at least does not crash. Of course, it requires some handwritten adjustment as we saw in #2097. I will be following up with that across several upcoming PRs.

Five of the files being skipped here are because rustfmt is buggy (see
the error messages below). The others have clearly preferable manual
formatting.

    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
     --> tests/fail/erroneous_const2.rs:9:9:1
      |
    9 |
      | ^^^^
      |

    warning: rustfmt has failed to format. See previous 1 errors.
@RalfJung
Copy link
Member

Thanks!
@bors r+

@bors
Copy link
Contributor

bors commented Jun 20, 2022

📌 Commit 817adda has been approved by RalfJung

@bors
Copy link
Contributor

bors commented Jun 20, 2022

⌛ Testing commit 817adda with merge fe04faf...

@bors
Copy link
Contributor

bors commented Jun 20, 2022

☀️ Test successful - checks-actions
Approved by: RalfJung
Pushing fe04faf to master...

@bors bors merged commit fe04faf into rust-lang:master Jun 20, 2022
@dtolnay dtolnay deleted the rustfmtskip branch June 21, 2022 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants