Skip to content

Commit

Permalink
special_module_name: ignore inline modules
Browse files Browse the repository at this point in the history
  • Loading branch information
ibraheemdev committed Jul 21, 2022
1 parent f479289 commit 4fdf43f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion compiler/rustc_lint/src/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 4fdf43f

Please sign in to comment.