Open
Description
Oh no :( The rustdoc HTML backend shouldn't use HIR pretty-printing at all. Fortunately, rustdoc only displays a fixed set of attrs: export_name
, link_section
, no_mangle
, non_exhaustive
and repr
but for repr
we don't rely on HIR pretty-printing.
Using HIR pretty is busted anyway, since it doesn't escape HTML. E.g., #[unsafe(link_section = "<script>alert()</script>")]
triggers an alert.
Originally posted by @fmease in #142823 (comment)