1
Fork 0

rustdoc: use details tag for trait implementors

This switches from JS-generated toggles to using the HTML <details> tag
for expanding and collapsing entries in the "Implementors" section.
This commit is contained in:
Jacob Hoffman-Andrews 2021-04-17 23:43:20 -07:00
parent 392ba2ba1a
commit 569096cbaf
25 changed files with 68 additions and 66 deletions

View file

@ -1313,6 +1313,7 @@ fn render_impl(
let cache = cx.cache(); let cache = cx.cache();
let traits = &cache.traits; let traits = &cache.traits;
let trait_ = i.trait_did_full(cache).map(|did| &traits[&did]); let trait_ = i.trait_did_full(cache).map(|did| &traits[&did]);
let mut close_tags = String::new();
if render_mode == RenderMode::Normal { if render_mode == RenderMode::Normal {
let id = cx.derive_id(match i.inner_impl().trait_ { let id = cx.derive_id(match i.inner_impl().trait_ {
@ -1331,7 +1332,12 @@ fn render_impl(
format!(" aliases=\"{}\"", aliases.join(",")) format!(" aliases=\"{}\"", aliases.join(","))
}; };
if let Some(use_absolute) = use_absolute { if let Some(use_absolute) = use_absolute {
write!(w, "<h3 id=\"{}\" class=\"impl\"{}><code class=\"in-band\">", id, aliases); write!(
w,
"<details class=\"rustdoc-toggle implementors-toggle\"><summary><h3 id=\"{}\" class=\"impl\"{}><code class=\"in-band\">",
id, aliases
);
close_tags.insert_str(0, "</details>");
write!(w, "{}", i.inner_impl().print(use_absolute, cx)); write!(w, "{}", i.inner_impl().print(use_absolute, cx));
if show_def_docs { if show_def_docs {
for it in &i.inner_impl().items { for it in &i.inner_impl().items {
@ -1354,11 +1360,12 @@ fn render_impl(
} else { } else {
write!( write!(
w, w,
"<h3 id=\"{}\" class=\"impl\"{}><code class=\"in-band\">{}</code>", "<details class=\"rustdoc-toggle implementors-toggle\"><summary><h3 id=\"{}\" class=\"impl\"{}><code class=\"in-band\">{}</code>",
id, id,
aliases, aliases,
i.inner_impl().print(false, cx) i.inner_impl().print(false, cx)
); );
close_tags.insert_str(0, "</details>");
} }
write!(w, "<a href=\"#{}\" class=\"anchor\"></a>", id); write!(w, "<a href=\"#{}\" class=\"anchor\"></a>", id);
render_stability_since_raw( render_stability_since_raw(
@ -1370,6 +1377,7 @@ fn render_impl(
); );
write_srclink(cx, &i.impl_item, w); write_srclink(cx, &i.impl_item, w);
w.write_str("</h3>"); w.write_str("</h3>");
w.write_str("</summary>");
if trait_.is_some() { if trait_.is_some() {
if let Some(portability) = portability(&i.impl_item, Some(parent)) { if let Some(portability) = portability(&i.impl_item, Some(parent)) {
@ -1580,6 +1588,7 @@ fn render_impl(
} }
w.write_str("<div class=\"impl-items\">"); w.write_str("<div class=\"impl-items\">");
close_tags.insert_str(0, "</div>");
for trait_item in &i.inner_impl().items { for trait_item in &i.inner_impl().items {
doc_impl_item( doc_impl_item(
w, w,
@ -1650,7 +1659,7 @@ fn render_impl(
); );
} }
} }
w.write_str("</div>"); w.write_str(&close_tags);
} }
fn print_sidebar(cx: &Context<'_>, it: &clean::Item, buffer: &mut Buffer) { fn print_sidebar(cx: &Context<'_>, it: &clean::Item, buffer: &mut Buffer) {

View file

@ -1196,31 +1196,18 @@ function hideThemeButtonState() {
if (!next) { if (!next) {
return; return;
} }
if (hasClass(e, "impl") &&
(next.getElementsByClassName("method").length > 0 ||
next.getElementsByClassName("associatedconstant").length > 0)) {
var newToggle = toggle.cloneNode(true);
insertAfter(newToggle, e.childNodes[e.childNodes.length - 1]);
// In case the option "auto-collapse implementors" is not set to false, we collapse
// all implementors.
if (hideImplementors === true && e.parentNode.id === "implementors-list") {
collapseDocs(newToggle, "hide");
}
}
}; };
onEachLazy(document.getElementsByClassName("method"), func); onEachLazy(document.getElementsByClassName("method"), func);
onEachLazy(document.getElementsByClassName("associatedconstant"), func); onEachLazy(document.getElementsByClassName("associatedconstant"), func);
onEachLazy(document.getElementsByClassName("impl"), funcImpl);
var impl_call = function() {}; var impl_call = function() {};
// Large items are hidden by default in the HTML. If the setting overrides that, show 'em. onEachLazy(document.getElementsByTagName("details"), function (e) {
if (!hideLargeItemContents) { var showLargeItem = !hideLargeItemContents && hasClass(e, "type-contents-toggle");
onEachLazy(document.getElementsByTagName("details"), function (e) { var showImplementor = !hideImplementors && hasClass(e, "implementors-toggle");
if (hasClass(e, "type-contents-toggle")) { if (showLargeItem || showImplementor) {
e.open = true; e.open = true;
} }
}); });
}
if (hideMethodDocs === true) { if (hideMethodDocs === true) {
impl_call = function(e, newToggle) { impl_call = function(e, newToggle) {
if (e.id.match(/^impl(?:-\d+)?$/) === null) { if (e.id.match(/^impl(?:-\d+)?$/) === null) {

View file

@ -1561,6 +1561,10 @@ h4 > .notable-traits {
left: -10px; left: -10px;
} }
.item-list > details.rustdoc-toggle > summary:not(.hideme)::before {
left: -10px;
}
#all-types { #all-types {
margin: 10px; margin: 10px;
} }
@ -1775,6 +1779,7 @@ details.rustdoc-toggle > summary::before {
font-weight: 300; font-weight: 300;
font-size: 0.8em; font-size: 0.8em;
letter-spacing: 1px; letter-spacing: 1px;
cursor: pointer;
} }
details.rustdoc-toggle > summary.hideme::before { details.rustdoc-toggle > summary.hideme::before {
@ -1782,7 +1787,8 @@ details.rustdoc-toggle > summary.hideme::before {
} }
details.rustdoc-toggle > summary:not(.hideme)::before { details.rustdoc-toggle > summary:not(.hideme)::before {
float: left; position: absolute;
left: -23px;
} }
/* When a "hideme" summary is open and the "Expand description" or "Show /* When a "hideme" summary is open and the "Expand description" or "Show

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"]//h3/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

@ -1,8 +1,8 @@
// @has issue_33054/impls/struct.Foo.html // @has issue_33054/impls/struct.Foo.html
// @has - '//code' 'impl Foo' // @has - '//code' 'impl Foo'
// @has - '//code' 'impl Bar for Foo' // @has - '//code' 'impl Bar for Foo'
// @count - '//*[@id="trait-implementations-list"]/*[@class="impl"]' 1 // @count - '//*[@id="trait-implementations-list"]//*[@class="impl"]' 1
// @count - '//*[@id="main"]/*[@class="impl"]' 1 // @count - '//*[@id="main"]/details/summary/*[@class="impl"]' 1
// @has issue_33054/impls/bar/trait.Bar.html // @has issue_33054/impls/bar/trait.Bar.html
// @has - '//code' 'impl Bar for Foo' // @has - '//code' 'impl Bar for Foo'
// @count - '//*[@class="struct"]' 1 // @count - '//*[@class="struct"]' 1

View file

@ -7,5 +7,5 @@ mod inner {
pub trait Blah { } pub trait Blah { }
// @count issue_21474/struct.What.html \ // @count issue_21474/struct.What.html \
// '//*[@id="trait-implementations-list"]/*[@class="impl"]' 1 // '//*[@id="trait-implementations-list"]//*[@class="impl"]' 1
pub struct What; pub struct What;

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']//h3[@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

@ -4,12 +4,12 @@ pub trait Bar<T, U> {}
// @has 'foo/struct.Foo1.html' // @has 'foo/struct.Foo1.html'
pub struct Foo1; pub struct Foo1;
// @count - '//*[@id="trait-implementations-list"]/*[@class="impl"]' 1 // @count - '//*[@id="trait-implementations-list"]//*[@class="impl"]' 1
// @has - '//*[@class="impl"]' "impl Bar<Foo1, &'static Foo1> for Foo1" // @has - '//*[@class="impl"]' "impl Bar<Foo1, &'static Foo1> for Foo1"
impl Bar<Foo1, &'static Foo1> for Foo1 {} impl Bar<Foo1, &'static Foo1> for Foo1 {}
// @has 'foo/struct.Foo2.html' // @has 'foo/struct.Foo2.html'
pub struct Foo2; pub struct Foo2;
// @count - '//*[@id="trait-implementations-list"]/*[@class="impl"]' 1 // @count - '//*[@id="trait-implementations-list"]//*[@class="impl"]' 1
// @has - '//*[@class="impl"]' "impl Bar<&'static Foo2, Foo2> for u8" // @has - '//*[@class="impl"]' "impl Bar<&'static Foo2, Foo2> for u8"
impl Bar<&'static Foo2, Foo2> for u8 {} impl Bar<&'static Foo2, Foo2> for u8 {}

View file

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

View file

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

View file

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

View file

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

View file

@ -1,16 +1,16 @@
#![feature(negative_impls)] #![feature(negative_impls)]
// @has issue_55321/struct.A.html // @has issue_55321/struct.A.html
// @has - '//*[@id="trait-implementations-list"]/*[@class="impl"]//code' "impl !Send for A" // @has - '//*[@id="trait-implementations-list"]//*[@class="impl"]//code' "impl !Send for A"
// @has - '//*[@id="trait-implementations-list"]/*[@class="impl"]//code' "impl !Sync for A" // @has - '//*[@id="trait-implementations-list"]//*[@class="impl"]//code' "impl !Sync for A"
pub struct A(); pub struct A();
impl !Send for A {} impl !Send for A {}
impl !Sync for A {} impl !Sync for A {}
// @has issue_55321/struct.B.html // @has issue_55321/struct.B.html
// @has - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]//code' "impl<T> !Send for \ // @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]//code' "impl<T> !Send for \
// B<T>" // B<T>"
// @has - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]//code' "impl<T> !Sync for \ // @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]//code' "impl<T> !Sync for \
// B<T>" // B<T>"
pub struct B<T: ?Sized>(A, Box<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 issue_56822/struct.Parser.html
// @has - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]//code' "impl<'a> Send for \ // @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]//code' "impl<'a> Send for \
// Parser<'a>" // Parser<'a>"
pub struct Parser<'a> { pub struct Parser<'a> {
field: <Wrapper<Inner<'a, u8>> as MyTrait>::Output field: <Wrapper<Inner<'a, u8>> as MyTrait>::Output

View file

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

View file

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

View file

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

View file

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

View file

@ -1,12 +1,12 @@
// @has manual/struct.Foo.html // @has manual/struct.Foo.html
// @has - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]//code' 'impl<T> Sync for \ // @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]//code' 'impl<T> Sync for \
// Foo<T> where T: Sync' // Foo<T> where T: Sync'
// //
// @has - '//*[@id="trait-implementations-list"]/*[@class="impl"]//code' \ // @has - '//*[@id="trait-implementations-list"]//*[@class="impl"]//code' \
// 'impl<T> Send for Foo<T>' // 'impl<T> Send for Foo<T>'
// //
// @count - '//*[@id="trait-implementations-list"]/*[@class="impl"]' 1 // @count - '//*[@id="trait-implementations-list"]//*[@class="impl"]' 1
// @count - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]' 4 // @count - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]' 4
pub struct Foo<T> { pub struct Foo<T> {
field: T, field: T,
} }

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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