Skip to content

Commit 30c9d25

Browse files
committed
more perf
1 parent 7b7e325 commit 30c9d25

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

compiler/rustc_type_ir/src/binder.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -733,10 +733,13 @@ impl<'a, I: Interner> TypeFolder<I> for ArgFolder<'a, I> {
733733
}
734734

735735
fn fold_const(&mut self, c: I::Const) -> I::Const {
736-
if let ty::ConstKind::Param(p) = c.kind() {
737-
self.const_for_param(p, c)
738-
} else {
739-
c.super_fold_with(self)
736+
if !c.has_param() {
737+
return c
738+
}
739+
740+
match c.kind() {
741+
ty::ConstKind::Param(p) => self.const_for_param(p, c),
742+
_ => c.super_fold_with(self)
740743
}
741744
}
742745

0 commit comments

Comments
 (0)