diff --git a/src/librustdoc/html/render/mod.rs b/src/librustdoc/html/render/mod.rs index a8e32e84cbcbd..2b66ab22475d4 100644 --- a/src/librustdoc/html/render/mod.rs +++ b/src/librustdoc/html/render/mod.rs @@ -569,7 +569,10 @@ fn short_item_info( message.push_str(&format!(": {}", html.into_string())); } extra_info.push(format!( - "
👎 {}
", + "
\ + 👎\ + {}\ +
", message, )); } @@ -582,8 +585,9 @@ fn short_item_info( .filter(|stab| stab.feature != sym::rustc_private) .map(|stab| (stab.level, stab.feature)) { - let mut message = - "🔬 This is a nightly-only experimental API.".to_owned(); + let mut message = "🔬\ + This is a nightly-only experimental API." + .to_owned(); let mut feature = format!("{}", Escape(feature.as_str())); if let (Some(url), Some(issue)) = (&cx.shared.issue_tracker_base_url, issue) { @@ -594,7 +598,7 @@ fn short_item_info( )); } - message.push_str(&format!(" ({})", feature)); + message.push_str(&format!(" ({})", feature)); extra_info.push(format!("
{}
", message)); } diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css index 8d0bcb7519b61..b1fa5e7d86de6 100644 --- a/src/librustdoc/html/static/css/rustdoc.css +++ b/src/librustdoc/html/static/css/rustdoc.css @@ -1164,6 +1164,7 @@ so that we can apply CSS-filters to change the arrow color in themes */ .stab .emoji { font-size: 1.25rem; + margin-right: 0.3rem; } /* Black one-pixel outline around emoji shapes */ diff --git a/src/test/rustdoc/issue-32374.rs b/src/test/rustdoc/issue-32374.rs index 9c585497d354f..8d2c27cf3d77d 100644 --- a/src/test/rustdoc/issue-32374.rs +++ b/src/test/rustdoc/issue-32374.rs @@ -8,20 +8,24 @@ // 'Experimental' // @matches issue_32374/index.html '//*[@class="item-right docblock-short"]/text()' 'Docs' -// @has issue_32374/struct.T.html '//*[@class="stab deprecated"]' \ -// '👎 Deprecated since 1.0.0: text' +// @has issue_32374/struct.T.html '//*[@class="stab deprecated"]/span' '👎' +// @has issue_32374/struct.T.html '//*[@class="stab deprecated"]/span' \ +// 'Deprecated since 1.0.0: text' // @hasraw - 'test #32374' +// @matches issue_32374/struct.T.html '//*[@class="stab unstable"]' '🔬' // @matches issue_32374/struct.T.html '//*[@class="stab unstable"]' \ -// '🔬 This is a nightly-only experimental API. \(test\s#32374\)$' +// 'This is a nightly-only experimental API. \(test\s#32374\)$' /// Docs #[deprecated(since = "1.0.0", note = "text")] #[unstable(feature = "test", issue = "32374")] pub struct T; +// @has issue_32374/struct.U.html '//*[@class="stab deprecated"]' '👎' // @has issue_32374/struct.U.html '//*[@class="stab deprecated"]' \ -// '👎 Deprecated since 1.0.0: deprecated' +// 'Deprecated since 1.0.0: deprecated' +// @has issue_32374/struct.U.html '//*[@class="stab unstable"]' '🔬' // @has issue_32374/struct.U.html '//*[@class="stab unstable"]' \ -// '🔬 This is a nightly-only experimental API. (test #32374)' +// 'This is a nightly-only experimental API. (test #32374)' #[deprecated(since = "1.0.0", note = "deprecated")] #[unstable(feature = "test", issue = "32374", reason = "unstable")] pub struct U;