Skip to content

Commit

Permalink
Fix ICE
Browse files Browse the repository at this point in the history
Left a todo awhile ago (I think), so fill it in to print a const for `Term`s.
  • Loading branch information
JulianKnodt committed Dec 22, 2022
1 parent a8207df commit 8a4cbf4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/librustdoc/html/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
})
}
}

Expand Down
14 changes: 14 additions & 0 deletions src/test/rustdoc/issue-105952.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#![crate_name = "foo"]

#![feature(associated_const_equality)]
pub enum ParseMode {
Raw,
}
pub trait Parse {
const PARSE_MODE: ParseMode;
}
pub trait RenderRaw {}

// @hasraw foo/trait.RenderRaw.html 'impl'
// @hasraw foo/trait.RenderRaw.html 'ParseMode::Raw'
impl<T: Parse<PARSE_MODE = { ParseMode::Raw }>> RenderRaw for T {}

0 comments on commit 8a4cbf4

Please sign in to comment.