diff options
| -rw-r--r-- | clippy_lints/src/misc_early.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clippy_lints/src/misc_early.rs b/clippy_lints/src/misc_early.rs index 6ff2a404579..b90307af8ff 100644 --- a/clippy_lints/src/misc_early.rs +++ b/clippy_lints/src/misc_early.rs @@ -393,7 +393,8 @@ impl MiscEarlyLints { // The `line!()` macro is compiler built-in and a special case for these lints. let lit_snip = match snippet_opt(cx, lit.span) { Some(snip) => { - if snip.contains('!') { + // The snip could be empty in case of expand from procedure macro + if snip.is_empty() || snip.contains('!') { return; } snip |
