about summary refs log tree commit diff
path: root/clippy_lints/src/empty_line_after.rs
diff options
context:
space:
mode:
authorJacob Pratt <jacob@jhpratt.dev>2025-08-21 01:12:19 -0400
committerGitHub <noreply@github.com>2025-08-21 01:12:19 -0400
commitbea2e2be484a094654fb5161344d6d8b4c223cd2 (patch)
tree829c18a9a7181eb0aa54861ba80471c0785079eb /clippy_lints/src/empty_line_after.rs
parent4b2b9c2a39f252e5c6a6a699646eff9d2f8cf79a (diff)
parentc1dfeea919a8ac54d152c90885704e9d43940c7b (diff)
Rollup merge of #145590 - nnethercote:ModKind-Inline, r=petrochenkov
Prevent impossible combinations in `ast::ModKind`.

`ModKind::Loaded` has an `inline` field and a `had_parse_error` field. If the `inline` field is `Inline::Yes` then `had_parse_error` must be `Ok(())`.

This commit moves the `had_parse_error` field into the `Inline::No` variant. This makes it impossible to create the nonsensical combination of `inline == Inline::Yes` and `had_parse_error = Err(_)`.

r? ```@Urgau```
Diffstat (limited to 'clippy_lints/src/empty_line_after.rs')
-rw-r--r--clippy_lints/src/empty_line_after.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/clippy_lints/src/empty_line_after.rs b/clippy_lints/src/empty_line_after.rs
index 3bd74856165..76e67b1154b 100644
--- a/clippy_lints/src/empty_line_after.rs
+++ b/clippy_lints/src/empty_line_after.rs
@@ -442,7 +442,7 @@ impl EmptyLineAfter {
                 None => span.shrink_to_lo(),
             },
             mod_items: match kind {
-                ItemKind::Mod(_, _, ModKind::Loaded(items, _, _, _)) => items
+                ItemKind::Mod(_, _, ModKind::Loaded(items, _, _)) => items
                     .iter()
                     .filter(|i| !matches!(i.span.ctxt().outer_expn_data().kind, ExpnKind::AstPass(_)))
                     .map(|i| i.id)