return when expr has errors
add ui tests
This commit is contained in:
parent
061610640c
commit
1cf4132a16
3 changed files with 43 additions and 0 deletions
|
@ -518,6 +518,11 @@ trait UnusedDelimLint {
|
|||
) {
|
||||
let spans = match value.kind {
|
||||
ast::ExprKind::Block(ref block, None) if block.stmts.len() == 1 => {
|
||||
if let StmtKind::Expr(expr) = &block.stmts[0].kind
|
||||
&& let ExprKind::Err = expr.kind
|
||||
{
|
||||
return
|
||||
}
|
||||
if let Some(span) = block.stmts[0].span.find_ancestor_inside(value.span) {
|
||||
Some((value.span.with_hi(span.lo()), value.span.with_lo(span.hi())))
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue