Skip to content

Commit

Permalink
Teach rustdoc how to display WASI.
Browse files Browse the repository at this point in the history
As a followup to [this comment] in rust-lang#82420, this patch teaches rustdoc
how to display WASI.

[this comment]: rust-lang#82420 (comment)
  • Loading branch information
sunfishcode committed Feb 27, 2021
1 parent 8e863eb commit b89e828
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/librustdoc/clean/cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,7 @@ impl<'a> fmt::Display for Display<'a> {
"openbsd" => "OpenBSD",
"redox" => "Redox",
"solaris" => "Solaris",
"wasi" => "WASI",
"windows" => "Windows",
_ => "",
},
Expand Down
4 changes: 4 additions & 0 deletions src/librustdoc/clean/cfg/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down

0 comments on commit b89e828

Please sign in to comment.