@@ -51,8 +51,8 @@ impl chalk_ir::interner::Interner for Interner {
5151 type InternedGoal = Arc < GoalData < Self > > ;
5252 type InternedGoals = Vec < Goal < Self > > ;
5353 type InternedSubstitution = Interned < InternedWrapper < SmallVec < [ GenericArg ; 2 ] > > > ;
54- type InternedProgramClause = chalk_ir:: ProgramClauseData < Self > ;
5554 type InternedProgramClauses = Interned < InternedWrapper < Vec < chalk_ir:: ProgramClause < Self > > > > ;
55+ type InternedProgramClause = chalk_ir:: ProgramClauseData < Self > ;
5656 type InternedQuantifiedWhereClauses =
5757 Interned < InternedWrapper < Vec < chalk_ir:: QuantifiedWhereClause < Self > > > > ;
5858 type InternedVariableKinds = Interned < InternedWrapper < Vec < chalk_ir:: VariableKind < Interner > > > > ;
@@ -86,6 +86,27 @@ impl chalk_ir::interner::Interner for Interner {
8686 tls:: with_current_program ( |prog| Some ( prog?. debug_assoc_type_id ( id, fmt) ) )
8787 }
8888
89+ fn debug_opaque_ty_id (
90+ opaque_ty_id : chalk_ir:: OpaqueTyId < Self > ,
91+ fmt : & mut fmt:: Formatter < ' _ > ,
92+ ) -> Option < fmt:: Result > {
93+ Some ( write ! ( fmt, "OpaqueTy#{}" , opaque_ty_id. 0 ) )
94+ }
95+
96+ fn debug_fn_def_id (
97+ fn_def_id : chalk_ir:: FnDefId < Self > ,
98+ fmt : & mut fmt:: Formatter < ' _ > ,
99+ ) -> Option < fmt:: Result > {
100+ tls:: with_current_program ( |prog| Some ( prog?. debug_fn_def_id ( fn_def_id, fmt) ) )
101+ }
102+
103+ fn debug_closure_id (
104+ _fn_def_id : chalk_ir:: ClosureId < Self > ,
105+ _fmt : & mut fmt:: Formatter < ' _ > ,
106+ ) -> Option < fmt:: Result > {
107+ None
108+ }
109+
89110 fn debug_alias (
90111 alias : & chalk_ir:: AliasTy < Interner > ,
91112 fmt : & mut fmt:: Formatter < ' _ > ,
@@ -113,13 +134,6 @@ impl chalk_ir::interner::Interner for Interner {
113134 Some ( write ! ( fmt, "{:?}" , opaque_ty. opaque_ty_id) )
114135 }
115136
116- fn debug_opaque_ty_id (
117- opaque_ty_id : chalk_ir:: OpaqueTyId < Self > ,
118- fmt : & mut fmt:: Formatter < ' _ > ,
119- ) -> Option < fmt:: Result > {
120- Some ( write ! ( fmt, "OpaqueTy#{}" , opaque_ty_id. 0 ) )
121- }
122-
123137 fn debug_ty ( ty : & chalk_ir:: Ty < Interner > , fmt : & mut fmt:: Formatter < ' _ > ) -> Option < fmt:: Result > {
124138 Some ( write ! ( fmt, "{:?}" , ty. data( Interner ) ) )
125139 }
@@ -131,76 +145,56 @@ impl chalk_ir::interner::Interner for Interner {
131145 Some ( write ! ( fmt, "{:?}" , lifetime. data( Interner ) ) )
132146 }
133147
134- fn debug_generic_arg (
135- parameter : & GenericArg ,
136- fmt : & mut fmt:: Formatter < ' _ > ,
137- ) -> Option < fmt:: Result > {
138- Some ( write ! ( fmt, "{:?}" , parameter. data( Interner ) . inner_debug( ) ) )
139- }
140-
141- fn debug_goal ( goal : & Goal < Interner > , fmt : & mut fmt:: Formatter < ' _ > ) -> Option < fmt:: Result > {
142- let goal_data = goal. data ( Interner ) ;
143- Some ( write ! ( fmt, "{goal_data:?}" ) )
144- }
145-
146- fn debug_goals (
147- goals : & chalk_ir:: Goals < Interner > ,
148- fmt : & mut fmt:: Formatter < ' _ > ,
149- ) -> Option < fmt:: Result > {
150- Some ( write ! ( fmt, "{:?}" , goals. debug( Interner ) ) )
151- }
152-
153- fn debug_program_clause_implication (
154- pci : & chalk_ir:: ProgramClauseImplication < Interner > ,
155- fmt : & mut fmt:: Formatter < ' _ > ,
156- ) -> Option < fmt:: Result > {
157- Some ( write ! ( fmt, "{:?}" , pci. debug( Interner ) ) )
158- }
159-
160- fn debug_substitution (
161- substitution : & chalk_ir:: Substitution < Interner > ,
148+ fn debug_const (
149+ constant : & chalk_ir:: Const < Self > ,
162150 fmt : & mut fmt:: Formatter < ' _ > ,
163151 ) -> Option < fmt:: Result > {
164- Some ( write ! ( fmt, "{:?}" , substitution . debug ( Interner ) ) )
152+ Some ( write ! ( fmt, "{:?}" , constant . data ( Interner ) ) )
165153 }
166154
167- fn debug_separator_trait_ref (
168- separator_trait_ref : & chalk_ir :: SeparatorTraitRef < ' _ , Interner > ,
155+ fn debug_generic_arg (
156+ parameter : & GenericArg ,
169157 fmt : & mut fmt:: Formatter < ' _ > ,
170158 ) -> Option < fmt:: Result > {
171- Some ( write ! ( fmt, "{:?}" , separator_trait_ref . debug ( Interner ) ) )
159+ Some ( write ! ( fmt, "{:?}" , parameter . data ( Interner ) . inner_debug ( ) ) )
172160 }
173161
174- fn debug_fn_def_id (
175- fn_def_id : chalk_ir:: FnDefId < Self > ,
176- fmt : & mut fmt:: Formatter < ' _ > ,
177- ) -> Option < fmt:: Result > {
178- tls:: with_current_program ( |prog| Some ( prog?. debug_fn_def_id ( fn_def_id, fmt) ) )
179- }
180- fn debug_const (
181- constant : & chalk_ir:: Const < Self > ,
182- fmt : & mut fmt:: Formatter < ' _ > ,
183- ) -> Option < fmt:: Result > {
184- Some ( write ! ( fmt, "{:?}" , constant. data( Interner ) ) )
185- }
186162 fn debug_variable_kinds (
187163 variable_kinds : & chalk_ir:: VariableKinds < Self > ,
188164 fmt : & mut fmt:: Formatter < ' _ > ,
189165 ) -> Option < fmt:: Result > {
190166 Some ( write ! ( fmt, "{:?}" , variable_kinds. as_slice( Interner ) ) )
191167 }
168+
192169 fn debug_variable_kinds_with_angles (
193170 variable_kinds : & chalk_ir:: VariableKinds < Self > ,
194171 fmt : & mut fmt:: Formatter < ' _ > ,
195172 ) -> Option < fmt:: Result > {
196173 Some ( write ! ( fmt, "{:?}" , variable_kinds. inner_debug( Interner ) ) )
197174 }
175+
198176 fn debug_canonical_var_kinds (
199177 canonical_var_kinds : & chalk_ir:: CanonicalVarKinds < Self > ,
200178 fmt : & mut fmt:: Formatter < ' _ > ,
201179 ) -> Option < fmt:: Result > {
202180 Some ( write ! ( fmt, "{:?}" , canonical_var_kinds. as_slice( Interner ) ) )
203181 }
182+ fn debug_goal ( goal : & Goal < Interner > , fmt : & mut fmt:: Formatter < ' _ > ) -> Option < fmt:: Result > {
183+ let goal_data = goal. data ( Interner ) ;
184+ Some ( write ! ( fmt, "{goal_data:?}" ) )
185+ }
186+ fn debug_goals (
187+ goals : & chalk_ir:: Goals < Interner > ,
188+ fmt : & mut fmt:: Formatter < ' _ > ,
189+ ) -> Option < fmt:: Result > {
190+ Some ( write ! ( fmt, "{:?}" , goals. debug( Interner ) ) )
191+ }
192+ fn debug_program_clause_implication (
193+ pci : & chalk_ir:: ProgramClauseImplication < Interner > ,
194+ fmt : & mut fmt:: Formatter < ' _ > ,
195+ ) -> Option < fmt:: Result > {
196+ Some ( write ! ( fmt, "{:?}" , pci. debug( Interner ) ) )
197+ }
204198 fn debug_program_clause (
205199 clause : & chalk_ir:: ProgramClause < Self > ,
206200 fmt : & mut fmt:: Formatter < ' _ > ,
@@ -213,13 +207,33 @@ impl chalk_ir::interner::Interner for Interner {
213207 ) -> Option < fmt:: Result > {
214208 Some ( write ! ( fmt, "{:?}" , clauses. as_slice( Interner ) ) )
215209 }
210+ fn debug_substitution (
211+ substitution : & chalk_ir:: Substitution < Interner > ,
212+ fmt : & mut fmt:: Formatter < ' _ > ,
213+ ) -> Option < fmt:: Result > {
214+ Some ( write ! ( fmt, "{:?}" , substitution. debug( Interner ) ) )
215+ }
216+ fn debug_separator_trait_ref (
217+ separator_trait_ref : & chalk_ir:: SeparatorTraitRef < ' _ , Interner > ,
218+ fmt : & mut fmt:: Formatter < ' _ > ,
219+ ) -> Option < fmt:: Result > {
220+ Some ( write ! ( fmt, "{:?}" , separator_trait_ref. debug( Interner ) ) )
221+ }
222+
216223 fn debug_quantified_where_clauses (
217224 clauses : & chalk_ir:: QuantifiedWhereClauses < Self > ,
218225 fmt : & mut fmt:: Formatter < ' _ > ,
219226 ) -> Option < fmt:: Result > {
220227 Some ( write ! ( fmt, "{:?}" , clauses. as_slice( Interner ) ) )
221228 }
222229
230+ fn debug_constraints (
231+ _clauses : & chalk_ir:: Constraints < Self > ,
232+ _fmt : & mut fmt:: Formatter < ' _ > ,
233+ ) -> Option < fmt:: Result > {
234+ None
235+ }
236+
223237 fn intern_ty ( self , kind : chalk_ir:: TyKind < Self > ) -> Self :: InternedType {
224238 let flags = kind. compute_flags ( self ) ;
225239 Interned :: new ( InternedWrapper ( chalk_ir:: TyData { kind, flags } ) )
@@ -272,17 +286,17 @@ impl chalk_ir::interner::Interner for Interner {
272286 Arc :: new ( goal)
273287 }
274288
289+ fn goal_data ( self , goal : & Self :: InternedGoal ) -> & GoalData < Self > {
290+ goal
291+ }
292+
275293 fn intern_goals < E > (
276294 self ,
277295 data : impl IntoIterator < Item = Result < Goal < Self > , E > > ,
278296 ) -> Result < Self :: InternedGoals , E > {
279297 data. into_iter ( ) . collect ( )
280298 }
281299
282- fn goal_data ( self , goal : & Self :: InternedGoal ) -> & GoalData < Self > {
283- goal
284- }
285-
286300 fn goals_data ( self , goals : & Self :: InternedGoals ) -> & [ Goal < Interner > ] {
287301 goals
288302 }
@@ -367,32 +381,18 @@ impl chalk_ir::interner::Interner for Interner {
367381 ) -> & [ chalk_ir:: CanonicalVarKind < Self > ] {
368382 canonical_var_kinds
369383 }
370-
371384 fn intern_constraints < E > (
372385 self ,
373386 data : impl IntoIterator < Item = Result < chalk_ir:: InEnvironment < chalk_ir:: Constraint < Self > > , E > > ,
374387 ) -> Result < Self :: InternedConstraints , E > {
375388 data. into_iter ( ) . collect ( )
376389 }
377-
378390 fn constraints_data (
379391 self ,
380392 constraints : & Self :: InternedConstraints ,
381393 ) -> & [ chalk_ir:: InEnvironment < chalk_ir:: Constraint < Self > > ] {
382394 constraints
383395 }
384- fn debug_closure_id (
385- _fn_def_id : chalk_ir:: ClosureId < Self > ,
386- _fmt : & mut fmt:: Formatter < ' _ > ,
387- ) -> Option < fmt:: Result > {
388- None
389- }
390- fn debug_constraints (
391- _clauses : & chalk_ir:: Constraints < Self > ,
392- _fmt : & mut fmt:: Formatter < ' _ > ,
393- ) -> Option < fmt:: Result > {
394- None
395- }
396396
397397 fn intern_variances < E > (
398398 self ,
0 commit comments