diff options
| author | Michael Howell <michael@notriddle.com> | 2025-02-06 15:38:28 -0700 |
|---|---|---|
| committer | Michael Howell <michael@notriddle.com> | 2025-02-11 09:35:43 -0700 |
| commit | ac15a10b55580065320e48b29b6ff0ea36d8093a (patch) | |
| tree | 7982ecc8953b3560088f58ecda291413b29d9b43 /clippy_dev | |
| parent | ff87bead4f4931de38194809b5c9a420cce732e6 (diff) | |
| download | rust-ac15a10b55580065320e48b29b6ff0ea36d8093a.tar.gz rust-ac15a10b55580065320e48b29b6ff0ea36d8093a.zip | |
just_underscores_and_digits: ignore empty ident
Empty idents come from error recovery, and should imply that a better error has already been emitted.
Diffstat (limited to 'clippy_dev')
| -rw-r--r-- | clippy_dev/src/fmt.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/clippy_dev/src/fmt.rs b/clippy_dev/src/fmt.rs index 790dafa811f..bdddf46a2cb 100644 --- a/clippy_dev/src/fmt.rs +++ b/clippy_dev/src/fmt.rs @@ -290,8 +290,13 @@ fn run_rustfmt(context: &FmtContext) -> Result<(), Error> { .filter_map(|entry| { let entry = entry.expect("failed to find tests"); let path = entry.path(); - - if path.extension() != Some("rs".as_ref()) || entry.file_name() == "ice-3891.rs" { + if path.extension() != Some("rs".as_ref()) + || path + .components() + .nth_back(1) + .is_some_and(|c| c.as_os_str() == "syntax-error-recovery") + || entry.file_name() == "ice-3891.rs" + { None } else { Some(entry.into_path().into_os_string()) |
