Skip to content

Commit cd588a7

Browse files
committed
Expand Interner implementation for RustInterner
1 parent fd797c4 commit cd588a7

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/librustc_middle/traits/chalk.rs

+15
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ impl<'tcx> chalk_ir::interner::Interner for RustInterner<'tcx> {
7575
type InternedQuantifiedWhereClauses = Vec<chalk_ir::QuantifiedWhereClause<Self>>;
7676
type InternedVariableKinds = Vec<chalk_ir::VariableKind<Self>>;
7777
type InternedCanonicalVarKinds = Vec<chalk_ir::CanonicalVarKind<Self>>;
78+
type InternedConstraints = Vec<chalk_ir::InEnvironment<chalk_ir::Constraint<Self>>>;
7879
type DefId = DefId;
7980
type InternedAdtId = &'tcx AdtDef;
8081
type Identifier = ();
@@ -321,6 +322,20 @@ impl<'tcx> chalk_ir::interner::Interner for RustInterner<'tcx> {
321322
) -> &'a [chalk_ir::CanonicalVarKind<Self>] {
322323
canonical_var_kinds
323324
}
325+
326+
fn intern_constraints<E>(
327+
&self,
328+
data: impl IntoIterator<Item = Result<chalk_ir::InEnvironment<chalk_ir::Constraint<Self>>, E>>,
329+
) -> Result<Self::InternedConstraints, E> {
330+
data.into_iter().collect::<Result<Vec<_>, _>>()
331+
}
332+
333+
fn constraints_data<'a>(
334+
&self,
335+
constraints: &'a Self::InternedConstraints,
336+
) -> &'a [chalk_ir::InEnvironment<chalk_ir::Constraint<Self>>] {
337+
constraints
338+
}
324339
}
325340

326341
impl<'tcx> chalk_ir::interner::HasInterner for RustInterner<'tcx> {

0 commit comments

Comments
 (0)