Avoid some unnecessary returns.

This commit is contained in:
Nicholas Nethercote 2022-06-02 11:31:23 +10:00
parent 23880a058b
commit 7480b501b4

View File

@ -228,12 +228,7 @@ fn fold_const(&mut self, ct: ty::Const<'tcx>) -> ty::Const<'tcx> {
.probe_value(v)
.val
.known();
return self.freshen_const(
opt_ct,
ty::InferConst::Var(v),
ty::InferConst::Fresh,
ct.ty(),
);
self.freshen_const(opt_ct, ty::InferConst::Var(v), ty::InferConst::Fresh, ct.ty())
}
ty::ConstKind::Infer(ty::InferConst::Fresh(i)) => {
if i >= self.const_freshen_count {
@ -244,7 +239,7 @@ fn fold_const(&mut self, ct: ty::Const<'tcx>) -> ty::Const<'tcx> {
self.const_freshen_count,
);
}
return ct;
ct
}
ty::ConstKind::Bound(..) | ty::ConstKind::Placeholder(_) => {
@ -254,9 +249,7 @@ fn fold_const(&mut self, ct: ty::Const<'tcx>) -> ty::Const<'tcx> {
ty::ConstKind::Param(_)
| ty::ConstKind::Value(_)
| ty::ConstKind::Unevaluated(..)
| ty::ConstKind::Error(_) => {}
| ty::ConstKind::Error(_) => ct.super_fold_with(self),
}
ct.super_fold_with(self)
}
}