Skip to content

Commit f8b1baa

Browse files
Rollup merge of #81054 - LingMan:rem_as_ref, r=jyn514
Drop a few unneeded borrows `@rustbot` modify labels +C-cleanup +T-compiler
2 parents 1a194d9 + ba1f036 commit f8b1baa

File tree

1 file changed

+5
-5
lines changed
  • compiler/rustc_typeck/src/check/fn_ctxt

1 file changed

+5
-5
lines changed

Diff for: compiler/rustc_typeck/src/check/fn_ctxt/checks.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -813,25 +813,25 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
813813
if ty.is_never() {
814814
None
815815
} else {
816-
Some(match &elem.kind {
816+
Some(match elem.kind {
817817
// Point at the tail expression when possible.
818818
hir::ExprKind::Block(block, _) => {
819-
block.expr.as_ref().map_or(block.span, |e| e.span)
819+
block.expr.map_or(block.span, |e| e.span)
820820
}
821821
_ => elem.span,
822822
})
823823
}
824824
})
825825
};
826826

827-
if let hir::ExprKind::If(_, _, Some(el)) = &expr.kind {
827+
if let hir::ExprKind::If(_, _, Some(el)) = expr.kind {
828828
if let Some(rslt) = check_in_progress(el) {
829829
return rslt;
830830
}
831831
}
832832

833-
if let hir::ExprKind::Match(_, arms, _) = &expr.kind {
834-
let mut iter = arms.iter().filter_map(|arm| check_in_progress(&arm.body));
833+
if let hir::ExprKind::Match(_, arms, _) = expr.kind {
834+
let mut iter = arms.iter().filter_map(|arm| check_in_progress(arm.body));
835835
if let Some(span) = iter.next() {
836836
if iter.next().is_none() {
837837
return span;

0 commit comments

Comments
 (0)