diff options
Diffstat (limited to 'crates/ra_hir_ty/src/traits/chalk/interner.rs')
-rw-r--r-- | crates/ra_hir_ty/src/traits/chalk/interner.rs | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/crates/ra_hir_ty/src/traits/chalk/interner.rs b/crates/ra_hir_ty/src/traits/chalk/interner.rs index d98e5cb2d..060372819 100644 --- a/crates/ra_hir_ty/src/traits/chalk/interner.rs +++ b/crates/ra_hir_ty/src/traits/chalk/interner.rs | |||
@@ -138,6 +138,59 @@ impl chalk_ir::interner::Interner for Interner { | |||
138 | }) | 138 | }) |
139 | } | 139 | } |
140 | 140 | ||
141 | fn debug_fn_def_id( | ||
142 | fn_def_id: chalk_ir::FnDefId<Self>, | ||
143 | fmt: &mut fmt::Formatter<'_>, | ||
144 | ) -> Option<fmt::Result> { | ||
145 | tls::with_current_program(|prog| Some(prog?.debug_fn_def_id(fn_def_id, fmt))) | ||
146 | } | ||
147 | fn debug_const( | ||
148 | constant: &chalk_ir::Const<Self>, | ||
149 | fmt: &mut fmt::Formatter<'_>, | ||
150 | ) -> Option<fmt::Result> { | ||
151 | tls::with_current_program(|prog| Some(prog?.debug_const(constant, fmt))) | ||
152 | } | ||
153 | fn debug_variable_kinds( | ||
154 | variable_kinds: &chalk_ir::VariableKinds<Self>, | ||
155 | fmt: &mut fmt::Formatter<'_>, | ||
156 | ) -> Option<fmt::Result> { | ||
157 | tls::with_current_program(|prog| Some(prog?.debug_variable_kinds(variable_kinds, fmt))) | ||
158 | } | ||
159 | fn debug_variable_kinds_with_angles( | ||
160 | variable_kinds: &chalk_ir::VariableKinds<Self>, | ||
161 | fmt: &mut fmt::Formatter<'_>, | ||
162 | ) -> Option<fmt::Result> { | ||
163 | tls::with_current_program(|prog| { | ||
164 | Some(prog?.debug_variable_kinds_with_angles(variable_kinds, fmt)) | ||
165 | }) | ||
166 | } | ||
167 | fn debug_canonical_var_kinds( | ||
168 | canonical_var_kinds: &chalk_ir::CanonicalVarKinds<Self>, | ||
169 | fmt: &mut fmt::Formatter<'_>, | ||
170 | ) -> Option<fmt::Result> { | ||
171 | tls::with_current_program(|prog| { | ||
172 | Some(prog?.debug_canonical_var_kinds(canonical_var_kinds, fmt)) | ||
173 | }) | ||
174 | } | ||
175 | fn debug_program_clause( | ||
176 | clause: &chalk_ir::ProgramClause<Self>, | ||
177 | fmt: &mut fmt::Formatter<'_>, | ||
178 | ) -> Option<fmt::Result> { | ||
179 | tls::with_current_program(|prog| Some(prog?.debug_program_clause(clause, fmt))) | ||
180 | } | ||
181 | fn debug_program_clauses( | ||
182 | clauses: &chalk_ir::ProgramClauses<Self>, | ||
183 | fmt: &mut fmt::Formatter<'_>, | ||
184 | ) -> Option<fmt::Result> { | ||
185 | tls::with_current_program(|prog| Some(prog?.debug_program_clauses(clauses, fmt))) | ||
186 | } | ||
187 | fn debug_quantified_where_clauses( | ||
188 | clauses: &chalk_ir::QuantifiedWhereClauses<Self>, | ||
189 | fmt: &mut fmt::Formatter<'_>, | ||
190 | ) -> Option<fmt::Result> { | ||
191 | tls::with_current_program(|prog| Some(prog?.debug_quantified_where_clauses(clauses, fmt))) | ||
192 | } | ||
193 | |||
141 | fn intern_ty(&self, ty: chalk_ir::TyData<Self>) -> Box<chalk_ir::TyData<Self>> { | 194 | fn intern_ty(&self, ty: chalk_ir::TyData<Self>) -> Box<chalk_ir::TyData<Self>> { |
142 | Box::new(ty) | 195 | Box::new(ty) |
143 | } | 196 | } |