Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit fa912f4

Browse files
Account for flags in ArgFolder
1 parent 70dab5a commit fa912f4

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

compiler/rustc_type_ir/src/binder.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -697,12 +697,24 @@ impl<'a, I: Interner> TypeFolder<I> for ArgFolder<'a, I> {
697697
}
698698

699699
fn fold_const(&mut self, c: I::Const) -> I::Const {
700+
if !c.has_param() {
701+
return c;
702+
}
703+
700704
if let ty::ConstKind::Param(p) = c.kind() {
701705
self.const_for_param(p, c)
702706
} else {
703707
c.super_fold_with(self)
704708
}
705709
}
710+
711+
fn fold_predicate(&mut self, p: I::Predicate) -> I::Predicate {
712+
if !p.has_param() {
713+
return p;
714+
}
715+
716+
p.super_fold_with(self)
717+
}
706718
}
707719

708720
impl<'a, I: Interner> ArgFolder<'a, I> {

0 commit comments

Comments
 (0)