@@ -51,8 +51,8 @@ impl chalk_ir::interner::Interner for Interner {
51
51
type InternedGoal = Arc < GoalData < Self > > ;
52
52
type InternedGoals = Vec < Goal < Self > > ;
53
53
type InternedSubstitution = Interned < InternedWrapper < SmallVec < [ GenericArg ; 2 ] > > > ;
54
- type InternedProgramClause = chalk_ir:: ProgramClauseData < Self > ;
55
54
type InternedProgramClauses = Interned < InternedWrapper < Vec < chalk_ir:: ProgramClause < Self > > > > ;
55
+ type InternedProgramClause = chalk_ir:: ProgramClauseData < Self > ;
56
56
type InternedQuantifiedWhereClauses =
57
57
Interned < InternedWrapper < Vec < chalk_ir:: QuantifiedWhereClause < Self > > > > ;
58
58
type InternedVariableKinds = Interned < InternedWrapper < Vec < chalk_ir:: VariableKind < Interner > > > > ;
@@ -86,6 +86,27 @@ impl chalk_ir::interner::Interner for Interner {
86
86
tls:: with_current_program ( |prog| Some ( prog?. debug_assoc_type_id ( id, fmt) ) )
87
87
}
88
88
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
+
89
110
fn debug_alias (
90
111
alias : & chalk_ir:: AliasTy < Interner > ,
91
112
fmt : & mut fmt:: Formatter < ' _ > ,
@@ -113,13 +134,6 @@ impl chalk_ir::interner::Interner for Interner {
113
134
Some ( write ! ( fmt, "{:?}" , opaque_ty. opaque_ty_id) )
114
135
}
115
136
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
-
123
137
fn debug_ty ( ty : & chalk_ir:: Ty < Interner > , fmt : & mut fmt:: Formatter < ' _ > ) -> Option < fmt:: Result > {
124
138
Some ( write ! ( fmt, "{:?}" , ty. data( Interner ) ) )
125
139
}
@@ -131,76 +145,56 @@ impl chalk_ir::interner::Interner for Interner {
131
145
Some ( write ! ( fmt, "{:?}" , lifetime. data( Interner ) ) )
132
146
}
133
147
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 > ,
162
150
fmt : & mut fmt:: Formatter < ' _ > ,
163
151
) -> Option < fmt:: Result > {
164
- Some ( write ! ( fmt, "{:?}" , substitution . debug ( Interner ) ) )
152
+ Some ( write ! ( fmt, "{:?}" , constant . data ( Interner ) ) )
165
153
}
166
154
167
- fn debug_separator_trait_ref (
168
- separator_trait_ref : & chalk_ir :: SeparatorTraitRef < ' _ , Interner > ,
155
+ fn debug_generic_arg (
156
+ parameter : & GenericArg ,
169
157
fmt : & mut fmt:: Formatter < ' _ > ,
170
158
) -> Option < fmt:: Result > {
171
- Some ( write ! ( fmt, "{:?}" , separator_trait_ref . debug ( Interner ) ) )
159
+ Some ( write ! ( fmt, "{:?}" , parameter . data ( Interner ) . inner_debug ( ) ) )
172
160
}
173
161
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
- }
186
162
fn debug_variable_kinds (
187
163
variable_kinds : & chalk_ir:: VariableKinds < Self > ,
188
164
fmt : & mut fmt:: Formatter < ' _ > ,
189
165
) -> Option < fmt:: Result > {
190
166
Some ( write ! ( fmt, "{:?}" , variable_kinds. as_slice( Interner ) ) )
191
167
}
168
+
192
169
fn debug_variable_kinds_with_angles (
193
170
variable_kinds : & chalk_ir:: VariableKinds < Self > ,
194
171
fmt : & mut fmt:: Formatter < ' _ > ,
195
172
) -> Option < fmt:: Result > {
196
173
Some ( write ! ( fmt, "{:?}" , variable_kinds. inner_debug( Interner ) ) )
197
174
}
175
+
198
176
fn debug_canonical_var_kinds (
199
177
canonical_var_kinds : & chalk_ir:: CanonicalVarKinds < Self > ,
200
178
fmt : & mut fmt:: Formatter < ' _ > ,
201
179
) -> Option < fmt:: Result > {
202
180
Some ( write ! ( fmt, "{:?}" , canonical_var_kinds. as_slice( Interner ) ) )
203
181
}
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
+ }
204
198
fn debug_program_clause (
205
199
clause : & chalk_ir:: ProgramClause < Self > ,
206
200
fmt : & mut fmt:: Formatter < ' _ > ,
@@ -213,13 +207,33 @@ impl chalk_ir::interner::Interner for Interner {
213
207
) -> Option < fmt:: Result > {
214
208
Some ( write ! ( fmt, "{:?}" , clauses. as_slice( Interner ) ) )
215
209
}
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
+
216
223
fn debug_quantified_where_clauses (
217
224
clauses : & chalk_ir:: QuantifiedWhereClauses < Self > ,
218
225
fmt : & mut fmt:: Formatter < ' _ > ,
219
226
) -> Option < fmt:: Result > {
220
227
Some ( write ! ( fmt, "{:?}" , clauses. as_slice( Interner ) ) )
221
228
}
222
229
230
+ fn debug_constraints (
231
+ _clauses : & chalk_ir:: Constraints < Self > ,
232
+ _fmt : & mut fmt:: Formatter < ' _ > ,
233
+ ) -> Option < fmt:: Result > {
234
+ None
235
+ }
236
+
223
237
fn intern_ty ( self , kind : chalk_ir:: TyKind < Self > ) -> Self :: InternedType {
224
238
let flags = kind. compute_flags ( self ) ;
225
239
Interned :: new ( InternedWrapper ( chalk_ir:: TyData { kind, flags } ) )
@@ -272,17 +286,17 @@ impl chalk_ir::interner::Interner for Interner {
272
286
Arc :: new ( goal)
273
287
}
274
288
289
+ fn goal_data ( self , goal : & Self :: InternedGoal ) -> & GoalData < Self > {
290
+ goal
291
+ }
292
+
275
293
fn intern_goals < E > (
276
294
self ,
277
295
data : impl IntoIterator < Item = Result < Goal < Self > , E > > ,
278
296
) -> Result < Self :: InternedGoals , E > {
279
297
data. into_iter ( ) . collect ( )
280
298
}
281
299
282
- fn goal_data ( self , goal : & Self :: InternedGoal ) -> & GoalData < Self > {
283
- goal
284
- }
285
-
286
300
fn goals_data ( self , goals : & Self :: InternedGoals ) -> & [ Goal < Interner > ] {
287
301
goals
288
302
}
@@ -367,32 +381,18 @@ impl chalk_ir::interner::Interner for Interner {
367
381
) -> & [ chalk_ir:: CanonicalVarKind < Self > ] {
368
382
canonical_var_kinds
369
383
}
370
-
371
384
fn intern_constraints < E > (
372
385
self ,
373
386
data : impl IntoIterator < Item = Result < chalk_ir:: InEnvironment < chalk_ir:: Constraint < Self > > , E > > ,
374
387
) -> Result < Self :: InternedConstraints , E > {
375
388
data. into_iter ( ) . collect ( )
376
389
}
377
-
378
390
fn constraints_data (
379
391
self ,
380
392
constraints : & Self :: InternedConstraints ,
381
393
) -> & [ chalk_ir:: InEnvironment < chalk_ir:: Constraint < Self > > ] {
382
394
constraints
383
395
}
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
- }
396
396
397
397
fn intern_variances < E > (
398
398
self ,
0 commit comments