Skip to content

Commit 6194bf2

Browse files
committed
Resolve assoc ty predicates in builtin ImplExprs
1 parent 2380f4b commit 6194bf2

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

frontend/exporter/src/sinto.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,14 @@ impl<S, LL, RR, L: SInto<S, LL>, R: SInto<S, RR>> SInto<S, (LL, RR)> for (L, R)
6565
}
6666
}
6767

68+
impl<S, AA, BB, CC, A: SInto<S, AA>, B: SInto<S, BB>, C: SInto<S, CC>> SInto<S, (AA, BB, CC)>
69+
for (A, B, C)
70+
{
71+
fn sinto(&self, s: &S) -> (AA, BB, CC) {
72+
(self.0.sinto(s), self.1.sinto(s), self.2.sinto(s))
73+
}
74+
}
75+
6876
impl<S, D, T: SInto<S, D>> SInto<S, Option<D>> for Option<T> {
6977
fn sinto(&self, s: &S) -> Option<D> {
7078
self.as_ref().map(|x| x.sinto(s))

frontend/exporter/src/traits.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ pub enum ImplExprAtom {
140140
/// FnOnce`.
141141
impl_exprs: Vec<ImplExpr>,
142142
/// The values of the associated types for this trait.
143-
types: Vec<(DefId, Ty)>,
143+
types: Vec<(DefId, Ty, Vec<ImplExpr>)>,
144144
},
145145
/// An error happened while resolving traits.
146146
Error(String),

frontend/exporter/src/traits/resolution.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ pub enum ImplExprAtom<'tcx> {
8989
/// FnOnce`.
9090
impl_exprs: Vec<ImplExpr<'tcx>>,
9191
/// The values of the associated types for this trait.
92-
types: Vec<(DefId, Ty<'tcx>)>,
92+
types: Vec<(DefId, Ty<'tcx>, Vec<ImplExpr<'tcx>>)>,
9393
},
9494
/// An error happened while resolving traits.
9595
Error(String),
@@ -495,7 +495,14 @@ impl<'tcx> PredicateSearcher<'tcx> {
495495
return None;
496496
}
497497
}
498-
Some((assoc.def_id, ty))
498+
let impl_exprs = self
499+
.resolve_item_implied_predicates(
500+
assoc.def_id,
501+
erased_tref.skip_binder().args,
502+
warn,
503+
)
504+
.ok()?;
505+
Some((assoc.def_id, ty, impl_exprs))
499506
})
500507
.collect();
501508
ImplExprAtom::Builtin {

0 commit comments

Comments
 (0)