mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 08:44:35 +00:00
special_module_name
: ignore inline modules
This commit is contained in:
parent
f479289e78
commit
4fdf43f23f
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user