aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir_ty')
-rw-r--r--crates/hir_ty/src/lib.rs22
1 files changed, 12 insertions, 10 deletions
diff --git a/crates/hir_ty/src/lib.rs b/crates/hir_ty/src/lib.rs
index 7538e0874..915b1028f 100644
--- a/crates/hir_ty/src/lib.rs
+++ b/crates/hir_ty/src/lib.rs
@@ -107,16 +107,18 @@ pub fn make_only_type_binders<T>(num_vars: usize, value: T) -> Binders<T> {
107 ) 107 )
108} 108}
109 109
110impl<T> Canonical<T> { 110// FIXME: get rid of this
111 pub fn new(value: T, kinds: impl IntoIterator<Item = TyVariableKind>) -> Self { 111pub fn make_canonical<T>(
112 let kinds = kinds.into_iter().map(|tk| { 112 value: T,
113 chalk_ir::CanonicalVarKind::new( 113 kinds: impl IntoIterator<Item = TyVariableKind>,
114 chalk_ir::VariableKind::Ty(tk), 114) -> Canonical<T> {
115 chalk_ir::UniverseIndex::ROOT, 115 let kinds = kinds.into_iter().map(|tk| {
116 ) 116 chalk_ir::CanonicalVarKind::new(
117 }); 117 chalk_ir::VariableKind::Ty(tk),
118 Self { value, binders: chalk_ir::CanonicalVarKinds::from_iter(&Interner, kinds) } 118 chalk_ir::UniverseIndex::ROOT,
119 } 119 )
120 });
121 Canonical { value, binders: chalk_ir::CanonicalVarKinds::from_iter(&Interner, kinds) }
120} 122}
121 123
122/// A function signature as seen by type inference: Several parameter types and 124/// A function signature as seen by type inference: Several parameter types and