misc: use Ty::is_unit
This commit is contained in:
parent
af2dd2d3bc
commit
8725fac6f3
1 changed files with 1 additions and 1 deletions
|
|
@ -86,7 +86,7 @@ impl<'tcx> LateLintPass<'tcx> for UnnecessarySemicolon {
|
|||
expr.kind,
|
||||
ExprKind::If(..) | ExprKind::Match(_, _, MatchSource::Normal | MatchSource::Postfix)
|
||||
)
|
||||
&& cx.typeck_results().expr_ty(expr) == cx.tcx.types.unit
|
||||
&& cx.typeck_results().expr_ty(expr).is_unit()
|
||||
// if a stmt has attrs, then turning it into an expr will break the code, since attrs aren't allowed on exprs
|
||||
&& cx.tcx.hir_attrs(stmt.hir_id).is_empty()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue