Skip to content

Commit

Permalink
Rollup merge of rust-lang#101245 - GuillaumeGomez:remove-unneeded-whe…
Browse files Browse the repository at this point in the history
…re-whitespace, r=notriddle

Remove unneeded where whitespace

It fixes these two bugs:

![Screenshot from 2022-08-31 18-14-40](https://user-images.githubusercontent.com/3050060/187727950-94657419-abfa-454c-9d27-004280fbcb45.png)
![Screenshot from 2022-08-31 18-14-49](https://user-images.githubusercontent.com/3050060/187727956-21d1b39d-62d7-4e7b-8f6f-631ceda67a19.png)

It's a relic from a very old time (this commit: rust-lang@bfd01b7).

You can test the result [here](https://rustdoc.crud.net/imperio/remove-unneeded-where-whitespace/lib2/struct.WhereWhitespace.html).

cc ```@jsha```
r? ```@notriddle```
  • Loading branch information
Dylan-DPC authored Sep 1, 2022
2 parents 006fa19 + b112bfe commit ac09b59
Show file tree
Hide file tree
Showing 28 changed files with 114 additions and 67 deletions.
13 changes: 4 additions & 9 deletions src/librustdoc/html/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -349,8 +349,7 @@ pub(crate) fn print_where_clause<'a, 'tcx: 'a>(
let where_preds = comma_sep(where_predicates, false);
let clause = if f.alternate() {
if ending == Ending::Newline {
// add a space so stripping <br> tags and breaking spaces still renders properly
format!(" where{where_preds}, ")
format!(" where{where_preds},")
} else {
format!(" where{where_preds}")
}
Expand All @@ -364,20 +363,16 @@ pub(crate) fn print_where_clause<'a, 'tcx: 'a>(

if ending == Ending::Newline {
let mut clause = "&nbsp;".repeat(indent.saturating_sub(1));
// add a space so stripping <br> tags and breaking spaces still renders properly
write!(
clause,
" <span class=\"where fmt-newline\">where{where_preds},&nbsp;</span>"
)?;
write!(clause, "<span class=\"where fmt-newline\">where{where_preds},</span>")?;
clause
} else {
// insert a <br> tag after a single space but before multiple spaces at the start
if indent == 0 {
format!(" <br><span class=\"where\">where{where_preds}</span>")
format!("<br><span class=\"where\">where{where_preds}</span>")
} else {
let mut clause = br_with_padding;
clause.truncate(clause.len() - 5 * "&nbsp;".len());
write!(clause, " <span class=\"where\">where{where_preds}</span>")?;
write!(clause, "<span class=\"where\">where{where_preds}</span>")?;
clause
}
}
Expand Down
12 changes: 6 additions & 6 deletions src/librustdoc/html/render/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1737,8 +1737,8 @@ pub(crate) fn render_impl_summary(
// in documentation pages for trait with automatic implementations like "Send" and "Sync".
aliases: &[String],
) {
let id =
cx.derive_id(get_id_for_impl(&i.inner_impl().for_, i.inner_impl().trait_.as_ref(), cx));
let inner_impl = i.inner_impl();
let id = cx.derive_id(get_id_for_impl(&inner_impl.for_, inner_impl.trait_.as_ref(), cx));
let aliases = if aliases.is_empty() {
String::new()
} else {
Expand All @@ -1750,9 +1750,9 @@ pub(crate) fn render_impl_summary(
write!(w, "<h3 class=\"code-header in-band\">");

if let Some(use_absolute) = use_absolute {
write!(w, "{}", i.inner_impl().print(use_absolute, cx));
write!(w, "{}", inner_impl.print(use_absolute, cx));
if show_def_docs {
for it in &i.inner_impl().items {
for it in &inner_impl.items {
if let clean::AssocTypeItem(ref tydef, ref _bounds) = *it.kind {
w.write_str("<span class=\"where fmt-newline\"> ");
assoc_type(
Expand All @@ -1770,11 +1770,11 @@ pub(crate) fn render_impl_summary(
}
}
} else {
write!(w, "{}", i.inner_impl().print(false, cx));
write!(w, "{}", inner_impl.print(false, cx));
}
write!(w, "</h3>");

let is_trait = i.inner_impl().trait_.is_some();
let is_trait = inner_impl.trait_.is_some();
if is_trait {
if let Some(portability) = portability(&i.impl_item, Some(parent)) {
write!(w, "<span class=\"item-info\">{}</span>", portability);
Expand Down
27 changes: 27 additions & 0 deletions src/test/rustdoc-gui/src/lib2/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,3 +143,30 @@ pub struct LongItemInfo2;
/// Some docs.
#[doc(cfg(any(target_os = "android", target_os = "linux", target_os = "emscripten", target_os = "dragonfly", target_os = "freebsd", target_os = "netbsd", target_os = "openbsd")))]
impl SimpleTrait for LongItemInfo2 {}

pub struct WhereWhitespace<T>;

impl<T> WhereWhitespace<T> {
pub fn new<F>(f: F) -> Self
where
F: FnMut() -> i32,
{}
}

impl<K, T> Whitespace<&K> for WhereWhitespace<T>
where
K: std::fmt::Debug,
{
type Output = WhereWhitespace<T>;
fn index(&self, _key: &K) -> &Self::Output {
self
}
}

pub trait Whitespace<Idx>
where
Idx: ?Sized,
{
type Output;
fn index(&self, index: Idx) -> &Self::Output;
}
27 changes: 27 additions & 0 deletions src/test/rustdoc-gui/where-whitespace.goml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// This test ensures that the where conditions are correctly displayed.
goto: file://|DOC_PATH|/lib2/trait.Whitespace.html
show-text: true
// First, we check in the trait definition if the where clause is "on its own" (not on the same
// line than "pub trait Whitespace<Idx>").
compare-elements-position-false: (".item-decl code", ".where.fmt-newline", ("y"))
// And that the code following it isn't on the same line either.
compare-elements-position-false: (".item-decl .fnname", ".where.fmt-newline", ("y"))

goto: file://|DOC_PATH|/lib2/struct.WhereWhitespace.html
// We make the screen a bit wider to ensure that the trait impl is on one line.
size: (915, 915)

compare-elements-position-false: ("#method\.new .fnname", "#method\.new .where.fmt-newline", ("y"))
// We ensure that both the trait name and the struct name are on the same line in
// "impl<K, T> Whitespace<&K> for WhereWhitespace<T>".
compare-elements-position: (
"#trait-implementations-list .impl h3 .trait",
"#trait-implementations-list .impl h3 .struct",
("y"),
)
// And we now check that the where condition isn't on the same line.
compare-elements-position-false: (
"#trait-implementations-list .impl h3 .trait",
"#trait-implementations-list .impl h3 .where.fmt-newline",
("y"),
)
8 changes: 4 additions & 4 deletions src/test/rustdoc/const-generics/const-generics-docs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ impl Trait<{1 + 2}> for u8 {}
impl<const N: usize> Trait<N> for [u8; N] {}

// @has foo/struct.Foo.html '//pre[@class="rust struct"]' \
// 'pub struct Foo<const N: usize> where u8: Trait<N>'
// 'pub struct Foo<const N: usize>where u8: Trait<N>'
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 in-band"]' '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;
Expand All @@ -50,14 +50,14 @@ 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>'
impl<const M: usize> Bar<u8, M> {
// @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>'
pub fn hey<const N: usize>(&self) -> Foo<N> where u8: Trait<N> {
Foo
}
}

// @has foo/fn.test.html '//pre[@class="rust fn"]' \
// 'pub fn test<const N: usize>() -> impl Trait<N> where u8: Trait<N>'
// 'pub fn test<const N: usize>() -> impl Trait<N>where u8: Trait<N>'
pub fn test<const N: usize>() -> impl Trait<N> where u8: Trait<N> {
2u8
}
Expand Down
4 changes: 2 additions & 2 deletions src/test/rustdoc/generic-associated-types/gats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

// @has foo/trait.LendingIterator.html
pub trait LendingIterator {
// @has - '//*[@id="associatedtype.Item"]//h4[@class="code-header"]' "type Item<'a> where Self: 'a"
// @has - '//*[@id="associatedtype.Item"]//h4[@class="code-header"]' "type Item<'a>where Self: 'a"
type Item<'a> where Self: 'a;

// @has - '//*[@id="tymethod.next"]//h4[@class="code-header"]' \
Expand All @@ -24,7 +24,7 @@ impl LendingIterator for () {
pub struct Infinite<T>(T);

// @has foo/trait.LendingIterator.html
// @has - '//*[@id="associatedtype.Item-2"]//h4[@class="code-header"]' "type Item<'a> where Self: 'a = &'a T"
// @has - '//*[@id="associatedtype.Item-2"]//h4[@class="code-header"]' "type Item<'a>where Self: 'a = &'a T"
impl<T> LendingIterator for Infinite<T> {
type Item<'a> where Self: 'a = &'a T;

Expand Down
8 changes: 4 additions & 4 deletions src/test/rustdoc/higher-ranked-trait-bounds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@
pub trait Trait<'x> {}

// @has foo/fn.test1.html
// @has - '//pre' "pub fn test1<T>() where for<'a> &'a T: Iterator,"
// @has - '//pre' "pub fn test1<T>()where for<'a> &'a T: Iterator,"
pub fn test1<T>()
where
for<'a> &'a T: Iterator,
{
}

// @has foo/fn.test2.html
// @has - '//pre' "pub fn test2<T>() where for<'a, 'b> &'a T: Trait<'b>,"
// @has - '//pre' "pub fn test2<T>()where for<'a, 'b> &'a T: Trait<'b>,"
pub fn test2<T>()
where
for<'a, 'b> &'a T: Trait<'b>,
{
}

// @has foo/fn.test3.html
// @has - '//pre' "pub fn test3<F>() where F: for<'a, 'b> Fn(&'a u8, &'b u8),"
// @has - '//pre' "pub fn test3<F>()where F: for<'a, 'b> Fn(&'a u8, &'b u8),"
pub fn test3<F>()
where
F: for<'a, 'b> Fn(&'a u8, &'b u8),
Expand All @@ -38,7 +38,7 @@ pub struct Foo<'a> {
// @has - '//span[@id="structfield.some_trait"]' "some_trait: &'a dyn for<'b> Trait<'b>"

impl<'a> Foo<'a> {
// @has - '//h4[@class="code-header"]' "pub fn bar<T>() where T: Trait<'a>,"
// @has - '//h4[@class="code-header"]' "pub fn bar<T>()where T: Trait<'a>,"
pub fn bar<T>()
where
T: Trait<'a>,
Expand Down
4 changes: 2 additions & 2 deletions src/test/rustdoc/impl-parts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ 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"]' \
// "impl<T: Clone> !AnAutoTrait for Foo<T> where T: Sync,"
// "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"]' \
// "impl<T: Clone> !AnAutoTrait for Foo<T> where T: Sync,"
// "impl<T: Clone> !AnAutoTrait for Foo<T>where T: Sync,"
impl<T: Clone> !AnAutoTrait for Foo<T> where T: Sync {}
4 changes: 2 additions & 2 deletions src/test/rustdoc/issue-20727-4.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ pub trait IndexMut<Idx: ?Sized>: Index<Idx> {

pub mod reexport {
// @has issue_20727_4/reexport/trait.Index.html
// @has - '//*[@class="rust trait"]' 'trait Index<Idx> where Idx: ?Sized, {'
// @has - '//*[@class="rust trait"]' 'trait Index<Idx>where Idx: ?Sized,{'
// @has - '//*[@class="rust trait"]' 'type Output: ?Sized'
// @has - '//*[@class="rust trait"]' \
// 'fn index(&self, index: Idx) -> &Self::Output'
pub use issue_20727::Index;

// @has issue_20727_4/reexport/trait.IndexMut.html
// @has - '//*[@class="rust trait"]' \
// 'trait IndexMut<Idx>: Index<Idx> where Idx: ?Sized, {'
// 'trait IndexMut<Idx>: Index<Idx>where Idx: ?Sized,{'
// @has - '//*[@class="rust trait"]' \
// 'fn index_mut(&mut self, index: Idx) -> &mut Self::Output;'
pub use issue_20727::IndexMut;
Expand Down
2 changes: 1 addition & 1 deletion src/test/rustdoc/issue-21801.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ extern crate issue_21801;

// @has issue_21801/struct.Foo.html
// @has - '//*[@id="method.new"]' \
// 'fn new<F>(f: F) -> Foo where F: FnMut() -> i32'
// 'fn new<F>(f: F) -> Foowhere F: FnMut() -> i32'
pub use issue_21801::Foo;
2 changes: 1 addition & 1 deletion src/test/rustdoc/issue-29503.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 T where T: Debug"
// @has - "//div[@id='implementors-list']//*[@id='impl-MyTrait-for-T']//h3[@class='code-header in-band']" "impl<T> MyTrait for Twhere T: Debug"
impl<T> MyTrait for T
where
T: fmt::Debug,
Expand Down
2 changes: 1 addition & 1 deletion src/test/rustdoc/issue-34928.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

pub trait Bar {}

// @has foo/struct.Foo.html '//pre' 'pub struct Foo<T>(pub T) where T: Bar;'
// @has foo/struct.Foo.html '//pre' 'pub struct Foo<T>(pub T)where T: Bar;'
pub struct Foo<T>(pub T) where T: Bar;
4 changes: 2 additions & 2 deletions src/test/rustdoc/issue-50159.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 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'
// @count - '//*[@id="implementations-list"]//*[@class="impl"]' 0
// @count - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]' 5
pub struct Switch<B: Signal> {
Expand Down
2 changes: 1 addition & 1 deletion src/test/rustdoc/issue-51236.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,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"]' \
// "impl<T> Send for Owned<T> where <T as Owned<'static>>::Reader: Send"
// "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>,
}
6 changes: 2 additions & 4 deletions src/test/rustdoc/issue-54705.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
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"]' \
// "impl<'scope, S> Send for ScopeFutureContents<'scope, S> where S: Sync"
// "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"]' \
// "impl<'scope, S> Sync for ScopeFutureContents<'scope, S> where S: Sync"
// "impl<'scope, S> Sync for ScopeFutureContents<'scope, S>where S: Sync"
pub struct ScopeFutureContents<'scope, S>
where S: ScopeHandle<'scope>,
{
Expand Down
2 changes: 1 addition & 1 deletion src/test/rustdoc/issue-98697.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

extern crate issue_98697_reexport_with_anonymous_lifetime;

// @has issue_98697/fn.repro.html '//pre[@class="rust fn"]/code' 'fn repro<F>() where F: Fn(&str)'
// @has issue_98697/fn.repro.html '//pre[@class="rust fn"]/code' 'fn repro<F>()where F: Fn(&str)'
// @!has issue_98697/fn.repro.html '//pre[@class="rust fn"]/code' 'for<'
pub use issue_98697_reexport_with_anonymous_lifetime::repro;

Expand Down
4 changes: 2 additions & 2 deletions src/test/rustdoc/primitive-slice-auto-trait.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
// @has - '//span[@class="in-band"]' 'Primitive Type slice'
// @has - '//section[@id="main-content"]//div[@class="docblock"]//p' 'this is a test!'
// @has - '//h2[@id="synthetic-implementations"]' 'Auto Trait Implementations'
// @has - '//div[@id="synthetic-implementations-list"]//h3' 'impl<T> Send for [T] where T: Send'
// @has - '//div[@id="synthetic-implementations-list"]//h3' 'impl<T> Sync for [T] where T: Sync'
// @has - '//div[@id="synthetic-implementations-list"]//h3' 'impl<T> Send for [T]where T: Send'
// @has - '//div[@id="synthetic-implementations-list"]//h3' 'impl<T> Sync for [T]where T: Sync'
#[doc(primitive = "slice")]
/// this is a test!
mod slice_prim {}
4 changes: 2 additions & 2 deletions src/test/rustdoc/synthetic_auto/basic.rs
Original file line number Diff line number Diff line change
@@ -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 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'
// @count - '//*[@id="implementations-list"]//*[@class="impl has-srclink"]' 0
// @count - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]' 5
pub struct Foo<T> {
Expand Down
2 changes: 1 addition & 1 deletion src/test/rustdoc/synthetic_auto/complex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ mod foo {

// @has complex/struct.NotOuter.html
// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' \
// "impl<'a, T, K: ?Sized> Send for Outer<'a, T, K> where K: for<'b> Fn((&'b bool, &'a u8)) \
// "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"

pub use foo::{Foo, Inner as NotInner, MyTrait as NotMyTrait, Outer as NotOuter};
Expand Down
4 changes: 2 additions & 2 deletions src/test/rustdoc/synthetic_auto/lifetimes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ where

// @has lifetimes/struct.Foo.html
// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' \
// "impl<'c, K> Send for Foo<'c, K> where K: for<'b> Fn(&'b bool) -> &'c u8, 'c: 'static"
// "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"]' \
// "impl<'c, K> Sync for Foo<'c, K> where K: Sync"
// "impl<'c, K> Sync for Foo<'c, K>where K: Sync"
pub struct Foo<'c, K: 'c> {
inner_field: Inner<'c, K>,
}
2 changes: 1 addition & 1 deletion src/test/rustdoc/synthetic_auto/manual.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// @has manual/struct.Foo.html
// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' \
// 'impl<T> Sync for Foo<T> where T: Sync'
// 'impl<T> Sync for Foo<T>where T: Sync'
//
// @has - '//*[@id="trait-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' \
// 'impl<T> Send for Foo<T>'
Expand Down
4 changes: 2 additions & 2 deletions src/test/rustdoc/synthetic_auto/nested.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ where

// @has nested/struct.Foo.html
// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' \
// 'impl<T> Send for Foo<T> where T: Copy'
// 'impl<T> Send for Foo<T>where T: Copy'
//
// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' \
// 'impl<T> Sync for Foo<T> where T: Sync'
// 'impl<T> Sync for Foo<T>where T: Sync'
pub struct Foo<T> {
inner_field: Inner<T>,
}
2 changes: 1 addition & 1 deletion src/test/rustdoc/synthetic_auto/no-redundancy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ where

// @has no_redundancy/struct.Outer.html
// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' \
// "impl<T> Send for Outer<T> where T: Send + Copy"
// "impl<T> Send for Outer<T>where T: Send + Copy"
pub struct Outer<T> {
inner_field: Inner<T>,
}
4 changes: 2 additions & 2 deletions src/test/rustdoc/synthetic_auto/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ where

// @has project/struct.Foo.html
// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' \
// "impl<'c, K> Send for Foo<'c, K> where K: MyTrait<MyItem = bool>, 'c: 'static"
// "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"]' \
// "impl<'c, K> Sync for Foo<'c, K> where K: MyTrait, <K as MyTrait>::MyItem: OtherTrait, \
// "impl<'c, K> Sync for Foo<'c, K>where K: MyTrait, <K as MyTrait>::MyItem: OtherTrait, \
// 'c: 'static,"
pub struct Foo<'c, K: 'c> {
inner_field: Inner<'c, K>,
Expand Down
Loading

0 comments on commit ac09b59

Please sign in to comment.