Skip to content

Commit 938e594

Browse files
committed
Remove an unnecessary if let.
1 parent 109321a commit 938e594

File tree

1 file changed

+2
-6
lines changed
  • compiler/rustc_hir_typeck/src

1 file changed

+2
-6
lines changed

compiler/rustc_hir_typeck/src/expr.rs

+2-6
Original file line numberDiff line numberDiff line change
@@ -76,16 +76,12 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
7676
// While we don't allow *arbitrary* coercions here, we *do* allow
7777
// coercions from ! to `expected`.
7878
if ty.is_never() {
79-
if let Some(adjustments) = self.typeck_results.borrow().adjustments().get(expr.hir_id) {
79+
if let Some(_) = self.typeck_results.borrow().adjustments().get(expr.hir_id) {
8080
let reported = self.dcx().span_delayed_bug(
8181
expr.span,
8282
"expression with never type wound up being adjusted",
8383
);
84-
return if let [Adjustment { kind: Adjust::NeverToAny, target }] = &adjustments[..] {
85-
target.to_owned()
86-
} else {
87-
Ty::new_error(self.tcx(), reported)
88-
};
84+
return Ty::new_error(self.tcx(), reported);
8985
}
9086

9187
let adj_ty = self.next_ty_var(TypeVariableOrigin {

0 commit comments

Comments
 (0)