1
Fork 0

Remove an unnecessary if let.

This commit is contained in:
Nicholas Nethercote 2024-02-23 11:12:04 +11:00
parent 109321ac47
commit 938e594d62

View file

@ -76,16 +76,12 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
// While we don't allow *arbitrary* coercions here, we *do* allow
// coercions from ! to `expected`.
if ty.is_never() {
if let Some(adjustments) = self.typeck_results.borrow().adjustments().get(expr.hir_id) {
if let Some(_) = self.typeck_results.borrow().adjustments().get(expr.hir_id) {
let reported = self.dcx().span_delayed_bug(
expr.span,
"expression with never type wound up being adjusted",
);
return if let [Adjustment { kind: Adjust::NeverToAny, target }] = &adjustments[..] {
target.to_owned()
} else {
Ty::new_error(self.tcx(), reported)
};
return Ty::new_error(self.tcx(), reported);
}
let adj_ty = self.next_ty_var(TypeVariableOrigin {