about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-04-22 02:18:41 +0000
committerbors <bors@rust-lang.org>2018-04-22 02:18:41 +0000
commitbbdd1cf744121ea3697b1dfb6426b0dc714e4f6b (patch)
tree3843e10ed381f0964fe54612b73d342f30eebda8 /src/test
parentd5616e1f18abb46071581d096994a0ff6581e3f9 (diff)
parent1ed3e77b8a254fd9cbf8f922d1f910d375a9d1e4 (diff)
downloadrust-bbdd1cf744121ea3697b1dfb6426b0dc714e4f6b.tar.gz
rust-bbdd1cf744121ea3697b1dfb6426b0dc714e4f6b.zip
Auto merge of #49757 - GuillaumeGomez:never-search, r=QuietMisdreavus
Add specific never search

Fixes #49529.

r? @QuietMisdreavus
Diffstat (limited to 'src/test')
-rw-r--r--src/test/rustdoc-js/alias-1.js17
-rw-r--r--src/test/rustdoc-js/alias-2.js18
-rw-r--r--src/test/rustdoc-js/alias-3.js17
-rw-r--r--src/test/rustdoc-js/alias.js19
-rw-r--r--src/test/rustdoc-js/never.js17
-rw-r--r--src/test/ui/feature-gate-doc_alias.rs14
-rw-r--r--src/test/ui/feature-gate-doc_alias.stderr11
7 files changed, 113 insertions, 0 deletions
diff --git a/src/test/rustdoc-js/alias-1.js b/src/test/rustdoc-js/alias-1.js
new file mode 100644
index 00000000000..496bd559b87
--- /dev/null
+++ b/src/test/rustdoc-js/alias-1.js
@@ -0,0 +1,17 @@
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+const QUERY = '&';
+
+const EXPECTED = {
+    'others': [
+        { 'path': 'std', 'name': 'reference' },
+    ],
+};
diff --git a/src/test/rustdoc-js/alias-2.js b/src/test/rustdoc-js/alias-2.js
new file mode 100644
index 00000000000..f31786df67c
--- /dev/null
+++ b/src/test/rustdoc-js/alias-2.js
@@ -0,0 +1,18 @@
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+const QUERY = '+';
+
+const EXPECTED = {
+    'others': [
+        { 'path': 'std::ops::AddAssign', 'name': 'AddAssign' },
+        { 'path': 'std::ops::Add', 'name': 'Add' },
+    ],
+};
diff --git a/src/test/rustdoc-js/alias-3.js b/src/test/rustdoc-js/alias-3.js
new file mode 100644
index 00000000000..d9e1ca5f760
--- /dev/null
+++ b/src/test/rustdoc-js/alias-3.js
@@ -0,0 +1,17 @@
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+const QUERY = '!';
+
+const EXPECTED = {
+    'others': [
+        { 'path': 'std', 'name': 'never' },
+    ],
+};
diff --git a/src/test/rustdoc-js/alias.js b/src/test/rustdoc-js/alias.js
new file mode 100644
index 00000000000..a0500f24c17
--- /dev/null
+++ b/src/test/rustdoc-js/alias.js
@@ -0,0 +1,19 @@
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+const QUERY = '[';
+
+const EXPECTED = {
+    'others': [
+        { 'path': 'std', 'name': 'slice' },
+        { 'path': 'std::ops::IndexMut', 'name': 'IndexMut' },
+        { 'path': 'std::ops::Index', 'name': 'Index' },
+    ],
+};
diff --git a/src/test/rustdoc-js/never.js b/src/test/rustdoc-js/never.js
new file mode 100644
index 00000000000..d9e1ca5f760
--- /dev/null
+++ b/src/test/rustdoc-js/never.js
@@ -0,0 +1,17 @@
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+const QUERY = '!';
+
+const EXPECTED = {
+    'others': [
+        { 'path': 'std', 'name': 'never' },
+    ],
+};
diff --git a/src/test/ui/feature-gate-doc_alias.rs b/src/test/ui/feature-gate-doc_alias.rs
new file mode 100644
index 00000000000..1503dfe81fb
--- /dev/null
+++ b/src/test/ui/feature-gate-doc_alias.rs
@@ -0,0 +1,14 @@
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#[doc(alias = "foo")] //~ ERROR: #[doc(alias = "...")] is experimental
+pub struct Foo;
+
+fn main() {}
diff --git a/src/test/ui/feature-gate-doc_alias.stderr b/src/test/ui/feature-gate-doc_alias.stderr
new file mode 100644
index 00000000000..a987e03c0aa
--- /dev/null
+++ b/src/test/ui/feature-gate-doc_alias.stderr
@@ -0,0 +1,11 @@
+error[E0658]: #[doc(alias = "...")] is experimental (see issue #50146)
+  --> $DIR/feature-gate-doc_alias.rs:11:1
+   |
+LL | #[doc(alias = "foo")] //~ ERROR: #[doc(alias = "...")] is experimental
+   | ^^^^^^^^^^^^^^^^^^^^^
+   |
+   = help: add #![feature(doc_alias)] to the crate attributes to enable
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0658`.