diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2022-06-02 11:31:23 +1000 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2022-06-08 09:22:23 +1000 |
| commit | 7480b501b4073cb38bacb64f22d7b09fb3f652d8 (patch) | |
| tree | 01e9e09564a8b1b06b847b82c3b926d9c975310c | |
| parent | 23880a058bd9e3c482deaa8f6e6d6a5d3d6f7112 (diff) | |
| download | rust-7480b501b4073cb38bacb64f22d7b09fb3f652d8.tar.gz rust-7480b501b4073cb38bacb64f22d7b09fb3f652d8.zip | |
Avoid some unnecessary `return`s.
| -rw-r--r-- | compiler/rustc_infer/src/infer/freshen.rs | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/compiler/rustc_infer/src/infer/freshen.rs b/compiler/rustc_infer/src/infer/freshen.rs index 0a11a81c294..64c0c0f4f64 100644 --- a/compiler/rustc_infer/src/infer/freshen.rs +++ b/compiler/rustc_infer/src/infer/freshen.rs @@ -228,12 +228,7 @@ impl<'a, 'tcx> TypeFolder<'tcx> for TypeFreshener<'a, '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 @@ impl<'a, 'tcx> TypeFolder<'tcx> for TypeFreshener<'a, 'tcx> { self.const_freshen_count, ); } - return ct; + ct } ty::ConstKind::Bound(..) | ty::ConstKind::Placeholder(_) => { @@ -254,9 +249,7 @@ impl<'a, 'tcx> TypeFolder<'tcx> for TypeFreshener<'a, '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) } } |
