Be careful with expressions with attributes

This commit is contained in:
Seo Sanghyeon 2024-02-20 22:18:49 +09:00
parent 6aa5f1ac6f
commit cd45d5a81c
3 changed files with 15 additions and 0 deletions

View file

@ -58,6 +58,7 @@ impl EarlyLintPass for UnusedUnit {
&& let ctxt = block.span.ctxt()
&& stmt.span.ctxt() == ctxt
&& expr.span.ctxt() == ctxt
&& expr.attrs.is_empty()
{
let sp = expr.span;
span_lint_and_sugg(