Teach rustdoc how to display WASI.

As a followup to [this comment] in #82420, this patch teaches rustdoc
how to display WASI.

[this comment]: https://github.com/rust-lang/rust/pull/82420#issuecomment-784523826
This commit is contained in:
Dan Gohman 2021-02-26 07:33:28 -08:00
parent 8e863eb59a
commit b89e828c04
2 changed files with 5 additions and 0 deletions

View File

@ -483,6 +483,7 @@ impl<'a> fmt::Display for Display<'a> {
"openbsd" => "OpenBSD",
"redox" => "Redox",
"solaris" => "Solaris",
"wasi" => "WASI",
"windows" => "Windows",
_ => "",
},

View File

@ -367,6 +367,10 @@ fn test_render_long_html() {
name_value_cfg("target_os", "macos").render_long_html(),
"This is supported on <strong>macOS</strong> only."
);
assert_eq!(
name_value_cfg("target_os", "wasi").render_long_html(),
"This is supported on <strong>WASI</strong> only."
);
assert_eq!(
name_value_cfg("target_pointer_width", "16").render_long_html(),
"This is supported on <strong>16-bit</strong> only."