Skip to content

Commit fe18393

Browse files
committed
Improve debug output
1 parent 31c5585 commit fe18393

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

chalk-integration/src/program.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ impl tls::DebugContext for Program {
121121
fmt: &mut fmt::Formatter<'_>,
122122
) -> Result<(), fmt::Error> {
123123
if let Some(d) = self.opaque_ty_data.get(&opaque_ty_id) {
124-
write!(fmt, "{:?}", d.bound)
124+
write!(fmt, "{:?}", d.bound.value.hidden_ty)
125125
} else {
126126
fmt.debug_struct("InvalidItemId")
127127
.field("index", &opaque_ty_id.0)

chalk-solve/src/clauses/program_clauses.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -167,12 +167,10 @@ impl<I: Interner> ToProgramClauses<I> for OpaqueTyDatum<I> {
167167
.cast(interner),
168168
));
169169

170+
let substitution = Substitution::from1(interner, alias_placeholder_ty.clone());
170171
for bound in &opaque_ty_bound.bounds {
171172
// Implemented(!T<..>: Bound).
172-
let bound_with_placeholder_ty = bound.substitute(
173-
interner,
174-
&Substitution::from1(interner, alias_placeholder_ty.clone()),
175-
);
173+
let bound_with_placeholder_ty = bound.substitute(interner, &substitution);
176174
builder.push_binders(&bound_with_placeholder_ty, |builder, bound| {
177175
builder.push_fact(bound.into_well_formed_goal(interner));
178176
});
@@ -183,7 +181,7 @@ impl<I: Interner> ToProgramClauses<I> for OpaqueTyDatum<I> {
183181
builder.push_clause(
184182
TraitRef {
185183
trait_id: auto_trait_id,
186-
substitution: Substitution::from1(interner, alias_placeholder_ty.clone()),
184+
substitution: substitution.clone(),
187185
},
188186
iter::once(TraitRef {
189187
trait_id: auto_trait_id,

0 commit comments

Comments
 (0)