Skip to content

Commit febecc7

Browse files
Make syntax-error-recovery filter more robust
Co-authored-by: Samuel Tardieu <[email protected]>
1 parent b745b14 commit febecc7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

clippy_dev/src/fmt.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,10 +291,11 @@ fn run_rustfmt(context: &FmtContext) -> Result<(), Error> {
291291
let entry = entry.expect("failed to find tests");
292292
let path = entry.path();
293293

294-
if path.extension() != Some("rs".as_ref())
295294
|| path
296295
.components()
297-
.any(|component| component.as_os_str() == "syntax-error-recovery")
296+
.rev()
297+
.nth(1)
298+
.is_some_and(|c| c.as_os_str() == "syntax-error-recovery")
298299
|| entry.file_name() == "ice-3891.rs"
299300
{
300301
None

0 commit comments

Comments
 (0)