From 654cb84852a0485146f95bbebe14ac75b7ee111a Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Sat, 7 Apr 2018 14:04:03 +0200 Subject: Add specific never search --- src/test/rustdoc-js/never.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/test/rustdoc-js/never.js (limited to 'src/test') 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 or the MIT license +// , 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' }, + ], +}; -- cgit 1.4.1-3-g733a5 From d5eade2b941e349be598286b6ca6954d18ac4323 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Thu, 19 Apr 2018 20:14:47 +0200 Subject: Add alias tests --- src/test/rustdoc-js/alias-1.js | 17 +++++++++++++++++ src/test/rustdoc-js/alias-2.js | 18 ++++++++++++++++++ src/test/rustdoc-js/alias-3.js | 17 +++++++++++++++++ src/test/rustdoc-js/alias.js | 19 +++++++++++++++++++ src/test/ui/feature-gate-doc_alias.rs | 14 ++++++++++++++ src/test/ui/feature-gate-doc_alias.stderr | 11 +++++++++++ 6 files changed, 96 insertions(+) create mode 100644 src/test/rustdoc-js/alias-1.js create mode 100644 src/test/rustdoc-js/alias-2.js create mode 100644 src/test/rustdoc-js/alias-3.js create mode 100644 src/test/rustdoc-js/alias.js create mode 100644 src/test/ui/feature-gate-doc_alias.rs create mode 100644 src/test/ui/feature-gate-doc_alias.stderr (limited to 'src/test') 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 or the MIT license +// , 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 or the MIT license +// , 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 or the MIT license +// , 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 or the MIT license +// , 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/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 or the MIT license +// , 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..693dc0a4000 --- /dev/null +++ b/src/test/ui/feature-gate-doc_alias.stderr @@ -0,0 +1,11 @@ +error[E0658]: #[doc(alias = "...")] is experimental + --> $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`. -- cgit 1.4.1-3-g733a5 From 48ab422be4cbc3ab4eb5d3456c2b92ccfe9d7f8d Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Sat, 21 Apr 2018 22:33:11 +0200 Subject: Add tracking issue number for doc alias feature --- src/libsyntax/feature_gate.rs | 2 +- src/test/ui/feature-gate-doc_alias.stderr | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/test') diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index 3f0a402c213..5f051e2f193 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -462,7 +462,7 @@ declare_features! ( (active, proc_macro_non_items, "1.27.0", None, None), // #[doc(alias = "...")] - (active, doc_alias, "1.27.0", None, None), + (active, doc_alias, "1.27.0", Some(50146), None), ); declare_features! ( diff --git a/src/test/ui/feature-gate-doc_alias.stderr b/src/test/ui/feature-gate-doc_alias.stderr index 693dc0a4000..a987e03c0aa 100644 --- a/src/test/ui/feature-gate-doc_alias.stderr +++ b/src/test/ui/feature-gate-doc_alias.stderr @@ -1,4 +1,4 @@ -error[E0658]: #[doc(alias = "...")] is experimental +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 -- cgit 1.4.1-3-g733a5