Skip to content

Commit e9b6d66

Browse files
flodieboldjackh726
authored andcommitted
Add a missing UpcastFrom impl in rustc_type_ir
1 parent 5db4ac1 commit e9b6d66

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

compiler/rustc_type_ir/src/predicate.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,15 @@ impl<I: Interner> UpcastFrom<I, TraitRef<I>> for TraitPredicate<I> {
181181
}
182182
}
183183

184+
impl<I: Interner> UpcastFrom<I, ty::Binder<I, TraitRef<I>>> for ty::Binder<I, TraitPredicate<I>> {
185+
fn upcast_from(from: ty::Binder<I, TraitRef<I>>, _tcx: I) -> Self {
186+
from.map_bound(|trait_ref| TraitPredicate {
187+
trait_ref,
188+
polarity: PredicatePolarity::Positive,
189+
})
190+
}
191+
}
192+
184193
impl<I: Interner> fmt::Debug for TraitPredicate<I> {
185194
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
186195
write!(f, "TraitPredicate({:?}, polarity:{:?})", self.trait_ref, self.polarity)

0 commit comments

Comments
 (0)