From b89e828c0427f40b2c093c1dc80ee1184a8fd46f Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Fri, 26 Feb 2021 07:33:28 -0800 Subject: [PATCH] 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 --- src/librustdoc/clean/cfg.rs | 1 + src/librustdoc/clean/cfg/tests.rs | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/src/librustdoc/clean/cfg.rs b/src/librustdoc/clean/cfg.rs index 444b73246da4..2e2af703bcf1 100644 --- a/src/librustdoc/clean/cfg.rs +++ b/src/librustdoc/clean/cfg.rs @@ -483,6 +483,7 @@ impl<'a> fmt::Display for Display<'a> { "openbsd" => "OpenBSD", "redox" => "Redox", "solaris" => "Solaris", + "wasi" => "WASI", "windows" => "Windows", _ => "", }, diff --git a/src/librustdoc/clean/cfg/tests.rs b/src/librustdoc/clean/cfg/tests.rs index 3a78269f19af..34b9cbcb6793 100644 --- a/src/librustdoc/clean/cfg/tests.rs +++ b/src/librustdoc/clean/cfg/tests.rs @@ -367,6 +367,10 @@ fn test_render_long_html() { name_value_cfg("target_os", "macos").render_long_html(), "This is supported on macOS only." ); + assert_eq!( + name_value_cfg("target_os", "wasi").render_long_html(), + "This is supported on WASI only." + ); assert_eq!( name_value_cfg("target_pointer_width", "16").render_long_html(), "This is supported on 16-bit only."