Remove an unnecessary if let
.
This commit is contained in:
parent
109321ac47
commit
938e594d62
1 changed files with 2 additions and 6 deletions
|
@ -76,16 +76,12 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
||||||
// While we don't allow *arbitrary* coercions here, we *do* allow
|
// While we don't allow *arbitrary* coercions here, we *do* allow
|
||||||
// coercions from ! to `expected`.
|
// coercions from ! to `expected`.
|
||||||
if ty.is_never() {
|
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(
|
let reported = self.dcx().span_delayed_bug(
|
||||||
expr.span,
|
expr.span,
|
||||||
"expression with never type wound up being adjusted",
|
"expression with never type wound up being adjusted",
|
||||||
);
|
);
|
||||||
return if let [Adjustment { kind: Adjust::NeverToAny, target }] = &adjustments[..] {
|
return Ty::new_error(self.tcx(), reported);
|
||||||
target.to_owned()
|
|
||||||
} else {
|
|
||||||
Ty::new_error(self.tcx(), reported)
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let adj_ty = self.next_ty_var(TypeVariableOrigin {
|
let adj_ty = self.next_ty_var(TypeVariableOrigin {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue