Skip to content

Commit

Permalink
Rollup merge of rust-lang#84636 - notriddle:data-aliases, r=jyn514,Gu…
Browse files Browse the repository at this point in the history
…illaumeGomez

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
  • Loading branch information
m-ou-se authored Apr 28, 2021
2 parents 5ff20c5 + b57049a commit a810244
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/librustdoc/html/render/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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!(
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/html/static/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/rustdoc/auto_aliases.rs
Original file line number Diff line number Diff line change
@@ -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 {}

0 comments on commit a810244

Please sign in to comment.