1
Fork 0

Replace h3 and h4 containing invalid DOM

This commit is contained in:
Guillaume Gomez 2021-04-23 22:15:57 +02:00
parent 42312501d0
commit 9077d540da
28 changed files with 190 additions and 130 deletions

View file

@ -1369,7 +1369,11 @@ fn render_impl(
}) })
}) })
.map(|item| format!("{}.{}", item.type_(), name)); .map(|item| format!("{}.{}", item.type_(), name));
write!(w, "<h4 id=\"{}\" class=\"{}{}\">", id, item_type, in_trait_class,); write!(
w,
"<div id=\"{}\" class=\"{}{}\" role=\"heading\" aria-level=\"4\">",
id, item_type, in_trait_class,
);
w.write_str("<code>"); w.write_str("<code>");
render_assoc_item( render_assoc_item(
w, w,
@ -1388,13 +1392,17 @@ fn render_impl(
); );
write!(w, "<a href=\"#{}\" class=\"anchor\"></a>", id); write!(w, "<a href=\"#{}\" class=\"anchor\"></a>", id);
write_srclink(cx, item, w); write_srclink(cx, item, w);
w.write_str("</h4>"); w.write_str("</div>");
} }
} }
clean::TypedefItem(ref tydef, _) => { clean::TypedefItem(ref tydef, _) => {
let source_id = format!("{}.{}", ItemType::AssocType, name); let source_id = format!("{}.{}", ItemType::AssocType, name);
let id = cx.derive_id(source_id.clone()); let id = cx.derive_id(source_id.clone());
write!(w, "<h4 id=\"{}\" class=\"{}{}\"><code>", id, item_type, in_trait_class); write!(
w,
"<div id=\"{}\" class=\"{}{}\" role=\"heading\" aria-level=\"4\"><code>",
id, item_type, in_trait_class
);
assoc_type( assoc_type(
w, w,
item, item,
@ -1406,12 +1414,16 @@ fn render_impl(
); );
w.write_str("</code>"); w.write_str("</code>");
write!(w, "<a href=\"#{}\" class=\"anchor\"></a>", id); write!(w, "<a href=\"#{}\" class=\"anchor\"></a>", id);
w.write_str("</h4>"); w.write_str("</div>");
} }
clean::AssocConstItem(ref ty, ref default) => { clean::AssocConstItem(ref ty, ref default) => {
let source_id = format!("{}.{}", item_type, name); let source_id = format!("{}.{}", item_type, name);
let id = cx.derive_id(source_id.clone()); let id = cx.derive_id(source_id.clone());
write!(w, "<h4 id=\"{}\" class=\"{}{}\"><code>", id, item_type, in_trait_class); write!(
w,
"<div id=\"{}\" class=\"{}{}\" role=\"heading\" aria-level=\"4\"><code>",
id, item_type, in_trait_class
);
assoc_const( assoc_const(
w, w,
item, item,
@ -1431,12 +1443,16 @@ fn render_impl(
); );
write!(w, "<a href=\"#{}\" class=\"anchor\"></a>", id); write!(w, "<a href=\"#{}\" class=\"anchor\"></a>", id);
write_srclink(cx, item, w); write_srclink(cx, item, w);
w.write_str("</h4>"); w.write_str("</div>");
} }
clean::AssocTypeItem(ref bounds, ref default) => { clean::AssocTypeItem(ref bounds, ref default) => {
let source_id = format!("{}.{}", item_type, name); let source_id = format!("{}.{}", item_type, name);
let id = cx.derive_id(source_id.clone()); let id = cx.derive_id(source_id.clone());
write!(w, "<h4 id=\"{}\" class=\"{}{}\"><code>", id, item_type, in_trait_class); write!(
w,
"<div id=\"{}\" class=\"{}{}\" role=\"heading\" aria-level=\"4\"><code>",
id, item_type, in_trait_class,
);
assoc_type( assoc_type(
w, w,
item, item,
@ -1448,7 +1464,7 @@ fn render_impl(
); );
w.write_str("</code>"); w.write_str("</code>");
write!(w, "<a href=\"#{}\" class=\"anchor\"></a>", id); write!(w, "<a href=\"#{}\" class=\"anchor\"></a>", id);
w.write_str("</h4>"); w.write_str("</div>");
} }
clean::StrippedItem(..) => return, clean::StrippedItem(..) => return,
_ => panic!("can't make docs for trait item with name {:?}", item.name), _ => panic!("can't make docs for trait item with name {:?}", item.name),
@ -1577,7 +1593,8 @@ fn render_impl(
if let Some(use_absolute) = use_absolute { if let Some(use_absolute) = use_absolute {
write!( write!(
w, w,
"{}<h3 id=\"{}\" class=\"impl\"{}><code class=\"in-band\">", "{}<div id=\"{}\" class=\"impl\"{} role=\"heading\" aria-level=\"3\">\
<code class=\"in-band\">",
open_details(&mut close_tags, is_implementing_trait), open_details(&mut close_tags, is_implementing_trait),
id, id,
aliases aliases
@ -1604,7 +1621,8 @@ fn render_impl(
} else { } else {
write!( write!(
w, w,
"{}<h3 id=\"{}\" class=\"impl\"{}><code class=\"in-band\">{}</code>", "{}<div id=\"{}\" class=\"impl\"{} role=\"heading\" aria-level=\"3\">\
<code class=\"in-band\">{}</code>",
open_details(&mut close_tags, is_implementing_trait), open_details(&mut close_tags, is_implementing_trait),
id, id,
aliases, aliases,
@ -1621,9 +1639,9 @@ fn render_impl(
); );
write_srclink(cx, &i.impl_item, w); write_srclink(cx, &i.impl_item, w);
if !toggled { if !toggled {
w.write_str("</h3>"); w.write_str("</div>");
} else { } else {
w.write_str("</h3></summary>"); w.write_str("</div></summary>");
} }
if trait_.is_some() { if trait_.is_some() {

View file

@ -585,12 +585,12 @@ fn item_trait(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, t: &clean::Tra
if toggled { if toggled {
write!(w, "<details class=\"rustdoc-toggle\" open><summary>"); write!(w, "<details class=\"rustdoc-toggle\" open><summary>");
} }
write!(w, "<h3 id=\"{id}\" class=\"method\"><code>", id = id); write!(w, "<div id=\"{}\" class=\"method\" role=\"heading\" aria-level=\"3\"><code>", id);
render_assoc_item(w, m, AssocItemLink::Anchor(Some(&id)), ItemType::Impl, cx); render_assoc_item(w, m, AssocItemLink::Anchor(Some(&id)), ItemType::Impl, cx);
w.write_str("</code>"); w.write_str("</code>");
render_stability_since(w, m, t, cx.tcx()); render_stability_since(w, m, t, cx.tcx());
write_srclink(cx, m, w); write_srclink(cx, m, w);
w.write_str("</h3>"); w.write_str("</div>");
if toggled { if toggled {
write!(w, "</summary>"); write!(w, "</summary>");
w.push_buffer(content); w.push_buffer(content);

View file

@ -117,8 +117,7 @@ h2 {
h3 { h3 {
font-size: 1.3em; font-size: 1.3em;
} }
h1, h2, h3:not(.impl):not(.method):not(.type):not(.tymethod):not(.notable), h1, h2, h3:not(.notable), h4 {
h4:not(.method):not(.type):not(.tymethod):not(.associatedconstant):not(.associatedtype) {
font-weight: 500; font-weight: 500;
margin: 20px 0 15px 0; margin: 20px 0 15px 0;
padding-bottom: 6px; padding-bottom: 6px;
@ -135,30 +134,38 @@ h1.fqn {
h1.fqn > .in-band > a:hover { h1.fqn > .in-band > a:hover {
text-decoration: underline; text-decoration: underline;
} }
h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h2, h3, h4 {
h4:not(.method):not(.type):not(.tymethod):not(.associatedconstant):not(.associatedtype) {
border-bottom: 1px solid; border-bottom: 1px solid;
} }
h3.impl, h3.method, h4.method, h3.type, h4.type, h4.associatedconstant, h4.associatedtype { div[aria-level="3"].impl, div[aria-level="3"].method, div[aria-level="4"].method,
div[aria-level="3"].type, div[aria-level="4"].type, div[aria-level="4"].associatedconstant,
div[aria-level="4"].associatedtype {
flex-basis: 100%; flex-basis: 100%;
font-weight: 600; font-weight: 600;
margin-top: 16px; margin-top: 16px;
margin-bottom: 10px; margin-bottom: 10px;
position: relative; position: relative;
} }
h3.impl, h3.method, h4.method.trait-impl, h3.type, div[aria-level="3"].impl, div[aria-level="3"].method, div[aria-level="4"].method.trait-impl,
h4.type.trait-impl, h4.associatedconstant.trait-impl, h4.associatedtype.trait-impl { div[aria-level="3"].type, div[aria-level="4"].type.trait-impl,
div[aria-level="4"].associatedconstant.trait-impl,
div[aria-level="4"].associatedtype.trait-impl {
padding-left: 15px; padding-left: 15px;
} }
div.impl-items > div {
padding-left: 0;
}
h1, h2, h3, h4, h1, h2, h3, h4,
.sidebar, a.source, .search-input, .search-results .result-name, .sidebar, a.source, .search-input, .search-results .result-name,
.content table td:first-child > a, .content table td:first-child > a,
div.item-list .out-of-band, .collapse-toggle, div.item-list .out-of-band, span.since,
#source-sidebar, #sidebar-toggle, #source-sidebar, #sidebar-toggle,
details.rustdoc-toggle > summary::before, details.rustdoc-toggle > summary::before,
details.undocumented > summary::before, details.undocumented > summary::before,
.content ul.crate a.crate, div.impl-items > div:not(.docblock):not(.item-info),
.content ul.crate a.crate, a.srclink,
/* This selector is for the items listed in the "all items" page. */ /* This selector is for the items listed in the "all items" page. */
#main > ul.docblock > li > a { #main > ul.docblock > li > a {
font-family: "Fira Sans", Arial, sans-serif; font-family: "Fira Sans", Arial, sans-serif;
@ -313,8 +320,6 @@ nav.sub {
margin-bottom: 14px; margin-bottom: 14px;
} }
.block h2, .block h3 { .block h2, .block h3 {
margin-top: 0;
margin-bottom: 8px;
text-align: center; text-align: center;
} }
.block ul, .block li { .block ul, .block li {
@ -462,15 +467,15 @@ nav.sub {
font-weight: normal; font-weight: normal;
} }
h3.impl > .out-of-band { div[aria-level="3"].impl > .out-of-band {
font-size: 21px; font-size: 21px;
} }
h4.method > .out-of-band { div[aria-level="4"].method > .out-of-band {
font-size: 19px; font-size: 19px;
} }
h4 > code, h3 > code, .invisible > code { div[aria-level="3"] > code, div[aria-level="4"] > code, .invisible > code {
max-width: calc(100% - 41px); max-width: calc(100% - 41px);
display: block; display: block;
} }
@ -543,7 +548,7 @@ h4 > code, h3 > code, .invisible > code {
} }
.content .multi-column li { width: 100%; display: inline-block; } .content .multi-column li { width: 100%; display: inline-block; }
.content .method { .content > div.methods > div.method {
font-size: 1em; font-size: 1em;
position: relative; position: relative;
} }
@ -555,7 +560,7 @@ h4 > code, h3 > code, .invisible > code {
font-size: 0.8em; font-size: 0.8em;
} }
.content .methods > div:not(.notable-traits):not(.methods) { .content .methods > div:not(.notable-traits):not(.method) {
margin-left: 40px; margin-left: 40px;
margin-bottom: 15px; margin-bottom: 15px;
} }
@ -564,7 +569,7 @@ h4 > code, h3 > code, .invisible > code {
margin-left: 20px; margin-left: 20px;
margin-top: -34px; margin-top: -34px;
} }
.content .docblock > .impl-items > h4 { .content .docblock > .impl-items > div[aria-level="4"] {
border-bottom: 0; border-bottom: 0;
} }
.content .docblock >.impl-items .table-display { .content .docblock >.impl-items .table-display {
@ -688,7 +693,8 @@ a {
text-decoration: underline; text-decoration: underline;
} }
.invisible > .srclink, h4 > code + .srclink, h3 > code + .srclink { .invisible > .srclink,
div[aria-level="3"] > code + .srclink, div[aria-level="4"] > code + .srclink {
position: absolute; position: absolute;
top: 0; top: 0;
right: 0; right: 0;
@ -923,7 +929,8 @@ body.blur > :not(#help) {
flex-grow: 1; flex-grow: 1;
} }
.impl-items h4, h4.impl, h3.impl, .methods h3 { .impl-items div[aria-level="4"], div[aria-level="4"].impl, div[aria-level="3"].impl,
.methods div[aria-level="3"] {
display: flex; display: flex;
flex-basis: 100%; flex-basis: 100%;
font-size: 16px; font-size: 16px;
@ -985,6 +992,45 @@ a.test-arrow:hover{
font-weight: 300; font-weight: 300;
} }
.collapse-toggle {
font-weight: 300;
position: absolute;
left: -23px;
top: 0;
}
div[aria-level="3"] > .collapse-toggle, div[aria-level="4"] > .collapse-toggle {
font-size: 0.8em;
top: 5px;
}
.toggle-wrapper > .collapse-toggle {
left: -24px;
margin-top: 0px;
}
.toggle-wrapper {
position: relative;
margin-top: 0;
}
.toggle-wrapper.collapsed {
height: 25px;
transition: height .2s;
margin-bottom: .6em;
}
.collapse-toggle > .inner {
display: inline-block;
width: 1.2ch;
text-align: center;
}
.collapse-toggle.hidden-default {
position: relative;
margin-left: 20px;
}
.since + .srclink { .since + .srclink {
display: table-cell; display: table-cell;
padding-left: 10px; padding-left: 10px;
@ -1197,7 +1243,7 @@ pre.rust {
margin-left: 5px; margin-left: 5px;
} }
h4 > .notable-traits { div[aria-level="4"] > .notable-traits {
position: absolute; position: absolute;
left: -44px; left: -44px;
top: 2px; top: 2px;
@ -1615,7 +1661,7 @@ details.undocumented[open] > summary::before {
padding: 0; padding: 0;
} }
.content h4 > .out-of-band { .content div[aria-level="4"] > .out-of-band {
position: inherit; position: inherit;
} }
@ -1638,7 +1684,7 @@ details.undocumented[open] > summary::before {
z-index: 1; z-index: 1;
} }
h4 > .notable-traits { div[aria-level="4"] > .notable-traits {
position: absolute; position: absolute;
left: -22px; left: -22px;
top: 24px; top: 24px;

View file

@ -10,8 +10,7 @@ body {
color: #c5c5c5; color: #c5c5c5;
} }
h1, h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h1, h2, h3:not(.notable), h4 {
h4:not(.method):not(.type):not(.tymethod) {
color: white; color: white;
} }
h1.fqn { h1.fqn {
@ -20,10 +19,10 @@ h1.fqn {
h1.fqn a { h1.fqn a {
color: #fff; color: #fff;
} }
h2, h3:not(.impl):not(.method):not(.type):not(.tymethod) { h2, h3, h4 {
border-bottom-color: #5c6773; border-bottom-color: #5c6773;
} }
h4:not(.method):not(.type):not(.tymethod):not(.associatedconstant) { h4 {
border: none; border: none;
} }

View file

@ -3,15 +3,13 @@ body {
color: #ddd; color: #ddd;
} }
h1, h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h1, h2, h3:not(.notable), h4 {
h4:not(.method):not(.type):not(.tymethod) {
color: #ddd; color: #ddd;
} }
h1.fqn { h1.fqn {
border-bottom-color: #d2d2d2; border-bottom-color: #d2d2d2;
} }
h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h2, h3, h4 {
h4:not(.method):not(.type):not(.tymethod) {
border-bottom-color: #d2d2d2; border-bottom-color: #d2d2d2;
} }

View file

@ -5,15 +5,13 @@ body {
color: black; color: black;
} }
h1, h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h1, h2, h3:not(.notable), h4 {
h4:not(.method):not(.type):not(.tymethod) {
color: black; color: black;
} }
h1.fqn { h1.fqn {
border-bottom-color: #D5D5D5; border-bottom-color: #D5D5D5;
} }
h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h2, h3, h4 {
h4:not(.method):not(.type):not(.tymethod) {
border-bottom-color: #DDDDDD; border-bottom-color: #DDDDDD;
} }

View file

@ -77,12 +77,12 @@ struct AsyncFdReadyGuard<'a, T> { x: &'a T }
impl Foo { impl Foo {
// @has async_fn/struct.Foo.html // @has async_fn/struct.Foo.html
// @has - '//h4[@class="method"]' 'pub async fn complicated_lifetimes( &self, context: &impl Bar) -> impl Iterator<Item = &usize>' // @has - '//div[@class="method"]' 'pub async fn complicated_lifetimes( &self, context: &impl Bar) -> impl Iterator<Item = &usize>'
pub async fn complicated_lifetimes(&self, context: &impl Bar) -> impl Iterator<Item = &usize> {} pub async fn complicated_lifetimes(&self, context: &impl Bar) -> impl Iterator<Item = &usize> {}
// taken from `tokio` as an example of a method that was particularly bad before // taken from `tokio` as an example of a method that was particularly bad before
// @has - '//h4[@class="method"]' "pub async fn readable<T>(&self) -> Result<AsyncFdReadyGuard<'_, T>, ()>" // @has - '//div[@class="method"]' "pub async fn readable<T>(&self) -> Result<AsyncFdReadyGuard<'_, T>, ()>"
pub async fn readable<T>(&self) -> Result<AsyncFdReadyGuard<'_, T>, ()> {} pub async fn readable<T>(&self) -> Result<AsyncFdReadyGuard<'_, T>, ()> {}
// @has - '//h4[@class="method"]' "pub async fn mut_self(&mut self)" // @has - '//div[@class="method"]' "pub async fn mut_self(&mut self)"
pub async fn mut_self(&mut self) {} pub async fn mut_self(&mut self) {}
} }

View file

@ -1,6 +1,6 @@
#![feature(auto_traits)] #![feature(auto_traits)]
// @has auto_aliases/trait.Bar.html '//h3[@data-aliases="auto_aliases::Foo"]' 'impl Bar for Foo' // @has auto_aliases/trait.Bar.html '//div[@data-aliases="auto_aliases::Foo"]' 'impl Bar for Foo'
pub struct Foo; pub struct Foo;
pub auto trait Bar {} pub auto trait Bar {}

View file

@ -1,6 +1,6 @@
#![crate_name = "foo"] #![crate_name = "foo"]
// @has foo/struct.S.html '//h3[@id="impl-Into%3CU%3E"]//code' 'impl<T, U> Into<U> for T' // @has foo/struct.S.html '//div[@id="impl-Into%3CU%3E"]//code' 'impl<T, U> Into<U> for T'
pub struct S2 {} pub struct S2 {}
mod m { mod m {
pub struct S {} pub struct S {}

View file

@ -38,12 +38,12 @@ pub const unsafe fn bar_not_gated() -> u32 { 42 }
pub struct Foo; pub struct Foo;
impl Foo { impl Foo {
// @has 'foo/struct.Foo.html' '//h4[@id="method.gated"]/code' 'pub unsafe fn gated() -> u32' // @has 'foo/struct.Foo.html' '//div[@id="method.gated"]/code' 'pub unsafe fn gated() -> u32'
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature="foo", issue = "none")] #[rustc_const_unstable(feature="foo", issue = "none")]
pub const unsafe fn gated() -> u32 { 42 } pub const unsafe fn gated() -> u32 { 42 }
// @has 'foo/struct.Foo.html' '//h4[@id="method.stable_impl"]/code' 'pub const fn stable_impl() -> u32' // @has 'foo/struct.Foo.html' '//div[@id="method.stable_impl"]/code' 'pub const fn stable_impl() -> u32'
// @has - '//span[@class="since"]' '1.0.0 (const: 1.2.0)' // @has - '//span[@class="since"]' '1.0.0 (const: 1.2.0)'
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_stable(feature = "rust1", since = "1.2.0")] #[rustc_const_stable(feature = "rust1", since = "1.2.0")]

View file

@ -8,7 +8,7 @@ pub struct Simd<T, const WIDTH: usize> {
inner: T, inner: T,
} }
// @has foo/struct.Simd.html '//div[@id="trait-implementations-list"]//h3/code' 'impl Add<Simd<u8, 16_usize>> for Simd<u8, 16>' // @has foo/struct.Simd.html '//div[@id="trait-implementations-list"]//div/code' 'impl Add<Simd<u8, 16_usize>> for Simd<u8, 16>'
impl Add for Simd<u8, 16> { impl Add for Simd<u8, 16> {
type Output = Self; type Output = Self;

View file

@ -6,7 +6,7 @@ pub trait Array {
} }
// @has foo/trait.Array.html // @has foo/trait.Array.html
// @has - '//h3[@class="impl"]' 'impl<T, const N: usize> Array for [T; N]' // @has - '//div[@class="impl"]' 'impl<T, const N: usize> Array for [T; N]'
impl <T, const N: usize> Array for [T; N] { impl <T, const N: usize> Array for [T; N] {
type Item = T; type Item = T;
} }

View file

@ -36,7 +36,7 @@ pub struct Foo<const N: usize> where u8: Trait<N>;
// @has foo/struct.Bar.html '//pre[@class="rust struct"]' 'pub struct Bar<T, const N: usize>(_)' // @has foo/struct.Bar.html '//pre[@class="rust struct"]' 'pub struct Bar<T, const N: usize>(_)'
pub struct Bar<T, const N: usize>([T; N]); pub struct Bar<T, const N: usize>([T; N]);
// @has foo/struct.Foo.html '//h3[@id="impl"]/code' 'impl<const M: usize> Foo<M> where u8: Trait<M>' // @has foo/struct.Foo.html '//div[@id="impl"]/code' 'impl<const M: usize> Foo<M> where u8: Trait<M>'
impl<const M: usize> Foo<M> where u8: Trait<M> { impl<const M: usize> Foo<M> where u8: Trait<M> {
// @has - '//*[@id="associatedconstant.FOO_ASSOC"]' 'pub const FOO_ASSOC: usize' // @has - '//*[@id="associatedconstant.FOO_ASSOC"]' 'pub const FOO_ASSOC: usize'
pub const FOO_ASSOC: usize = M + 13; pub const FOO_ASSOC: usize = M + 13;
@ -47,7 +47,7 @@ impl<const M: usize> Foo<M> where u8: Trait<M> {
} }
} }
// @has foo/struct.Bar.html '//h3[@id="impl"]/code' 'impl<const M: usize> Bar<u8, M>' // @has foo/struct.Bar.html '//div[@id="impl"]/code' 'impl<const M: usize> Bar<u8, M>'
impl<const M: usize> Bar<u8, M> { impl<const M: usize> Bar<u8, M> {
// @has - '//*[@id="method.hey"]' \ // @has - '//*[@id="method.hey"]' \
// 'pub fn hey<const N: usize>(&self) -> Foo<N> where u8: Trait<N>' // 'pub fn hey<const N: usize>(&self) -> Foo<N> where u8: Trait<N>'

View file

@ -9,20 +9,20 @@ pub enum Order {
} }
// @has foo/struct.VSet.html '//pre[@class="rust struct"]' 'pub struct VSet<T, const ORDER: Order>' // @has foo/struct.VSet.html '//pre[@class="rust struct"]' 'pub struct VSet<T, const ORDER: Order>'
// @has foo/struct.VSet.html '//h3[@id="impl-Send"]/code' 'impl<T, const ORDER: Order> Send for VSet<T, ORDER>' // @has foo/struct.VSet.html '//div[@id="impl-Send"]/code' 'impl<T, const ORDER: Order> Send for VSet<T, ORDER>'
// @has foo/struct.VSet.html '//h3[@id="impl-Sync"]/code' 'impl<T, const ORDER: Order> Sync for VSet<T, ORDER>' // @has foo/struct.VSet.html '//div[@id="impl-Sync"]/code' 'impl<T, const ORDER: Order> Sync for VSet<T, ORDER>'
pub struct VSet<T, const ORDER: Order> { pub struct VSet<T, const ORDER: Order> {
inner: Vec<T>, inner: Vec<T>,
} }
// @has foo/struct.VSet.html '//h3[@id="impl"]/code' 'impl<T> VSet<T, {Order::Sorted}>' // @has foo/struct.VSet.html '//div[@id="impl"]/code' 'impl<T> VSet<T, {Order::Sorted}>'
impl <T> VSet<T, {Order::Sorted}> { impl <T> VSet<T, {Order::Sorted}> {
pub fn new() -> Self { pub fn new() -> Self {
Self { inner: Vec::new() } Self { inner: Vec::new() }
} }
} }
// @has foo/struct.VSet.html '//h3[@id="impl-1"]/code' 'impl<T> VSet<T, {Order::Unsorted}>' // @has foo/struct.VSet.html '//div[@id="impl-1"]/code' 'impl<T> VSet<T, {Order::Unsorted}>'
impl <T> VSet<T, {Order::Unsorted}> { impl <T> VSet<T, {Order::Unsorted}> {
pub fn new() -> Self { pub fn new() -> Self {
Self { inner: Vec::new() } Self { inner: Vec::new() }
@ -31,7 +31,7 @@ impl <T> VSet<T, {Order::Unsorted}> {
pub struct Escape<const S: &'static str>; pub struct Escape<const S: &'static str>;
// @has foo/struct.Escape.html '//h3[@id="impl"]/code' 'impl Escape<{ r#"<script>alert("Escape");</script>"# }>' // @has foo/struct.Escape.html '//div[@id="impl"]/code' 'impl Escape<{ r#"<script>alert("Escape");</script>"# }>'
impl Escape<{ r#"<script>alert("Escape");</script>"# }> { impl Escape<{ r#"<script>alert("Escape");</script>"# }> {
pub fn f() {} pub fn f() {}
} }

View file

@ -1,19 +1,19 @@
#![crate_name = "foo"] #![crate_name = "foo"]
// @has foo/struct.Foo.html // @has foo/struct.Foo.html
// @has - '//div[@id="synthetic-implementations-list"]/h3[@id="impl-Send"]' 'impl Send for Foo' // @has - '//div[@id="synthetic-implementations-list"]/div[@id="impl-Send"]' 'impl Send for Foo'
pub struct Foo; pub struct Foo;
pub trait EmptyTrait {} pub trait EmptyTrait {}
// @has - '//div[@id="trait-implementations-list"]/h3[@id="impl-EmptyTrait"]' 'impl EmptyTrait for Foo' // @has - '//div[@id="trait-implementations-list"]/div[@id="impl-EmptyTrait"]' 'impl EmptyTrait for Foo'
impl EmptyTrait for Foo {} impl EmptyTrait for Foo {}
pub trait NotEmpty { pub trait NotEmpty {
fn foo(&self); fn foo(&self);
} }
// @has - '//div[@id="trait-implementations-list"]/details/summary/h3[@id="impl-NotEmpty"]' 'impl NotEmpty for Foo' // @has - '//div[@id="trait-implementations-list"]/details/summary/div[@id="impl-NotEmpty"]' 'impl NotEmpty for Foo'
impl NotEmpty for Foo { impl NotEmpty for Foo {
fn foo(&self) {} fn foo(&self) {}
} }

View file

@ -2,5 +2,5 @@
// This test ensures that the [src] link is present on traits items. // This test ensures that the [src] link is present on traits items.
// @has foo/trait.Iterator.html '//h3[@id="method.zip"]/a[@class="srclink"]' "[src]" // @has foo/trait.Iterator.html '//div[@id="method.zip"]/a[@class="srclink"]' "[src]"
pub use std::iter::Iterator; pub use std::iter::Iterator;

View file

@ -2,10 +2,10 @@
use std::fmt; use std::fmt;
// @!has foo/struct.Bar.html '//h3[@id="impl-ToString"]//code' 'impl<T> ToString for T' // @!has foo/struct.Bar.html '//div[@id="impl-ToString"]//code' 'impl<T> ToString for T'
pub struct Bar; pub struct Bar;
// @has foo/struct.Foo.html '//h3[@id="impl-ToString"]//code' 'impl<T> ToString for T' // @has foo/struct.Foo.html '//div[@id="impl-ToString"]//code' 'impl<T> ToString for T'
pub struct Foo; pub struct Foo;
// @has foo/struct.Foo.html '//div[@class="sidebar-links"]/a[@href="#impl-ToString"]' 'ToString' // @has foo/struct.Foo.html '//div[@class="sidebar-links"]/a[@href="#impl-ToString"]' 'ToString'

View file

@ -5,7 +5,7 @@ pub trait MyTrait {
fn my_string(&self) -> String; fn my_string(&self) -> String;
} }
// @has - "//div[@id='implementors-list']//h3[@id='impl-MyTrait']//code" "impl<T> MyTrait for T where T: Debug" // @has - "//div[@id='implementors-list']//div[@id='impl-MyTrait']//code" "impl<T> MyTrait for T where T: Debug"
impl<T> MyTrait for T where T: fmt::Debug { impl<T> MyTrait for T where T: fmt::Debug {
fn my_string(&self) -> String { fn my_string(&self) -> String {
format!("{:?}", self) format!("{:?}", self)

View file

@ -23,7 +23,7 @@ macro_rules! make {
} }
// @has issue_33302/struct.S.html \ // @has issue_33302/struct.S.html \
// '//h3[@class="impl"]' 'impl T<[i32; 16]> for S' // '//div[@class="impl"]' 'impl T<[i32; 16]> for S'
// @has - '//*[@id="associatedconstant.C"]' 'const C: [i32; 16]' // @has - '//*[@id="associatedconstant.C"]' 'const C: [i32; 16]'
// @has - '//*[@id="associatedconstant.D"]' 'const D: i32' // @has - '//*[@id="associatedconstant.D"]' 'const D: i32'
impl T<[i32; ($n * $n)]> for S { impl T<[i32; ($n * $n)]> for S {
@ -31,7 +31,7 @@ macro_rules! make {
} }
// @has issue_33302/struct.S.html \ // @has issue_33302/struct.S.html \
// '//h3[@class="impl"]' 'impl T<[i32; 16]> for S' // '//div[@class="impl"]' 'impl T<[i32; 16]> for S'
// @has - '//*[@id="associatedconstant.C-1"]' 'const C: (i32,)' // @has - '//*[@id="associatedconstant.C-1"]' 'const C: (i32,)'
// @has - '//*[@id="associatedconstant.D-1"]' 'const D: i32' // @has - '//*[@id="associatedconstant.D-1"]' 'const D: i32'
impl T<(i32,)> for S { impl T<(i32,)> for S {
@ -39,7 +39,7 @@ macro_rules! make {
} }
// @has issue_33302/struct.S.html \ // @has issue_33302/struct.S.html \
// '//h3[@class="impl"]' 'impl T<(i32, i32)> for S' // '//div[@class="impl"]' 'impl T<(i32, i32)> for S'
// @has - '//*[@id="associatedconstant.C-2"]' 'const C: (i32, i32)' // @has - '//*[@id="associatedconstant.C-2"]' 'const C: (i32, i32)'
// @has - '//*[@id="associatedconstant.D-2"]' 'const D: i32' // @has - '//*[@id="associatedconstant.D-2"]' 'const D: i32'
impl T<(i32, i32)> for S { impl T<(i32, i32)> for S {

View file

@ -12,9 +12,10 @@ macro_rules! array_impls {
} }
} }
// @has issue_53812/trait.MyIterator.html '//*[@id="implementors-list"]/h3[1]' 'MyStruct<[T; 0]>' // @has issue_53812/trait.MyIterator.html
// @has - '//*[@id="implementors-list"]/h3[2]' 'MyStruct<[T; 1]>' // @has - '//*[@id="implementors-list"]/div[@class="impl"][1]' 'MyStruct<[T; 0]>'
// @has - '//*[@id="implementors-list"]/h3[3]' 'MyStruct<[T; 2]>' // @has - '//*[@id="implementors-list"]/div[@class="impl"][2]' 'MyStruct<[T; 1]>'
// @has - '//*[@id="implementors-list"]/h3[4]' 'MyStruct<[T; 3]>' // @has - '//*[@id="implementors-list"]/div[@class="impl"][3]' 'MyStruct<[T; 2]>'
// @has - '//*[@id="implementors-list"]/h3[5]' 'MyStruct<[T; 10]>' // @has - '//*[@id="implementors-list"]/div[@class="impl"][4]' 'MyStruct<[T; 3]>'
// @has - '//*[@id="implementors-list"]/div[@class="impl"][5]' 'MyStruct<[T; 10]>'
array_impls! { 10 3 2 1 0 } array_impls! { 10 3 2 1 0 }

View file

@ -2,4 +2,4 @@
include!("primitive/primitive-generic-impl.rs"); include!("primitive/primitive-generic-impl.rs");
// @has foo/primitive.i32.html '//h3[@id="impl-ToString"]//code' 'impl<T> ToString for T' // @has foo/primitive.i32.html '//div[@id="impl-ToString"]//code' 'impl<T> ToString for T'

View file

@ -6,9 +6,9 @@
// @has - '//*[@class="sidebar-title"][@href="#foreign-impls"]' 'Implementations on Foreign Types' // @has - '//*[@class="sidebar-title"][@href="#foreign-impls"]' 'Implementations on Foreign Types'
// @has - '//h2[@id="foreign-impls"]' 'Implementations on Foreign Types' // @has - '//h2[@id="foreign-impls"]' 'Implementations on Foreign Types'
// @has - '//*[@class="sidebar-links"]/a[@href="#impl-Foo-for-u32"]' 'u32' // @has - '//*[@class="sidebar-links"]/a[@href="#impl-Foo-for-u32"]' 'u32'
// @has - '//h3[@id="impl-Foo-for-u32"]//code' 'impl Foo for u32' // @has - '//div[@id="impl-Foo-for-u32"]//code' 'impl Foo for u32'
// @has - '//*[@class="sidebar-links"]/a[@href="#impl-Foo-for-%26%27a%20str"]' "&'a str" // @has - '//*[@class="sidebar-links"]/a[@href="#impl-Foo-for-%26%27a%20str"]' "&'a str"
// @has - '//h3[@id="impl-Foo-for-%26%27a%20str"]//code' "impl<'a> Foo for &'a str" // @has - '//div[@id="impl-Foo-for-%26%27a%20str"]//code' "impl<'a> Foo for &'a str"
pub trait Foo {} pub trait Foo {}
impl Foo for u32 {} impl Foo for u32 {}

View file

@ -1,17 +1,17 @@
#![crate_name = "foo"] #![crate_name = "foo"]
// @has foo/struct.Bar.html // @has foo/struct.Bar.html
// @!has - '//h3[@id="impl-Sized"]' // @!has - '//div[@id="impl-Sized"]'
pub struct Bar { pub struct Bar {
a: u16, a: u16,
} }
// @has foo/struct.Foo.html // @has foo/struct.Foo.html
// @!has - '//h3[@id="impl-Sized"]' // @!has - '//div[@id="impl-Sized"]'
pub struct Foo<T: ?Sized>(T); pub struct Foo<T: ?Sized>(T);
// @has foo/struct.Unsized.html // @has foo/struct.Unsized.html
// @has - '//h3[@id="impl-Sized"]/code' 'impl !Sized for Unsized' // @has - '//div[@id="impl-Sized"]/code' 'impl !Sized for Unsized'
pub struct Unsized { pub struct Unsized {
data: [u8], data: [u8],
} }

View file

@ -3,7 +3,7 @@
use std::iter::Iterator; use std::iter::Iterator;
// @has foo/struct.Odd.html // @has foo/struct.Odd.html
// @has - '//h4[@id="method.new"]//span[@class="notable-traits"]//code/span' 'impl Iterator for Odd' // @has - '//div[@id="method.new"]//span[@class="notable-traits"]//code/span' 'impl Iterator for Odd'
pub struct Odd { pub struct Odd {
current: usize, current: usize,
} }

View file

@ -1,12 +1,12 @@
#![crate_name = "foo"] #![crate_name = "foo"]
// @has foo/struct.Unsized.html // @has foo/struct.Unsized.html
// @has - '//h3[@id="impl-Sized"]/code' 'impl !Sized for Unsized' // @has - '//div[@id="impl-Sized"]/code' 'impl !Sized for Unsized'
// @!has - '//h3[@id="impl-Sized"]/a[@class="srclink"]' '[src]' // @!has - '//div[@id="impl-Sized"]/a[@class="srclink"]' '[src]'
// @has - '//h3[@id="impl-Sync"]/code' 'impl Sync for Unsized' // @has - '//div[@id="impl-Sync"]/code' 'impl Sync for Unsized'
// @!has - '//h3[@id="impl-Sync"]/a[@class="srclink"]' '[src]' // @!has - '//div[@id="impl-Sync"]/a[@class="srclink"]' '[src]'
// @has - '//h3[@id="impl-Any"]/code' 'impl<T> Any for T' // @has - '//div[@id="impl-Any"]/code' 'impl<T> Any for T'
// @has - '//h3[@id="impl-Any"]/a[@class="srclink"]' '[src]' // @has - '//div[@id="impl-Any"]/a[@class="srclink"]' '[src]'
pub struct Unsized { pub struct Unsized {
data: [u8], data: [u8],
} }

View file

@ -2,7 +2,7 @@
pub trait Foo { pub trait Foo {
// @has foo/trait.Foo.html '//h3[@id="tymethod.foo"]//div[@class="code-attribute"]' '#[must_use]' // @has foo/trait.Foo.html '//div[@id="tymethod.foo"]//div[@class="code-attribute"]' '#[must_use]'
#[must_use] #[must_use]
fn foo(); fn foo();
} }
@ -11,11 +11,11 @@ pub trait Foo {
pub struct Bar; pub struct Bar;
impl Bar { impl Bar {
// @has foo/struct.Bar.html '//h4[@id="method.bar"]//div[@class="code-attribute"]' '#[must_use]' // @has foo/struct.Bar.html '//div[@id="method.bar"]//div[@class="code-attribute"]' '#[must_use]'
#[must_use] #[must_use]
pub fn bar() {} pub fn bar() {}
// @has foo/struct.Bar.html '//h4[@id="method.bar2"]//div[@class="code-attribute"]' '#[must_use]' // @has foo/struct.Bar.html '//div[@id="method.bar2"]//div[@class="code-attribute"]' '#[must_use]'
#[must_use] #[must_use]
pub fn bar2() {} pub fn bar2() {}
} }

View file

@ -8,58 +8,58 @@ pub trait MyTrait {
impl MyTrait for String { impl MyTrait for String {
// @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//h4[@id="associatedtype.Assoc-1"]//a[@class="type"]/@href' #associatedtype.Assoc // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//div[@id="associatedtype.Assoc-1"]//a[@class="type"]/@href' #associatedtype.Assoc
// @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//h4[@id="associatedtype.Assoc-1"]//a[@class="anchor"]/@href' #associatedtype.Assoc-1 // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//div[@id="associatedtype.Assoc-1"]//a[@class="anchor"]/@href' #associatedtype.Assoc-1
type Assoc = (); type Assoc = ();
// @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//h4[@id="associatedconstant.VALUE-1"]//a[@class="constant"]/@href' #associatedconstant.VALUE // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//div[@id="associatedconstant.VALUE-1"]//a[@class="constant"]/@href' #associatedconstant.VALUE
// @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//h4[@id="associatedconstant.VALUE-1"]//a[@class="anchor"]/@href' #associatedconstant.VALUE-1 // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//div[@id="associatedconstant.VALUE-1"]//a[@class="anchor"]/@href' #associatedconstant.VALUE-1
const VALUE: u32 = 5; const VALUE: u32 = 5;
// @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//h4[@id="method.trait_function"]//a[@class="fnname"]/@href' #tymethod.trait_function // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//div[@id="method.trait_function"]//a[@class="fnname"]/@href' #tymethod.trait_function
// @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//h4[@id="method.trait_function"]//a[@class="anchor"]/@href' #method.trait_function // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//div[@id="method.trait_function"]//a[@class="anchor"]/@href' #method.trait_function
fn trait_function(&self) {} fn trait_function(&self) {}
// @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//h4[@id="method.defaulted_override-1"]//a[@class="fnname"]/@href' #method.defaulted_override // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//div[@id="method.defaulted_override-1"]//a[@class="fnname"]/@href' #method.defaulted_override
// @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//h4[@id="method.defaulted_override-1"]//a[@class="anchor"]/@href' #method.defaulted_override-1 // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//div[@id="method.defaulted_override-1"]//a[@class="anchor"]/@href' #method.defaulted_override-1
fn defaulted_override(&self) {} fn defaulted_override(&self) {}
} }
impl MyTrait for Vec<u8> { impl MyTrait for Vec<u8> {
// @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//h4[@id="associatedtype.Assoc-2"]//a[@class="type"]/@href' #associatedtype.Assoc // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//div[@id="associatedtype.Assoc-2"]//a[@class="type"]/@href' #associatedtype.Assoc
// @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//h4[@id="associatedtype.Assoc-2"]//a[@class="anchor"]/@href' #associatedtype.Assoc-2 // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//div[@id="associatedtype.Assoc-2"]//a[@class="anchor"]/@href' #associatedtype.Assoc-2
type Assoc = (); type Assoc = ();
// @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//h4[@id="associatedconstant.VALUE-2"]//a[@class="constant"]/@href' #associatedconstant.VALUE // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//div[@id="associatedconstant.VALUE-2"]//a[@class="constant"]/@href' #associatedconstant.VALUE
// @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//h4[@id="associatedconstant.VALUE-2"]//a[@class="anchor"]/@href' #associatedconstant.VALUE-2 // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//div[@id="associatedconstant.VALUE-2"]//a[@class="anchor"]/@href' #associatedconstant.VALUE-2
const VALUE: u32 = 5; const VALUE: u32 = 5;
// @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//h4[@id="method.trait_function"]//a[@class="fnname"]/@href' #tymethod.trait_function // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//div[@id="method.trait_function"]//a[@class="fnname"]/@href' #tymethod.trait_function
// @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//h4[@id="method.trait_function-1"]//a[@class="anchor"]/@href' #method.trait_function-1 // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//div[@id="method.trait_function-1"]//a[@class="anchor"]/@href' #method.trait_function-1
fn trait_function(&self) {} fn trait_function(&self) {}
// @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//h4[@id="method.defaulted_override-2"]//a[@class="fnname"]/@href' #method.defaulted_override // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//div[@id="method.defaulted_override-2"]//a[@class="fnname"]/@href' #method.defaulted_override
// @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//h4[@id="method.defaulted_override-2"]//a[@class="anchor"]/@href' #method.defaulted_override-2 // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//div[@id="method.defaulted_override-2"]//a[@class="anchor"]/@href' #method.defaulted_override-2
fn defaulted_override(&self) {} fn defaulted_override(&self) {}
} }
impl MyTrait for MyStruct { impl MyTrait for MyStruct {
// @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//h4[@id="associatedtype.Assoc-3"]//a[@class="type"]/@href' #associatedtype.Assoc // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//div[@id="associatedtype.Assoc-3"]//a[@class="type"]/@href' #associatedtype.Assoc
// @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//h4[@id="associatedtype.Assoc-3"]//a[@class="anchor"]/@href' #associatedtype.Assoc-3 // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//div[@id="associatedtype.Assoc-3"]//a[@class="anchor"]/@href' #associatedtype.Assoc-3
// @has trait_impl_items_links_and_anchors/struct.MyStruct.html '//h4[@id="associatedtype.Assoc"]//a[@class="type"]/@href' trait.MyTrait.html#associatedtype.Assoc // @has trait_impl_items_links_and_anchors/struct.MyStruct.html '//div[@id="associatedtype.Assoc"]//a[@class="type"]/@href' trait.MyTrait.html#associatedtype.Assoc
// @has trait_impl_items_links_and_anchors/struct.MyStruct.html '//h4[@id="associatedtype.Assoc"]//a[@class="anchor"]/@href' #associatedtype.Assoc // @has trait_impl_items_links_and_anchors/struct.MyStruct.html '//div[@id="associatedtype.Assoc"]//a[@class="anchor"]/@href' #associatedtype.Assoc
type Assoc = bool; type Assoc = bool;
// @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//h4[@id="associatedconstant.VALUE-3"]//a[@class="constant"]/@href' #associatedconstant.VALUE // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//div[@id="associatedconstant.VALUE-3"]//a[@class="constant"]/@href' #associatedconstant.VALUE
// @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//h4[@id="associatedconstant.VALUE-3"]//a[@class="anchor"]/@href' #associatedconstant.VALUE-3 // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//div[@id="associatedconstant.VALUE-3"]//a[@class="anchor"]/@href' #associatedconstant.VALUE-3
// @has trait_impl_items_links_and_anchors/struct.MyStruct.html '//h4[@id="associatedconstant.VALUE"]//a[@class="constant"]/@href' trait.MyTrait.html#associatedconstant.VALUE // @has trait_impl_items_links_and_anchors/struct.MyStruct.html '//div[@id="associatedconstant.VALUE"]//a[@class="constant"]/@href' trait.MyTrait.html#associatedconstant.VALUE
// @has trait_impl_items_links_and_anchors/struct.MyStruct.html '//h4[@id="associatedconstant.VALUE"]//a[@class="anchor"]/@href' #associatedconstant.VALUE // @has trait_impl_items_links_and_anchors/struct.MyStruct.html '//div[@id="associatedconstant.VALUE"]//a[@class="anchor"]/@href' #associatedconstant.VALUE
const VALUE: u32 = 20; const VALUE: u32 = 20;
// @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//h4[@id="method.trait_function-2"]//a[@class="fnname"]/@href' #tymethod.trait_function // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//div[@id="method.trait_function-2"]//a[@class="fnname"]/@href' #tymethod.trait_function
// @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//h4[@id="method.trait_function-2"]//a[@class="anchor"]/@href' #method.trait_function-2 // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//div[@id="method.trait_function-2"]//a[@class="anchor"]/@href' #method.trait_function-2
// @has trait_impl_items_links_and_anchors/struct.MyStruct.html '//h4[@id="method.trait_function"]//a[@class="fnname"]/@href' trait.MyTrait.html#tymethod.trait_function // @has trait_impl_items_links_and_anchors/struct.MyStruct.html '//div[@id="method.trait_function"]//a[@class="fnname"]/@href' trait.MyTrait.html#tymethod.trait_function
// @has trait_impl_items_links_and_anchors/struct.MyStruct.html '//h4[@id="method.trait_function"]//a[@class="anchor"]/@href' #method.trait_function // @has trait_impl_items_links_and_anchors/struct.MyStruct.html '//div[@id="method.trait_function"]//a[@class="anchor"]/@href' #method.trait_function
fn trait_function(&self) {} fn trait_function(&self) {}
// @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//h4[@id="method.defaulted_override-3"]//a[@class="fnname"]/@href' #method.defaulted_override // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//div[@id="method.defaulted_override-3"]//a[@class="fnname"]/@href' #method.defaulted_override
// @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//h4[@id="method.defaulted_override-3"]//a[@class="anchor"]/@href' #method.defaulted_override-3 // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//div[@id="method.defaulted_override-3"]//a[@class="anchor"]/@href' #method.defaulted_override-3
// @has trait_impl_items_links_and_anchors/struct.MyStruct.html '//h4[@id="method.defaulted_override"]//a[@class="fnname"]/@href' trait.MyTrait.html#method.defaulted_override // @has trait_impl_items_links_and_anchors/struct.MyStruct.html '//div[@id="method.defaulted_override"]//a[@class="fnname"]/@href' trait.MyTrait.html#method.defaulted_override
// @has trait_impl_items_links_and_anchors/struct.MyStruct.html '//h4[@id="method.defaulted_override"]//a[@class="anchor"]/@href' #method.defaulted_override // @has trait_impl_items_links_and_anchors/struct.MyStruct.html '//div[@id="method.defaulted_override"]//a[@class="anchor"]/@href' #method.defaulted_override
fn defaulted_override(&self) {} fn defaulted_override(&self) {}
// @has trait_impl_items_links_and_anchors/struct.MyStruct.html '//h4[@id="method.defaulted"]//a[@class="fnname"]/@href' trait.MyTrait.html#method.defaulted // @has trait_impl_items_links_and_anchors/struct.MyStruct.html '//div[@id="method.defaulted"]//a[@class="fnname"]/@href' trait.MyTrait.html#method.defaulted
// @has trait_impl_items_links_and_anchors/struct.MyStruct.html '//h4[@id="method.defaulted"]//a[@class="anchor"]/@href' #method.defaulted // @has trait_impl_items_links_and_anchors/struct.MyStruct.html '//div[@id="method.defaulted"]//a[@class="anchor"]/@href' #method.defaulted
} }
pub struct MyStruct; pub struct MyStruct;

View file

@ -463,7 +463,7 @@ fn maybe_redirect(source: &str) -> Option<String> {
const REDIRECT: &str = "<p>Redirecting to <a href="; const REDIRECT: &str = "<p>Redirecting to <a href=";
let mut lines = source.lines(); let mut lines = source.lines();
let redirect_line = lines.nth(6)?; let redirect_line = lines.nth(7)?;
redirect_line.find(REDIRECT).map(|i| { redirect_line.find(REDIRECT).map(|i| {
let rest = &redirect_line[(i + REDIRECT.len() + 1)..]; let rest = &redirect_line[(i + REDIRECT.len() + 1)..];