Auto merge of #12322 - sanxiyn:expression-with-attribute, r=llogiq
Be careful with expressions with attributes Fix #9949. changelog: [`unused_unit`]: skip expressions with attributes
This commit is contained in:
commit
64054693eb
3 changed files with 15 additions and 0 deletions
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue