From 153eb72d652ca2868ad586056579d71d9231254f Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Tue, 27 Apr 2021 15:47:49 -0700 Subject: [PATCH 1/2] rustdoc: change aliases attribute to data-aliases The "aliases" attribute is not listed [on MDN], so it sounds like it's rustdoc-specific. We don't want to conflict with any attributes that are added to the spec in the future. [on MDN]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Heading_Elements --- src/librustdoc/html/render/mod.rs | 2 +- src/librustdoc/html/static/main.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/librustdoc/html/render/mod.rs b/src/librustdoc/html/render/mod.rs index 518dbc6eeb3b9..7de72d8198725 100644 --- a/src/librustdoc/html/render/mod.rs +++ b/src/librustdoc/html/render/mod.rs @@ -1546,7 +1546,7 @@ fn render_impl( let aliases = if aliases.is_empty() { String::new() } else { - format!(" aliases=\"{}\"", aliases.join(",")) + format!(" data-aliases=\"{}\"", aliases.join(",")) }; if let Some(use_absolute) = use_absolute { write!( diff --git a/src/librustdoc/html/static/main.js b/src/librustdoc/html/static/main.js index 7fbb97beae7e9..95b18490641ff 100644 --- a/src/librustdoc/html/static/main.js +++ b/src/librustdoc/html/static/main.js @@ -834,7 +834,7 @@ function hideThemeButtonState() { // (like "Send" and "Sync"). var inlined_types = new Set(); onEachLazy(synthetic_implementors.getElementsByClassName("impl"), function(el) { - var aliases = el.getAttribute("aliases"); + var aliases = el.getAttribute("data-aliases"); if (!aliases) { return; } From b57049acdb85aa96fac8abcbbbc8d8948b698634 Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Tue, 27 Apr 2021 16:27:07 -0700 Subject: [PATCH 2/2] rustdoc: update auto_aliases test case with data-aliases attribute --- src/test/rustdoc/auto_aliases.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/rustdoc/auto_aliases.rs b/src/test/rustdoc/auto_aliases.rs index b8f3527510cc9..56e0770ab5c49 100644 --- a/src/test/rustdoc/auto_aliases.rs +++ b/src/test/rustdoc/auto_aliases.rs @@ -1,6 +1,6 @@ #![feature(auto_traits)] -// @has auto_aliases/trait.Bar.html '//h3[@aliases="auto_aliases::Foo"]' 'impl Bar for Foo' +// @has auto_aliases/trait.Bar.html '//h3[@data-aliases="auto_aliases::Foo"]' 'impl Bar for Foo' pub struct Foo; pub auto trait Bar {}