1
Fork 0
Left a todo awhile ago (I think), so fill it in to print a const for `Term`s.
This commit is contained in:
kadmin 2022-12-21 23:54:29 +00:00
parent a8207df49e
commit 8a4cbf4f7b
2 changed files with 18 additions and 4 deletions

View file

@ -1655,10 +1655,10 @@ impl clean::types::Term {
&'a self,
cx: &'a Context<'tcx>,
) -> impl fmt::Display + 'a + Captures<'tcx> {
match self {
clean::types::Term::Type(ty) => ty.print(cx),
_ => todo!(),
}
display_fn(move |f| match self {
clean::types::Term::Type(ty) => fmt::Display::fmt(&ty.print(cx), f),
clean::types::Term::Constant(ct) => fmt::Display::fmt(&ct.print(cx.tcx()), f),
})
}
}