Auto merge of #4486 - lzutao:fix-panic-unseparate-literals, r=flip1995
Fix index out of bound in case of empty snippet cc #4480 changelog: none
This commit is contained in:
commit
aeadf1562c
1 changed files with 2 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue