Skip to content

Commit fe677b6

Browse files
committed
Auto merge of #641 - flodiebold:print-concrete-const, r=jackh726
Program printer: Use Debug to print concrete consts Most importantly, we shouldn't panic for them. I was considering requiring `Interner::InternedConcreteConst` to implement `Display`, but it already requires `Debug` and I think that may be a better choice anyway. Of course this may result in an invalid program being printed, but that's still better than panicking.
2 parents 80747d9 + 305eb02 commit fe677b6

File tree

1 file changed

+1
-1
lines changed
  • chalk-solve/src/display

1 file changed

+1
-1
lines changed

chalk-solve/src/display/ty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ impl<I: Interner> RenderAsRust<I> for ConstValue<I> {
259259
ConstValue::BoundVar(v) => write!(f, "{}", s.display_bound_var(v)),
260260
ConstValue::InferenceVar(_) => write!(f, "_"),
261261
ConstValue::Placeholder(_) => write!(f, "<const placeholder>"),
262-
ConstValue::Concrete(_value) => unimplemented!("const values"),
262+
ConstValue::Concrete(value) => write!(f, "{:?}", value.interned),
263263
}
264264
}
265265
}

0 commit comments

Comments
 (0)