about summary refs log tree commit diff
diff options
context:
space:
mode:
authorIbraheem Ahmed <ibraheem@ibraheem.ca>2022-07-21 13:06:08 -0400
committerIbraheem Ahmed <ibraheem@ibraheem.ca>2022-07-21 17:22:29 -0400
commit4fdf43f23fbd4fb69960c9136dc796d8e64be785 (patch)
treea8b4369fd2be7225d01e62969e0da9d796efc8bd
parentf479289e78bc60fbb2aaa3abb33f7726bb12ea89 (diff)
downloadrust-4fdf43f23fbd4fb69960c9136dc796d8e64be785.tar.gz
rust-4fdf43f23fbd4fb69960c9136dc796d8e64be785.zip
`special_module_name`: ignore inline modules
-rw-r--r--compiler/rustc_lint/src/builtin.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/rustc_lint/src/builtin.rs b/compiler/rustc_lint/src/builtin.rs
index 961e1e9507b..e9841b7f071 100644
--- a/compiler/rustc_lint/src/builtin.rs
+++ b/compiler/rustc_lint/src/builtin.rs
@@ -3299,7 +3299,11 @@ declare_lint_pass!(SpecialModuleName => [SPECIAL_MODULE_NAME]);
 impl EarlyLintPass for SpecialModuleName {
     fn check_crate(&mut self, cx: &EarlyContext<'_>, krate: &ast::Crate) {
         for item in &krate.items {
-            if let ast::ItemKind::Mod(..) = item.kind {
+            if let ast::ItemKind::Mod(
+                _,
+                ast::ModKind::Unloaded | ast::ModKind::Loaded(_, ast::Inline::No, _),
+            ) = item.kind
+            {
                 if item.attrs.iter().any(|a| a.has_name(sym::path)) {
                     continue;
                 }