From 10bafe1975e53769180701508e2b8cd3a3b34a0e Mon Sep 17 00:00:00 2001 From: Jacob Hoffman-Andrews Date: Sun, 23 May 2021 08:09:39 -0700 Subject: Remove toggle for "undocumented items." Per discussion in #84326. For trait implementations, this was misleading: the items actually do have documentation (but it comes from the trait definition). For both trait implementations and trait implementors, this was redundant: in both of those cases, the items are default-hidden by different toggle at the level above. Update tests: Remove XPath selectors that over-specified on details tag, in cases that weren't testing toggles. Add an explicit test for toggles on methods. Rename item-hide-threshold to toggle-item-contents for consistency. --- src/test/rustdoc/toggle-method.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/test/rustdoc/toggle-method.rs (limited to 'src/test/rustdoc/toggle-method.rs') diff --git a/src/test/rustdoc/toggle-method.rs b/src/test/rustdoc/toggle-method.rs new file mode 100644 index 00000000000..f7f6086a4cb --- /dev/null +++ b/src/test/rustdoc/toggle-method.rs @@ -0,0 +1,18 @@ +#![crate_name = "foo"] + +// Struct methods with documentation should be wrapped in a
toggle with an appropriate +// summary. Struct methods with no documentation should not be wrapped. +// +// @has foo/struct.Foo.html +// @has - '//details[@class="rustdoc-toggle method-toggle"]//summary//code' 'is_documented()' +// @has - '//details[@class="rustdoc-toggle method-toggle"]//*[@class="docblock"]' 'is_documented is documented' +// @!has - '//details[@class="rustdoc-toggle method-toggle"]//summary//code' 'not_documented()' +pub struct Foo { +} + +impl Foo { + pub fn not_documented() {} + + /// is_documented is documented + pub fn is_documented() {} +} -- cgit 1.4.1-3-g733a5