We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
crate_in_macro_def
1 parent 1f530ab commit d15ec0fCopy full SHA for d15ec0f
clippy_lints/src/crate_in_macro_def.rs
@@ -53,10 +53,9 @@ declare_lint_pass!(CrateInMacroDef => [CRATE_IN_MACRO_DEF]);
53
54
impl EarlyLintPass for CrateInMacroDef {
55
fn check_item(&mut self, cx: &EarlyContext<'_>, item: &Item) {
56
- if item.attrs.iter().any(is_macro_export)
57
- && let ItemKind::MacroDef(macro_def) = &item.kind
58
- && let tts = macro_def.body.tokens.clone()
59
- && let Some(span) = contains_unhygienic_crate_reference(&tts)
+ if let ItemKind::MacroDef(macro_def) = &item.kind
+ && item.attrs.iter().any(is_macro_export)
+ && let Some(span) = contains_unhygienic_crate_reference(¯o_def.body.tokens)
60
{
61
span_lint_and_sugg(
62
cx,
0 commit comments