1
Fork 0

Rollup merge of #102280 - notriddle:notriddle/band, r=GuillaumeGomez

rustdoc: clean up `.out-of-band`/`.in-band` CSS

|        | method | impl
|--------|--------|------
| before | ![image](https://user-images.githubusercontent.com/1593513/192164603-dea9befb-0f5f-4bd5-a44d-1f8328e27955.png) | ![image](https://user-images.githubusercontent.com/1593513/192164642-06f958cb-8fd5-4b73-bdb7-d2778f358f80.png)
| after  | ![image](https://user-images.githubusercontent.com/1593513/192164612-f72ee8db-c87c-477c-99e8-283b1cf0c14b.png) | ![image](https://user-images.githubusercontent.com/1593513/192164653-8e628dc3-5bf3-4ce8-829b-06e27a90fe06.png)

* Remove the `float: right` fallback from the main header, which hasn't been needed since IE11 support was dropped.

* Remove `in-band` from low-level headers, which hasn't been needed since `.rightside` switched to `float: right` in 593d6d1cb1

* Remove unreachable `.in-band > code, .in-band > .code-header` CSS, since the `in-band` class was attached to the `code-header` itself, not nested directly below it.

* Use `rem` instead of `em` for code header margins.

* This results in a slight change in spacing around impls and item-info, but since it makes it more consistent with the way methods are presented, it's probably fine.

Preview: http://notriddle.com/notriddle-rustdoc-demos/band/std/fs/struct.File.html
This commit is contained in:
fee1-dead 2022-09-26 09:27:38 +08:00 committed by GitHub
commit a7d45de322
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
64 changed files with 159 additions and 165 deletions

View file

@ -1790,7 +1790,7 @@ pub(crate) fn render_impl_summary(
write!(w, "<section id=\"{}\" class=\"impl has-srclink\"{}>", id, aliases);
render_rightside(w, cx, &i.impl_item, containing_item, RenderMode::Normal);
write!(w, "<a href=\"#{}\" class=\"anchor\"></a>", id);
write!(w, "<h3 class=\"code-header in-band\">");
write!(w, "<h3 class=\"code-header\">");
if let Some(use_absolute) = use_absolute {
write!(w, "{}", inner_impl.print(use_absolute, cx));

View file

@ -176,8 +176,8 @@ h4.code-header {
border-bottom-style: none;
margin: 0;
padding: 0;
margin-top: 0.6em;
margin-bottom: 0.4em;
margin-top: 0.6rem;
margin-bottom: 0.4rem;
}
.impl,
.impl-items .method,
@ -658,18 +658,17 @@ h2.location a {
overflow-x: auto;
}
.content .out-of-band {
.out-of-band {
flex-grow: 0;
font-size: 1.125rem;
font-weight: normal;
float: right;
}
.method > .code-header, .trait-impl > .code-header {
display: block;
}
.content .in-band {
.in-band {
flex-grow: 1;
margin: 0px;
padding: 0px;
@ -682,10 +681,6 @@ h2.location a {
background-color: var(--main-background-color);
}
.in-band > code, .in-band > .code-header {
display: inline-block;
}
.docblock code, .docblock-short code,
pre, .rustdoc.source .example-wrap {
background-color: var(--code-block-background-color);
@ -1731,13 +1726,13 @@ in storage.js plus the media query with (min-width: 701px)
flex-direction: column;
}
.content .out-of-band {
.out-of-band {
text-align: left;
margin-left: initial;
padding: initial;
}
.content .out-of-band .since::before {
.out-of-band .since::before {
content: "Since ";
}
@ -1969,7 +1964,7 @@ in storage.js plus the media query with (min-width: 701px)
}
@media print {
nav.sidebar, nav.sub, .content .out-of-band, a.srclink, #copy-path,
nav.sidebar, nav.sub, .out-of-band, a.srclink, #copy-path,
details.rustdoc-toggle[open] > summary::before, details.rustdoc-toggle > summary::before,
details.rustdoc-toggle.top-doc > summary {
display: none;

View file

@ -555,7 +555,6 @@ function loadCss(cssFileName) {
const code = document.createElement("h3");
code.innerHTML = struct[TEXT_IDX];
addClass(code, "code-header");
addClass(code, "in-band");
onEachLazy(code.getElementsByTagName("a"), elem => {
const href = elem.getAttribute("href");

View file

@ -19,7 +19,7 @@ assert-css: (
)
assert-css: (
".impl .code-header",
{"color": "rgb(230, 225, 207)", "background-color": "rgb(15, 20, 25)"},
{"color": "rgb(230, 225, 207)", "background-color": "rgba(0, 0, 0, 0)"},
ALL,
)
@ -58,7 +58,7 @@ assert-css: (
)
assert-css: (
".impl .code-header",
{"color": "rgb(221, 221, 221)", "background-color": "rgb(53, 53, 53)"},
{"color": "rgb(221, 221, 221)", "background-color": "rgba(0, 0, 0, 0)"},
ALL,
)
@ -95,7 +95,7 @@ assert-css: (
)
assert-css: (
".impl .code-header",
{"color": "rgb(0, 0, 0)", "background-color": "rgb(255, 255, 255)"},
{"color": "rgb(0, 0, 0)", "background-color": "rgba(0, 0, 0, 0)"},
ALL,
)

View file

@ -8,23 +8,23 @@ assert-count: ("#implementors-list .impl", 2)
assert: ("#implementors-list .impl:nth-child(1) > a.anchor")
assert-attribute: ("#implementors-list .impl:nth-child(1)", {"id": "impl-Whatever-for-Struct"})
assert-attribute: ("#implementors-list .impl:nth-child(1) > a.anchor", {"href": "#impl-Whatever-for-Struct"})
assert: "#implementors-list .impl:nth-child(1) > .code-header.in-band"
assert: "#implementors-list .impl:nth-child(1) > .code-header"
assert: ("#implementors-list .impl:nth-child(2) > a.anchor")
assert-attribute: ("#implementors-list .impl:nth-child(2)", {"id": "impl-Whatever-1"})
assert-attribute: ("#implementors-list .impl:nth-child(2) > a.anchor", {"href": "#impl-Whatever-1"})
assert: "#implementors-list .impl:nth-child(2) > .code-header.in-band"
assert: "#implementors-list .impl:nth-child(2) > .code-header"
goto: file://|DOC_PATH|/test_docs/struct.HasEmptyTraits.html
compare-elements-position-near-false: (
"#impl-EmptyTrait1-for-HasEmptyTraits",
"#impl-EmptyTrait2-for-HasEmptyTraits",
{"y": 30},
{"y": 34},
)
compare-elements-position-near: (
"#impl-EmptyTrait3-for-HasEmptyTraits h3",
"#impl-EmptyTrait3-for-HasEmptyTraits .item-info",
{"y": 30},
{"y": 34},
)
// Now check that re-exports work correctly.

View file

@ -5,7 +5,7 @@ goto: file://|DOC_PATH|/test_docs/struct.Foo.html
show-text: true
// Check the impl headers.
assert-css: (".impl.has-srclink .srclink", {"font-size": "16px"}, ALL)
assert-css: (".impl.has-srclink .code-header.in-band", {"font-size": "18px"}, ALL)
assert-css: (".impl.has-srclink .code-header", {"font-size": "18px"}, ALL)
// Check the impl items.
assert-css: (".impl-items .has-srclink .srclink", {"font-size": "16px"}, ALL)
assert-css: (".impl-items .has-srclink .code-header", {"font-size": "16px"}, ALL)

View file

@ -12,7 +12,7 @@ pub trait Stream {
}
// @has 'foo/trait.Stream.html'
// @has - '//*[@class="code-header in-band"]' 'impl<S: ?Sized + Stream + Unpin> Stream for &mut S'
// @has - '//*[@class="code-header"]' 'impl<S: ?Sized + Stream + Unpin> Stream for &mut S'
impl<S: ?Sized + Stream + Unpin> Stream for &mut S {
type Item = S::Item;

View file

@ -13,7 +13,7 @@ pub trait Foo {
pub struct Bar;
impl Foo for Bar {
// @has assoc_consts/struct.Bar.html '//h3[@class="code-header in-band"]' 'impl Foo for Bar'
// @has assoc_consts/struct.Bar.html '//h3[@class="code-header"]' 'impl Foo for Bar'
// @has - '//*[@id="associatedconstant.FOO"]' 'const FOO: usize'
const FOO: usize = 12;
// @has - '//*[@id="associatedconstant.FOO_NO_DEFAULT"]' 'const FOO_NO_DEFAULT: bool'
@ -81,7 +81,7 @@ pub trait Qux {
const QUX_DEFAULT2: u32 = 3;
}
// @has assoc_consts/struct.Bar.html '//h3[@class="code-header in-band"]' 'impl Qux for Bar'
// @has assoc_consts/struct.Bar.html '//h3[@class="code-header"]' 'impl Qux for Bar'
impl Qux for Bar {
// @has - '//*[@id="associatedconstant.QUX0"]' 'const QUX0: u8'
// @has - '//*[@class="docblock"]' "Docs for QUX0 in trait."

View file

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

View file

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

View file

@ -19,10 +19,10 @@ pub use extern_crate::WTrait;
// @has foo/trait.Trait.html '//pre[@class="rust trait"]' \
// 'pub trait Trait<const N: usize>'
// @has - '//*[@id="impl-Trait%3C1%3E-for-u8"]//h3[@class="code-header in-band"]' 'impl Trait<1> for u8'
// @has - '//*[@id="impl-Trait%3C2%3E-for-u8"]//h3[@class="code-header in-band"]' 'impl Trait<2> for u8'
// @has - '//*[@id="impl-Trait%3C{1%20+%202}%3E-for-u8"]//h3[@class="code-header in-band"]' 'impl Trait<{1 + 2}> for u8'
// @has - '//*[@id="impl-Trait%3CN%3E-for-%5Bu8%3B%20N%5D"]//h3[@class="code-header in-band"]' \
// @has - '//*[@id="impl-Trait%3C1%3E-for-u8"]//h3[@class="code-header"]' 'impl Trait<1> for u8'
// @has - '//*[@id="impl-Trait%3C2%3E-for-u8"]//h3[@class="code-header"]' 'impl Trait<2> for u8'
// @has - '//*[@id="impl-Trait%3C{1%20+%202}%3E-for-u8"]//h3[@class="code-header"]' 'impl Trait<{1 + 2}> for u8'
// @has - '//*[@id="impl-Trait%3CN%3E-for-%5Bu8%3B%20N%5D"]//h3[@class="code-header"]' \
// 'impl<const N: usize> Trait<N> for [u8; N]'
pub trait Trait<const N: usize> {}
impl Trait<1> for u8 {}
@ -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>(_)'
pub struct Bar<T, const N: usize>([T; N]);
// @has foo/struct.Foo.html '//*[@id="impl-Foo%3CM%3E"]/h3[@class="code-header in-band"]' 'impl<const M: usize> Foo<M>where u8: Trait<M>'
// @has foo/struct.Foo.html '//*[@id="impl-Foo%3CM%3E"]/h3[@class="code-header"]' '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'
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 '//*[@id="impl-Bar%3Cu8%2C%20M%3E"]/h3[@class="code-header in-band"]' 'impl<const M: usize> Bar<u8, M>'
// @has foo/struct.Bar.html '//*[@id="impl-Bar%3Cu8%2C%20M%3E"]/h3[@class="code-header"]' 'impl<const M: usize> Bar<u8, M>'
impl<const M: usize> Bar<u8, M> {
// @has - '//*[@id="method.hey"]' \
// '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 '//*[@id="impl-Send-for-VSet%3CT%2C%20ORDER%3E"]/h3[@class="code-header in-band"]' 'impl<T, const ORDER: Order> Send for VSet<T, ORDER>'
// @has foo/struct.VSet.html '//*[@id="impl-Sync-for-VSet%3CT%2C%20ORDER%3E"]/h3[@class="code-header in-band"]' 'impl<T, const ORDER: Order> Sync for VSet<T, ORDER>'
// @has foo/struct.VSet.html '//*[@id="impl-Send-for-VSet%3CT%2C%20ORDER%3E"]/h3[@class="code-header"]' 'impl<T, const ORDER: Order> Send for VSet<T, ORDER>'
// @has foo/struct.VSet.html '//*[@id="impl-Sync-for-VSet%3CT%2C%20ORDER%3E"]/h3[@class="code-header"]' 'impl<T, const ORDER: Order> Sync for VSet<T, ORDER>'
pub struct VSet<T, const ORDER: Order> {
inner: Vec<T>,
}
// @has foo/struct.VSet.html '//*[@id="impl-VSet%3CT%2C%20{%20Order%3A%3ASorted%20}%3E"]/h3[@class="code-header in-band"]' 'impl<T> VSet<T, { Order::Sorted }>'
// @has foo/struct.VSet.html '//*[@id="impl-VSet%3CT%2C%20{%20Order%3A%3ASorted%20}%3E"]/h3[@class="code-header"]' 'impl<T> VSet<T, { Order::Sorted }>'
impl<T> VSet<T, { Order::Sorted }> {
pub fn new() -> Self {
Self { inner: Vec::new() }
}
}
// @has foo/struct.VSet.html '//*[@id="impl-VSet%3CT%2C%20{%20Order%3A%3AUnsorted%20}%3E"]/h3[@class="code-header in-band"]' 'impl<T> VSet<T, { Order::Unsorted }>'
// @has foo/struct.VSet.html '//*[@id="impl-VSet%3CT%2C%20{%20Order%3A%3AUnsorted%20}%3E"]/h3[@class="code-header"]' 'impl<T> VSet<T, { Order::Unsorted }>'
impl<T> VSet<T, { Order::Unsorted }> {
pub fn new() -> Self {
Self { inner: Vec::new() }
@ -31,7 +31,7 @@ impl<T> VSet<T, { Order::Unsorted }> {
pub struct Escape<const S: &'static str>;
// @has foo/struct.Escape.html '//*[@id="impl-Escape%3Cr#%22%3Cscript%3Ealert(%22Escape%22)%3B%3C/script%3E%22#%3E"]/h3[@class="code-header in-band"]' 'impl Escape<r#"<script>alert("Escape");</script>"#>'
// @has foo/struct.Escape.html '//*[@id="impl-Escape%3Cr#%22%3Cscript%3Ealert(%22Escape%22)%3B%3C/script%3E%22#%3E"]/h3[@class="code-header"]' 'impl Escape<r#"<script>alert("Escape");</script>"#>'
impl Escape<r#"<script>alert("Escape");</script>"#> {
pub fn f() {}
}

View file

@ -12,7 +12,7 @@ pub struct Hasher<T> {
unsafe impl<T: Default> Send for Hasher<T> {}
// @has foo/struct.Foo.html
// @has - '//h3[@class="code-header in-band"]' 'impl Send for Foo'
// @has - '//h3[@class="code-header"]' 'impl Send for Foo'
pub struct Foo {
hasher: Hasher<[u8; 3]>,
}

View file

@ -1,12 +1,12 @@
// ignore-tidy-linelength
// @has issue_33054/impls/struct.Foo.html
// @has - '//h3[@class="code-header in-band"]' 'impl Foo'
// @has - '//h3[@class="code-header in-band"]' 'impl Bar for Foo'
// @has - '//h3[@class="code-header"]' 'impl Foo'
// @has - '//h3[@class="code-header"]' 'impl Bar for Foo'
// @count - '//*[@id="trait-implementations-list"]//*[@class="impl has-srclink"]' 1
// @count - '//*[@id="main-content"]/div[@id="implementations-list"]/details/summary/*[@class="impl has-srclink"]' 1
// @has issue_33054/impls/bar/trait.Bar.html
// @has - '//h3[@class="code-header in-band"]' 'impl Bar for Foo'
// @has - '//h3[@class="code-header"]' 'impl Bar for Foo'
// @count - '//*[@class="struct"]' 1
pub mod impls;

View file

@ -16,5 +16,5 @@ pub struct Another;
pub trait Bar {}
// @has 'foo/struct.Another.html'
// @has - '//h3[@class="code-header in-band"]' 'impl Bar for Another'
// @has - '//h3[@class="code-header"]' 'impl Bar for Another'
impl Bar for Another {}

View file

@ -19,9 +19,9 @@ impl Foo {
// @has foo/trait.Bar.html
pub trait Bar {}
// @has - '//h3[@class="code-header in-band"]' 'impl Bar for fn()'
// @has - '//h3[@class="code-header"]' 'impl Bar for fn()'
impl Bar for fn() {}
// @has - '//h3[@class="code-header in-band"]' 'impl Bar for extern "C" fn()'
// @has - '//h3[@class="code-header"]' 'impl Bar for extern "C" fn()'
impl Bar for extern fn() {}
// @has - '//h3[@class="code-header in-band"]' 'impl Bar for extern "system" fn()'
// @has - '//h3[@class="code-header"]' 'impl Bar for extern "system" fn()'
impl Bar for extern "system" fn() {}

View file

@ -11,7 +11,7 @@ pub struct ConditionalIterator<F> {
}
// @has 'fn_bound/struct.ConditionalIterator.html' '//h3[@class="code-header in-band"]' 'impl<F: Fn(&i32)> Iterator for ConditionalIterator<F>'
// @has 'fn_bound/struct.ConditionalIterator.html' '//h3[@class="code-header"]' 'impl<F: Fn(&i32)> Iterator for ConditionalIterator<F>'
impl<F: Fn(&i32)> Iterator for ConditionalIterator<F> {
type Item = ();

View file

@ -5,7 +5,7 @@ use std::fmt;
// @!has foo/struct.Bar.html '//*[@id="impl-ToString-for-Bar"]' ''
pub struct Bar;
// @has foo/struct.Foo.html '//*[@id="impl-ToString-for-Foo"]//h3[@class="code-header in-band"]' 'impl<T> ToString for T'
// @has foo/struct.Foo.html '//*[@id="impl-ToString-for-Foo"]//h3[@class="code-header"]' 'impl<T> ToString for T'
pub struct Foo;
// @has foo/struct.Foo.html '//*[@class="sidebar-elems"]//section//a[@href="#impl-ToString-for-Foo"]' 'ToString'

View file

@ -49,7 +49,7 @@ impl<'a> Foo<'a> {
// @has foo/trait.B.html
pub trait B<'x> {}
// @has - '//h3[@class="code-header in-band"]' "impl<'a> B<'a> for dyn for<'b> Trait<'b>"
// @has - '//h3[@class="code-header"]' "impl<'a> B<'a> for dyn for<'b> Trait<'b>"
impl<'a> B<'a> for dyn for<'b> Trait<'b> {}
// @has foo/struct.Bar.html

View file

@ -4,13 +4,13 @@ pub trait Foo {}
pub struct Bar<T> { field: T }
// @has foo/trait.Foo.html '//*[@class="item-list"]//h3[@class="code-header in-band"]' \
// @has foo/trait.Foo.html '//*[@class="item-list"]//h3[@class="code-header"]' \
// "impl Foo for Bar<u8>"
impl Foo for Bar<u8> {}
// @has foo/trait.Foo.html '//*[@class="item-list"]//h3[@class="code-header in-band"]' \
// @has foo/trait.Foo.html '//*[@class="item-list"]//h3[@class="code-header"]' \
// "impl Foo for Bar<u16>"
impl Foo for Bar<u16> {}
// @has foo/trait.Foo.html '//*[@class="item-list"]//h3[@class="code-header in-band"]' \
// @has foo/trait.Foo.html '//*[@class="item-list"]//h3[@class="code-header"]' \
// "impl<'a> Foo for &'a Bar<u8>"
impl<'a> Foo for &'a Bar<u8> {}
@ -22,9 +22,9 @@ pub mod mod2 {
pub enum Baz {}
}
// @has foo/trait.Foo.html '//*[@class="item-list"]//h3[@class="code-header in-band"]' \
// @has foo/trait.Foo.html '//*[@class="item-list"]//h3[@class="code-header"]' \
// "impl Foo for foo::mod1::Baz"
impl Foo for mod1::Baz {}
// @has foo/trait.Foo.html '//*[@class="item-list"]//h3[@class="code-header in-band"]' \
// @has foo/trait.Foo.html '//*[@class="item-list"]//h3[@class="code-header"]' \
// "impl<'a> Foo for &'a foo::mod2::Baz"
impl<'a> Foo for &'a mod2::Baz {}

View file

@ -5,8 +5,8 @@ pub auto trait AnAutoTrait {}
pub struct Foo<T> { field: T }
// @has impl_parts/struct.Foo.html '//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' \
// @has impl_parts/struct.Foo.html '//*[@class="impl has-srclink"]//h3[@class="code-header"]' \
// "impl<T: Clone> !AnAutoTrait for Foo<T>where T: Sync,"
// @has impl_parts/trait.AnAutoTrait.html '//*[@class="item-list"]//h3[@class="code-header in-band"]' \
// @has impl_parts/trait.AnAutoTrait.html '//*[@class="item-list"]//h3[@class="code-header"]' \
// "impl<T: Clone> !AnAutoTrait for Foo<T>where T: Sync,"
impl<T: Clone> !AnAutoTrait for Foo<T> where T: Sync {}

View file

@ -5,22 +5,22 @@
extern crate rustdoc_nonreachable_impls;
// @has issue_31948_1/struct.Wobble.html
// @has - '//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' 'Bark for'
// @has - '//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' 'Woof for'
// @!has - '//*[@class="impl"]//h3[@class="code-header in-band"]' 'Bar for'
// @!has - '//*[@class="impl"]//h3[@class="code-header in-band"]' 'Qux for'
// @has - '//*[@class="impl has-srclink"]//h3[@class="code-header"]' 'Bark for'
// @has - '//*[@class="impl has-srclink"]//h3[@class="code-header"]' 'Woof for'
// @!has - '//*[@class="impl"]//h3[@class="code-header"]' 'Bar for'
// @!has - '//*[@class="impl"]//h3[@class="code-header"]' 'Qux for'
pub use rustdoc_nonreachable_impls::hidden::Wobble;
// @has issue_31948_1/trait.Bark.html
// @has - '//h3[@class="code-header in-band"]' 'for Foo'
// @has - '//h3[@class="code-header in-band"]' 'for Wobble'
// @!has - '//h3[@class="code-header in-band"]' 'for Wibble'
// @has - '//h3[@class="code-header"]' 'for Foo'
// @has - '//h3[@class="code-header"]' 'for Wobble'
// @!has - '//h3[@class="code-header"]' 'for Wibble'
pub use rustdoc_nonreachable_impls::Bark;
// @has issue_31948_1/trait.Woof.html
// @has - '//h3[@class="code-header in-band"]' 'for Foo'
// @has - '//h3[@class="code-header in-band"]' 'for Wobble'
// @!has - '//h3[@class="code-header in-band"]' 'for Wibble'
// @has - '//h3[@class="code-header"]' 'for Foo'
// @has - '//h3[@class="code-header"]' 'for Wobble'
// @!has - '//h3[@class="code-header"]' 'for Wibble'
pub use rustdoc_nonreachable_impls::Woof;
// @!has issue_31948_1/trait.Bar.html

View file

@ -5,15 +5,15 @@
extern crate rustdoc_nonreachable_impls;
// @has issue_31948_2/struct.Wobble.html
// @has - '//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' 'Qux for'
// @has - '//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' 'Bark for'
// @has - '//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' 'Woof for'
// @!has - '//*[@class="impl"]//h3[@class="code-header in-band"]' 'Bar for'
// @has - '//*[@class="impl has-srclink"]//h3[@class="code-header"]' 'Qux for'
// @has - '//*[@class="impl has-srclink"]//h3[@class="code-header"]' 'Bark for'
// @has - '//*[@class="impl has-srclink"]//h3[@class="code-header"]' 'Woof for'
// @!has - '//*[@class="impl"]//h3[@class="code-header"]' 'Bar for'
pub use rustdoc_nonreachable_impls::hidden::Wobble;
// @has issue_31948_2/trait.Qux.html
// @has - '//h3[@class="code-header in-band"]' 'for Foo'
// @has - '//h3[@class="code-header in-band"]' 'for Wobble'
// @has - '//h3[@class="code-header"]' 'for Foo'
// @has - '//h3[@class="code-header"]' 'for Wobble'
pub use rustdoc_nonreachable_impls::hidden::Qux;
// @!has issue_31948_2/trait.Bar.html

View file

@ -5,22 +5,22 @@
extern crate rustdoc_nonreachable_impls;
// @has issue_31948/struct.Foo.html
// @has - '//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' 'Bark for'
// @has - '//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' 'Woof for'
// @!has - '//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' 'Bar for'
// @!has - '//*[@class="impl"]//h3[@class="code-header in-band"]' 'Qux for'
// @has - '//*[@class="impl has-srclink"]//h3[@class="code-header"]' 'Bark for'
// @has - '//*[@class="impl has-srclink"]//h3[@class="code-header"]' 'Woof for'
// @!has - '//*[@class="impl has-srclink"]//h3[@class="code-header"]' 'Bar for'
// @!has - '//*[@class="impl"]//h3[@class="code-header"]' 'Qux for'
pub use rustdoc_nonreachable_impls::Foo;
// @has issue_31948/trait.Bark.html
// @has - '//h3[@class="code-header in-band"]' 'for Foo'
// @!has - '//h3[@class="code-header in-band"]' 'for Wibble'
// @!has - '//h3[@class="code-header in-band"]' 'for Wobble'
// @has - '//h3[@class="code-header"]' 'for Foo'
// @!has - '//h3[@class="code-header"]' 'for Wibble'
// @!has - '//h3[@class="code-header"]' 'for Wobble'
pub use rustdoc_nonreachable_impls::Bark;
// @has issue_31948/trait.Woof.html
// @has - '//h3[@class="code-header in-band"]' 'for Foo'
// @!has - '//h3[@class="code-header in-band"]' 'for Wibble'
// @!has - '//h3[@class="code-header in-band"]' 'for Wobble'
// @has - '//h3[@class="code-header"]' 'for Foo'
// @!has - '//h3[@class="code-header"]' 'for Wibble'
// @!has - '//h3[@class="code-header"]' 'for Wobble'
pub use rustdoc_nonreachable_impls::Woof;
// @!has issue_31948/trait.Bar.html

View file

@ -5,7 +5,7 @@
extern crate rustdoc_trait_object_impl;
// @has issue_32881/trait.Bar.html
// @has - '//h3[@class="code-header in-band"]' "impl<'a> dyn Bar"
// @has - '//h3[@class="code-header in-band"]' "impl<'a> Debug for dyn Bar"
// @has - '//h3[@class="code-header"]' "impl<'a> dyn Bar"
// @has - '//h3[@class="code-header"]' "impl<'a> Debug for dyn Bar"
pub use rustdoc_trait_object_impl::Bar;

View file

@ -5,6 +5,6 @@
extern crate bar;
// @has issue_33113/trait.Bar.html
// @has - '//h3[@class="code-header in-band"]' "for &'a char"
// @has - '//h3[@class="code-header in-band"]' "for Foo"
// @has - '//h3[@class="code-header"]' "for &'a char"
// @has - '//h3[@class="code-header"]' "for Foo"
pub use bar::Bar;

View file

@ -3,5 +3,5 @@
extern crate inner;
// @has trait_vis/struct.SomeStruct.html
// @has - '//h3[@class="code-header in-band"]' 'impl Clone for SomeStruct'
// @has - '//h3[@class="code-header"]' 'impl Clone for SomeStruct'
pub use inner::SomeStruct;

View file

@ -13,6 +13,6 @@ mod asdf {
}
// @has trait_vis/struct.SomeStruct.html
// @has - '//h3[@class="code-header in-band"]' 'impl ThisTrait for SomeStruct'
// @!has - '//h3[@class="code-header in-band"]' 'impl PrivateTrait for SomeStruct'
// @has - '//h3[@class="code-header"]' 'impl ThisTrait for SomeStruct'
// @!has - '//h3[@class="code-header"]' 'impl PrivateTrait for SomeStruct'
pub use asdf::SomeStruct;

View file

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

View file

@ -6,8 +6,8 @@ pub struct Bar;
pub struct Baz;
// @has foo/trait.Foo.html '//h3[@class="code-header in-band"]' 'impl Foo<i32> for Bar'
// @has foo/trait.Foo.html '//h3[@class="code-header"]' 'impl Foo<i32> for Bar'
impl Foo<i32> for Bar {}
// @has foo/trait.Foo.html '//h3[@class="code-header in-band"]' 'impl<T> Foo<T> for Baz'
// @has foo/trait.Foo.html '//h3[@class="code-header"]' 'impl<T> Foo<T> for Baz'
impl<T> Foo<T> for Baz {}

View file

@ -3,5 +3,5 @@
extern crate issue_46727;
// @has issue_46727/trait.Foo.html
// @has - '//h3[@class="code-header in-band"]' 'impl<T> Foo for Bar<[T; 3]>'
// @has - '//h3[@class="code-header"]' 'impl<T> Foo for Bar<[T; 3]>'
pub use issue_46727::{Foo, Bar};

View file

@ -11,8 +11,8 @@ impl<B, C> Signal2 for B where B: Signal<Item = C> {
}
// @has issue_50159/struct.Switch.html
// @has - '//h3[@class="code-header in-band"]' 'impl<B> Send for Switch<B>where <B as Signal>::Item: Send'
// @has - '//h3[@class="code-header in-band"]' 'impl<B> Sync for Switch<B>where <B as Signal>::Item: Sync'
// @has - '//h3[@class="code-header"]' 'impl<B> Send for Switch<B>where <B as Signal>::Item: Send'
// @has - '//h3[@class="code-header"]' 'impl<B> Sync for Switch<B>where <B as Signal>::Item: Sync'
// @count - '//*[@id="implementations-list"]//*[@class="impl"]' 0
// @count - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]' 5
pub struct Switch<B: Signal> {

View file

@ -7,7 +7,7 @@ pub mod traits {
}
// @has issue_51236/struct.Owned.html
// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' \
// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header"]' \
// "impl<T> Send for Owned<T>where <T as Owned<'static>>::Reader: Send"
pub struct Owned<T> where T: for<'a> ::traits::Owned<'a> {
marker: PhantomData<<T as ::traits::Owned<'static>>::Reader>,

View file

@ -1,10 +1,10 @@
pub trait ScopeHandle<'scope> {}
// @has issue_54705/struct.ScopeFutureContents.html
// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' \
// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header"]' \
// "impl<'scope, S> Send for ScopeFutureContents<'scope, S>where S: Sync"
//
// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' \
// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header"]' \
// "impl<'scope, S> Sync for ScopeFutureContents<'scope, S>where S: Sync"
pub struct ScopeFutureContents<'scope, S>
where S: ScopeHandle<'scope>,

View file

@ -1,9 +1,9 @@
#![feature(negative_impls)]
// @has issue_55321/struct.A.html
// @has - '//*[@id="trait-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' \
// @has - '//*[@id="trait-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header"]' \
// "impl !Send for A"
// @has - '//*[@id="trait-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' \
// @has - '//*[@id="trait-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header"]' \
// "impl !Sync for A"
pub struct A();
@ -11,8 +11,8 @@ impl !Send for A {}
impl !Sync for A {}
// @has issue_55321/struct.B.html
// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' \
// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header"]' \
// "impl<T> !Send for B<T>"
// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' \
// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header"]' \
// "impl<T> !Sync for B<T>"
pub struct B<T: ?Sized>(A, Box<T>);

View file

@ -17,7 +17,7 @@ impl<'a, T> MyTrait for Inner<'a, T> {
}
// @has issue_56822/struct.Parser.html
// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' \
// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header"]' \
// "impl<'a> Send for Parser<'a>"
pub struct Parser<'a> {
field: <Wrapper<Inner<'a, u8>> as MyTrait>::Output

View file

@ -26,9 +26,9 @@ where
{}
// @has issue_60726/struct.IntoIter.html
// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' \
// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header"]' \
// "impl<T> !Send for IntoIter<T>"
// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' \
// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header"]' \
// "impl<T> !Sync for IntoIter<T>"
pub struct IntoIter<T>{
hello:DynTrait<FooInterface<T>>,

View file

@ -10,8 +10,8 @@ extern crate realcore;
extern crate real_gimli;
// issue #74672
// @!has foo/trait.Deref.html '//*[@id="impl-Deref-for-EndianSlice"]//h3[@class="code-header in-band"]' 'impl Deref for EndianSlice'
// @!has foo/trait.Deref.html '//*[@id="impl-Deref-for-EndianSlice"]//h3[@class="code-header"]' 'impl Deref for EndianSlice'
pub use realcore::Deref;
// @has foo/trait.Join.html '//*[@id="impl-Join-for-Foo"]//h3[@class="code-header in-band"]' 'impl Join for Foo'
// @has foo/trait.Join.html '//*[@id="impl-Join-for-Foo"]//h3[@class="code-header"]' 'impl Join for Foo'
pub use realcore::Join;

View file

@ -31,7 +31,7 @@ impl<T: Trait3> Trait3 for Vec<T> {
pub struct Struct1 {}
// @has issue_80233_normalize_auto_trait/struct.Question.html
// @has - '//h3[@class="code-header in-band"]' 'impl<T> Send for Question<T>'
// @has - '//h3[@class="code-header"]' 'impl<T> Send for Question<T>'
pub struct Question<T: Trait1> {
pub ins: <<Vec<T> as Trait3>::Type3 as Trait2>::Type2,
}

View file

@ -1,14 +1,14 @@
use std::convert::AsRef;
pub struct Local;
// @has issue_82465_asref_for_and_of_local/struct.Local.html '//h3[@class="code-header in-band"]' 'impl AsRef<str> for Local'
// @has issue_82465_asref_for_and_of_local/struct.Local.html '//h3[@class="code-header"]' 'impl AsRef<str> for Local'
impl AsRef<str> for Local {
fn as_ref(&self) -> &str {
todo!()
}
}
// @has - '//h3[@class="code-header in-band"]' 'impl AsRef<Local> for str'
// @has - '//h3[@class="code-header"]' 'impl AsRef<Local> for str'
impl AsRef<Local> for str {
fn as_ref(&self) -> &Local {
todo!()

View file

@ -12,6 +12,6 @@ extern crate issue_98697_reexport_with_anonymous_lifetime;
// @!has issue_98697/fn.repro.html '//pre[@class="rust fn"]/code' 'for<'
pub use issue_98697_reexport_with_anonymous_lifetime::repro;
// @has issue_98697/struct.Extra.html '//div[@id="trait-implementations-list"]//h3[@class="code-header in-band"]' 'impl MyTrait<&Extra> for Extra'
// @!has issue_98697/struct.Extra.html '//div[@id="trait-implementations-list"]//h3[@class="code-header in-band"]' 'impl<'
// @has issue_98697/struct.Extra.html '//div[@id="trait-implementations-list"]//h3[@class="code-header"]' 'impl MyTrait<&Extra> for Extra'
// @!has issue_98697/struct.Extra.html '//div[@id="trait-implementations-list"]//h3[@class="code-header"]' 'impl<'
pub use issue_98697_reexport_with_anonymous_lifetime::Extra;

View file

@ -5,10 +5,10 @@ pub struct Alpha;
// @matches negative_impl/struct.Bravo.html '//pre' "pub struct Bravo<B>"
pub struct Bravo<B>(B);
// @matches negative_impl/struct.Alpha.html '//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' \
// @matches negative_impl/struct.Alpha.html '//*[@class="impl has-srclink"]//h3[@class="code-header"]' \
// "impl !Send for Alpha"
impl !Send for Alpha {}
// @matches negative_impl/struct.Bravo.html '//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' "\
// @matches negative_impl/struct.Bravo.html '//*[@class="impl has-srclink"]//h3[@class="code-header"]' "\
// impl<B> !Send for Bravo<B>"
impl<B> !Send for Bravo<B> {}

View file

@ -14,7 +14,7 @@
// There should be only one implementation listed.
// @count - '//*[@class="impl has-srclink"]' 1
// @has - '//*[@id="impl-Foo%3C%26A%3E-for-%26B"]/*[@class="code-header in-band"]' \
// @has - '//*[@id="impl-Foo%3C%26A%3E-for-%26B"]/*[@class="code-header"]' \
// 'impl<A, B> Foo<&A> for &B'
#[doc(primitive = "reference")]
/// this is a test!

View file

@ -1,7 +1,7 @@
#![feature(rustdoc_internals)]
#![crate_name = "foo"]
// @has foo/primitive.i32.html '//*[@id="impl-ToString-for-i32"]//h3[@class="code-header in-band"]' 'impl<T> ToString for T'
// @has foo/primitive.i32.html '//*[@id="impl-ToString-for-i32"]//h3[@class="code-header"]' 'impl<T> ToString for T'
#[doc(primitive = "i32")]
/// Some useless docs, wouhou!

View file

@ -9,7 +9,7 @@ impl C {
pub fn c(&self) {}
}
// @has recursive_deref/struct.A.html '//h3[@class="code-header in-band"]' 'impl Deref for A'
// @has recursive_deref/struct.A.html '//h3[@class="code-header"]' 'impl Deref for A'
// @has '-' '//*[@class="impl-items"]//*[@id="method.c"]' 'pub fn c(&self)'
impl Deref for A {
type Target = B;
@ -19,7 +19,7 @@ impl Deref for A {
}
}
// @has recursive_deref/struct.B.html '//h3[@class="code-header in-band"]' 'impl Deref for B'
// @has recursive_deref/struct.B.html '//h3[@class="code-header"]' 'impl Deref for B'
// @has '-' '//*[@class="impl-items"]//*[@id="method.c"]' 'pub fn c(&self)'
impl Deref for B {
type Target = C;
@ -29,7 +29,7 @@ impl Deref for B {
}
}
// @has recursive_deref/struct.C.html '//h3[@class="code-header in-band"]' 'impl Deref for C'
// @has recursive_deref/struct.C.html '//h3[@class="code-header"]' 'impl Deref for C'
impl Deref for C {
type Target = B;
@ -49,7 +49,7 @@ impl G {
pub fn g() {}
}
// @has recursive_deref/struct.D.html '//h3[@class="code-header in-band"]' 'impl Deref for D'
// @has recursive_deref/struct.D.html '//h3[@class="code-header"]' 'impl Deref for D'
// We also check that `G::g` method isn't rendered because there is no `self` argument.
// @!has '-' '//*[@id="deref-methods-G"]' ''
impl Deref for D {
@ -60,7 +60,7 @@ impl Deref for D {
}
}
// @has recursive_deref/struct.E.html '//h3[@class="code-header in-band"]' 'impl Deref for E'
// @has recursive_deref/struct.E.html '//h3[@class="code-header"]' 'impl Deref for E'
// We also check that `G::g` method isn't rendered because there is no `self` argument.
// @!has '-' '//*[@id="deref-methods-G"]' ''
impl Deref for E {
@ -71,7 +71,7 @@ impl Deref for E {
}
}
// @has recursive_deref/struct.F.html '//h3[@class="code-header in-band"]' 'impl Deref for F'
// @has recursive_deref/struct.F.html '//h3[@class="code-header"]' 'impl Deref for F'
// We also check that `G::g` method isn't rendered because there is no `self` argument.
// @!has '-' '//*[@id="deref-methods-G"]' ''
impl Deref for F {
@ -82,7 +82,7 @@ impl Deref for F {
}
}
// @has recursive_deref/struct.G.html '//h3[@class="code-header in-band"]' 'impl Deref for G'
// @has recursive_deref/struct.G.html '//h3[@class="code-header"]' 'impl Deref for G'
impl Deref for G {
type Target = E;
@ -100,7 +100,7 @@ impl I {
pub fn i() {}
}
// @has recursive_deref/struct.H.html '//h3[@class="code-header in-band"]' 'impl Deref for H'
// @has recursive_deref/struct.H.html '//h3[@class="code-header"]' 'impl Deref for H'
// @!has '-' '//*[@id="deref-methods-I"]' ''
impl Deref for H {
type Target = I;
@ -110,7 +110,7 @@ impl Deref for H {
}
}
// @has recursive_deref/struct.I.html '//h3[@class="code-header in-band"]' 'impl Deref for I'
// @has recursive_deref/struct.I.html '//h3[@class="code-header"]' 'impl Deref for I'
impl Deref for I {
type Target = H;

View file

@ -30,10 +30,10 @@ pub trait Tr<T> {
}
// @has - '//section[@id="impl-Tr%3CT%3E-for-T"]' ''
// @!has - '//section[@id="impl-Tr%3CT%3E-for-T"]/h3[@class="code-header in-band"]' '~const'
// @has - '//section[@id="impl-Tr%3CT%3E-for-T"]/h3[@class="code-header in-band"]/a[@class="trait"]' 'Clone'
// @!has - '//section[@id="impl-Tr%3CT%3E-for-T"]/h3[@class="code-header in-band"]/span[@class="where"]' '~const'
// @has - '//section[@id="impl-Tr%3CT%3E-for-T"]/h3[@class="code-header in-band"]/span[@class="where fmt-newline"]' ': Clone'
// @!has - '//section[@id="impl-Tr%3CT%3E-for-T"]/h3[@class="code-header"]' '~const'
// @has - '//section[@id="impl-Tr%3CT%3E-for-T"]/h3[@class="code-header"]/a[@class="trait"]' 'Clone'
// @!has - '//section[@id="impl-Tr%3CT%3E-for-T"]/h3[@class="code-header"]/span[@class="where"]' '~const'
// @has - '//section[@id="impl-Tr%3CT%3E-for-T"]/h3[@class="code-header"]/span[@class="where fmt-newline"]' ': Clone'
impl<T: ~const Clone + ~const Destruct> const Tr<T> for T
where
Option<T>: ~const Clone + ~const Destruct,

View file

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

View file

@ -11,7 +11,7 @@ pub struct Bar {
pub struct Foo<T: ?Sized>(T);
// @has foo/struct.Unsized.html
// @has - '//*[@id="impl-Sized-for-Unsized"]//h3[@class="code-header in-band"]' 'impl !Sized for Unsized'
// @has - '//*[@id="impl-Sized-for-Unsized"]//h3[@class="code-header"]' 'impl !Sized for Unsized'
pub struct Unsized {
data: [u8],
}

View file

@ -1,11 +1,11 @@
#![crate_name = "foo"]
// @has foo/struct.Unsized.html
// @has - '//*[@id="impl-Sized-for-Unsized"]/h3[@class="code-header in-band"]' 'impl !Sized for Unsized'
// @has - '//*[@id="impl-Sized-for-Unsized"]/h3[@class="code-header"]' 'impl !Sized for Unsized'
// @!has - '//*[@id="impl-Sized-for-Unsized"]//a[@class="srclink"]' 'source'
// @has - '//*[@id="impl-Sync-for-Unsized"]/h3[@class="code-header in-band"]' 'impl Sync for Unsized'
// @has - '//*[@id="impl-Sync-for-Unsized"]/h3[@class="code-header"]' 'impl Sync for Unsized'
// @!has - '//*[@id="impl-Sync-for-Unsized"]//a[@class="srclink"]' 'source'
// @has - '//*[@id="impl-Any-for-Unsized"]/h3[@class="code-header in-band"]' 'impl<T> Any for T'
// @has - '//*[@id="impl-Any-for-Unsized"]/h3[@class="code-header"]' 'impl<T> Any for T'
// @has - '//*[@id="impl-Any-for-Unsized"]//a[@class="srclink rightside"]' 'source'
pub struct Unsized {
data: [u8],

View file

@ -1,6 +1,6 @@
// @has basic/struct.Foo.html
// @has - '//h3[@class="code-header in-band"]' 'impl<T> Send for Foo<T>where T: Send'
// @has - '//h3[@class="code-header in-band"]' 'impl<T> Sync for Foo<T>where T: Sync'
// @has - '//h3[@class="code-header"]' 'impl<T> Send for Foo<T>where T: Send'
// @has - '//h3[@class="code-header"]' 'impl<T> Sync for Foo<T>where T: Sync'
// @count - '//*[@id="implementations-list"]//*[@class="impl has-srclink"]' 0
// @count - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]' 5
pub struct Foo<T> {

View file

@ -20,7 +20,7 @@ mod foo {
}
// @has complex/struct.NotOuter.html
// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' \
// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header"]' \
// "impl<'a, T, K: ?Sized> Send for Outer<'a, T, K>where K: for<'b> Fn((&'b bool, &'a u8)) \
// -> &'b i8, T: MyTrait<'a>, <T as MyTrait<'a>>::MyItem: Copy, 'a: 'static"

View file

@ -3,7 +3,7 @@
pub auto trait Banana {}
// @has crate_local/struct.Peach.html
// @has - '//h3[@class="code-header in-band"]' 'impl Banana for Peach'
// @has - '//h3[@class="code-header in-band"]' 'impl Send for Peach'
// @has - '//h3[@class="code-header in-band"]' 'impl Sync for Peach'
// @has - '//h3[@class="code-header"]' 'impl Banana for Peach'
// @has - '//h3[@class="code-header"]' 'impl Send for Peach'
// @has - '//h3[@class="code-header"]' 'impl Sync for Peach'
pub struct Peach;

View file

@ -9,10 +9,10 @@ where
{}
// @has lifetimes/struct.Foo.html
// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' \
// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header"]' \
// "impl<'c, K> Send for Foo<'c, K>where K: for<'b> Fn(&'b bool) -> &'c u8, 'c: 'static"
//
// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' \
// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header"]' \
// "impl<'c, K> Sync for Foo<'c, K>where K: Sync"
pub struct Foo<'c, K: 'c> {
inner_field: Inner<'c, K>,

View file

@ -1,8 +1,8 @@
// @has manual/struct.Foo.html
// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' \
// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header"]' \
// 'impl<T> Sync for Foo<T>where T: Sync'
//
// @has - '//*[@id="trait-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' \
// @has - '//*[@id="trait-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header"]' \
// 'impl<T> Send for Foo<T>'
//
// @count - '//*[@id="trait-implementations-list"]//*[@class="impl has-srclink"]' 1

View file

@ -3,10 +3,10 @@ pub struct Inner<T: Copy> {
}
// @has negative/struct.Outer.html
// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' \
// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header"]' \
// "impl<T> !Send for Outer<T>"
//
// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' \
// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header"]' \
// "impl<T> !Sync for Outer<T>"
pub struct Outer<T: Copy> {
inner_field: Inner<T>,

View file

@ -9,10 +9,10 @@ where
}
// @has nested/struct.Foo.html
// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' \
// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header"]' \
// 'impl<T> Send for Foo<T>where T: Copy'
//
// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' \
// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header"]' \
// 'impl<T> Sync for Foo<T>where T: Sync'
pub struct Foo<T> {
inner_field: Inner<T>,

View file

@ -9,7 +9,7 @@ where
}
// @has no_redundancy/struct.Outer.html
// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' \
// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header"]' \
// "impl<T> Send for Outer<T>where T: Send + Copy"
pub struct Outer<T> {
inner_field: Inner<T>,

View file

@ -21,7 +21,7 @@ enum TyData<I: Interner> {
struct VariableKind<I: Interner>(I::InternedType);
// @has overflow/struct.BoundVarsCollector.html
// @has - '//h3[@class="code-header in-band"]' "impl<'tcx> Send for BoundVarsCollector<'tcx>"
// @has - '//h3[@class="code-header"]' "impl<'tcx> Send for BoundVarsCollector<'tcx>"
pub struct BoundVarsCollector<'tcx> {
val: VariableKind<RustInterner<'tcx>>
}

View file

@ -23,10 +23,10 @@ where
}
// @has project/struct.Foo.html
// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' \
// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header"]' \
// "impl<'c, K> Send for Foo<'c, K>where K: MyTrait<MyItem = bool>, 'c: 'static"
//
// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' \
// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header"]' \
// "impl<'c, K> Sync for Foo<'c, K>where K: MyTrait, <K as MyTrait>::MyItem: OtherTrait, \
// 'c: 'static,"
pub struct Foo<'c, K: 'c> {

View file

@ -23,7 +23,7 @@ impl<T> Pattern for Wrapper<T> {
// @has self_referential/struct.WriteAndThen.html
// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' \
// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header"]' \
// "impl<P1> Send for WriteAndThen<P1>where <P1 as Pattern>::Value: Send"
pub struct WriteAndThen<P1>(pub P1::Value,pub <Constrain<P1, Wrapper<P1::Value>> as Pattern>::Value)
where P1: Pattern;

View file

@ -3,7 +3,7 @@ pub trait OwnedTrait<'a> {
}
// @has static_region/struct.Owned.html
// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' \
// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header"]' \
// "impl<T> Send for Owned<T>where <T as OwnedTrait<'static>>::Reader: Send"
pub struct Owned<T> where T: OwnedTrait<'static> {
marker: <T as OwnedTrait<'static>>::Reader,

View file

@ -4,7 +4,7 @@
pub struct Bounded<T: Clone>(T);
// @has traits_in_bodies/struct.SomeStruct.html
// @has - '//h3[@class="code-header in-band"]' 'impl Clone for SomeStruct'
// @has - '//h3[@class="code-header"]' 'impl Clone for SomeStruct'
pub struct SomeStruct;
fn asdf() -> Bounded<SomeStruct> {
@ -18,7 +18,7 @@ fn asdf() -> Bounded<SomeStruct> {
}
// @has traits_in_bodies/struct.Point.html
// @has - '//h3[@class="code-header in-band"]' 'impl Copy for Point'
// @has - '//h3[@class="code-header"]' 'impl Copy for Point'
#[derive(Clone)]
pub struct Point {
x: i32,
@ -31,7 +31,7 @@ const _FOO: () = {
};
// @has traits_in_bodies/struct.Inception.html
// @has - '//h3[@class="code-header in-band"]' 'impl Clone for Inception'
// @has - '//h3[@class="code-header"]' 'impl Clone for Inception'
pub struct Inception;
static _BAR: usize = {

View file

@ -9,8 +9,8 @@ impl MyStruct {
}
// @has typedef/type.MyAlias.html
// @has - '//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' 'impl MyAlias'
// @has - '//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' 'impl MyTrait for MyAlias'
// @has - '//*[@class="impl has-srclink"]//h3[@class="code-header"]' 'impl MyAlias'
// @has - '//*[@class="impl has-srclink"]//h3[@class="code-header"]' 'impl MyTrait for MyAlias'
// @hasraw - 'Alias docstring'
// @has - '//*[@class="sidebar"]//*[@class="location"]' 'MyAlias'
// @has - '//*[@class="sidebar"]//a[@href="#implementations"]' 'Methods'

View file

@ -13,7 +13,7 @@ pub fn charlie<C>() where C: MyTrait {}
pub struct Delta<D>(D);
// @has foo/struct.Delta.html '//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' \
// @has foo/struct.Delta.html '//*[@class="impl has-srclink"]//h3[@class="code-header"]' \
// "impl<D> Delta<D>where D: MyTrait"
impl<D> Delta<D> where D: MyTrait {
pub fn delta() {}
@ -43,17 +43,17 @@ pub trait TraitWhere {
{ todo!() }
}
// @has foo/struct.Echo.html '//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' \
// @has foo/struct.Echo.html '//*[@class="impl has-srclink"]//h3[@class="code-header"]' \
// "impl<E> MyTrait for Echo<E>where E: MyTrait"
// @has foo/trait.MyTrait.html '//*[@id="implementors-list"]//h3[@class="code-header in-band"]' \
// @has foo/trait.MyTrait.html '//*[@id="implementors-list"]//h3[@class="code-header"]' \
// "impl<E> MyTrait for Echo<E>where E: MyTrait"
impl<E> MyTrait for Echo<E>where E: MyTrait {}
pub enum Foxtrot<F> { Foxtrot1(F) }
// @has foo/enum.Foxtrot.html '//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' \
// @has foo/enum.Foxtrot.html '//*[@class="impl has-srclink"]//h3[@class="code-header"]' \
// "impl<F> MyTrait for Foxtrot<F>where F: MyTrait"
// @has foo/trait.MyTrait.html '//*[@id="implementors-list"]//h3[@class="code-header in-band"]' \
// @has foo/trait.MyTrait.html '//*[@id="implementors-list"]//h3[@class="code-header"]' \
// "impl<F> MyTrait for Foxtrot<F>where F: MyTrait"
impl<F> MyTrait for Foxtrot<F>where F: MyTrait {}