Skip to content

Commit 56e2593

Browse files
committed
tidy, and rename test file
1 parent 8aa7fde commit 56e2593

File tree

3 files changed

+118
-71
lines changed

3 files changed

+118
-71
lines changed

compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs

+23-22
Original file line numberDiff line numberDiff line change
@@ -525,11 +525,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
525525
// Sometimes macros mess up the spans, so do not normalize the
526526
// arg span to equal the error span, because that's less useful
527527
// than pointing out the arg expr in the wrong context.
528-
if normalized_span.source_equal(error_span) {
529-
span
530-
} else {
531-
normalized_span
532-
}
528+
if normalized_span.source_equal(error_span) { span } else { normalized_span }
533529
};
534530

535531
// Precompute the provided types and spans, since that's all we typically need for below
@@ -782,8 +778,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
782778
// can be collated pretty easily if needed.
783779

784780
// Next special case: if there is only one "Incompatible" error, just emit that
785-
if let [Error::Invalid(provided_idx, expected_idx, Compatibility::Incompatible(Some(err)))] =
786-
&errors[..]
781+
if let [
782+
Error::Invalid(provided_idx, expected_idx, Compatibility::Incompatible(Some(err))),
783+
] = &errors[..]
787784
{
788785
let (formal_ty, expected_ty) = formal_and_expected_inputs[*expected_idx];
789786
let (provided_ty, provided_arg_span) = provided_arg_tys[*provided_idx];
@@ -1525,21 +1522,25 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
15251522
// Our block must be a `assign desugar local; assignment`
15261523
if let Some(hir::Node::Block(hir::Block {
15271524
stmts:
1528-
[hir::Stmt {
1529-
kind:
1530-
hir::StmtKind::Local(hir::Local {
1531-
source: hir::LocalSource::AssignDesugar(_),
1532-
..
1533-
}),
1534-
..
1535-
}, hir::Stmt {
1536-
kind:
1537-
hir::StmtKind::Expr(hir::Expr {
1538-
kind: hir::ExprKind::Assign(..),
1539-
..
1540-
}),
1541-
..
1542-
}],
1525+
[
1526+
hir::Stmt {
1527+
kind:
1528+
hir::StmtKind::Local(hir::Local {
1529+
source:
1530+
hir::LocalSource::AssignDesugar(_),
1531+
..
1532+
}),
1533+
..
1534+
},
1535+
hir::Stmt {
1536+
kind:
1537+
hir::StmtKind::Expr(hir::Expr {
1538+
kind: hir::ExprKind::Assign(..),
1539+
..
1540+
}),
1541+
..
1542+
},
1543+
],
15431544
..
15441545
})) = self.tcx.hir().find(blk.hir_id)
15451546
{

0 commit comments

Comments
 (0)