about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-09-26 02:31:12 +0000
committerbors <bors@rust-lang.org>2021-09-26 02:31:12 +0000
commit4da89a180facdecf168cbe0ddbc6bfbdd9f6e696 (patch)
tree6ca1cabca774e0b9e29a500cc78dfcc979fa9bc6 /src/test
parentaddb4da686a97da46159f0123cb6cdc2ce3d7fdb (diff)
parent7d9a0e5da9a9a4afc3082bff06cf8618da4dabcb (diff)
downloadrust-4da89a180facdecf168cbe0ddbc6bfbdd9f6e696.tar.gz
rust-4da89a180facdecf168cbe0ddbc6bfbdd9f6e696.zip
Auto merge of #89262 - Manishearth:rollup-vtkbetm, r=Manishearth
Rollup of 7 pull requests

Successful merges:

 - #88895 (rustdoc: Cleanup `clean` part 2)
 - #88973 (Expose the std_detect env_override feature)
 - #89010 (Add some intra doc links)
 - #89198 (rustdoc: Don't show hidden trait methods)
 - #89216 (Consistent big O notation)
 - #89224 (Change the order of imports suggestions)
 - #89256 (Fix typo in release notes)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'src/test')
-rw-r--r--src/test/rustdoc/hidden-trait-methods-with-document-hidden-items.rs31
-rw-r--r--src/test/rustdoc/hidden-trait-methods.rs29
2 files changed, 60 insertions, 0 deletions
diff --git a/src/test/rustdoc/hidden-trait-methods-with-document-hidden-items.rs b/src/test/rustdoc/hidden-trait-methods-with-document-hidden-items.rs
new file mode 100644
index 00000000000..95b3e9b6523
--- /dev/null
+++ b/src/test/rustdoc/hidden-trait-methods-with-document-hidden-items.rs
@@ -0,0 +1,31 @@
+// compile-flags: -Z unstable-options --document-hidden-items
+
+// test for trait methods with `doc(hidden)` with `--document-hidden-items` passed.
+#![crate_name = "foo"]
+
+// @has foo/trait.Trait.html
+// @has - '//*[@id="associatedtype.Foo"]' 'type Foo'
+// @has - '//*[@id="associatedtype.Bar"]' 'type Bar'
+// @has - '//*[@id="tymethod.f"]' 'fn f()'
+// @has - '//*[@id="tymethod.g"]' 'fn g()'
+pub trait Trait {
+    #[doc(hidden)]
+    type Foo;
+    type Bar;
+    #[doc(hidden)]
+    fn f();
+    fn g();
+}
+
+// @has foo/struct.S.html
+// @has - '//*[@id="associatedtype.Foo"]' 'type Foo'
+// @has - '//*[@id="associatedtype.Bar"]' 'type Bar'
+// @has - '//*[@id="method.f"]' 'fn f()'
+// @has - '//*[@id="method.g"]' 'fn g()'
+pub struct S;
+impl Trait for S {
+    type Foo = ();
+    type Bar = ();
+    fn f() {}
+    fn g() {}
+}
diff --git a/src/test/rustdoc/hidden-trait-methods.rs b/src/test/rustdoc/hidden-trait-methods.rs
new file mode 100644
index 00000000000..e924ba7d0ac
--- /dev/null
+++ b/src/test/rustdoc/hidden-trait-methods.rs
@@ -0,0 +1,29 @@
+// test for trait methods with `doc(hidden)`.
+#![crate_name = "foo"]
+
+// @has foo/trait.Trait.html
+// @!has - '//*[@id="associatedtype.Foo"]' 'type Foo'
+// @has - '//*[@id="associatedtype.Bar"]' 'type Bar'
+// @!has - '//*[@id="tymethod.f"]' 'fn f()'
+// @has - '//*[@id="tymethod.g"]' 'fn g()'
+pub trait Trait {
+    #[doc(hidden)]
+    type Foo;
+    type Bar;
+    #[doc(hidden)]
+    fn f();
+    fn g();
+}
+
+// @has foo/struct.S.html
+// @!has - '//*[@id="associatedtype.Foo"]' 'type Foo'
+// @has - '//*[@id="associatedtype.Bar"]' 'type Bar'
+// @!has - '//*[@id="method.f"]' 'fn f()'
+// @has - '//*[@id="method.g"]' 'fn g()'
+pub struct S;
+impl Trait for S {
+    type Foo = ();
+    type Bar = ();
+    fn f() {}
+    fn g() {}
+}