diff options
| author | bors <bors@rust-lang.org> | 2020-06-23 17:30:54 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-06-23 17:30:54 +0000 |
| commit | ff5b446d2fdbd898bc97a751f2f72858de185cf1 (patch) | |
| tree | c81005a592a81c4d452eaf66dd9b19950cafa116 /src/test | |
| parent | 1557fb031b272b4c5bfcc7de5df7eddc7b36a584 (diff) | |
| parent | 478750c1db7dee93bc26bd9b84197f9f291492bb (diff) | |
| download | rust-ff5b446d2fdbd898bc97a751f2f72858de185cf1.tar.gz rust-ff5b446d2fdbd898bc97a751f2f72858de185cf1.zip | |
Auto merge of #73644 - ollie27:rustdoc_alias_filter, r=GuillaumeGomez
rustdoc: Fix doc aliases with crate filtering Fix a crash when searching for an alias contained in the currently selected filter crate. Also remove alias search results for crates that should be filtered out. The test suite needed to be fixed to actually take into account the crate filtering and check that there are no results when none are expected. Needs to be backported to beta to fix the `std` docs. Fixes #73620 r? @GuillaumeGomez
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/rustdoc-js/doc-alias-filter-out.js | 9 | ||||
| -rw-r--r-- | src/test/rustdoc-js/doc-alias-filter-out.rs | 4 | ||||
| -rw-r--r-- | src/test/rustdoc-js/doc-alias-filter.js | 17 | ||||
| -rw-r--r-- | src/test/rustdoc-js/doc-alias-filter.rs | 7 |
4 files changed, 37 insertions, 0 deletions
diff --git a/src/test/rustdoc-js/doc-alias-filter-out.js b/src/test/rustdoc-js/doc-alias-filter-out.js new file mode 100644 index 00000000000..46a089d06eb --- /dev/null +++ b/src/test/rustdoc-js/doc-alias-filter-out.js @@ -0,0 +1,9 @@ +// exact-check + +const QUERY = 'true'; + +const FILTER_CRATE = 'some_other_crate'; + +const EXPECTED = { + 'others': [], +}; diff --git a/src/test/rustdoc-js/doc-alias-filter-out.rs b/src/test/rustdoc-js/doc-alias-filter-out.rs new file mode 100644 index 00000000000..815e8cedd16 --- /dev/null +++ b/src/test/rustdoc-js/doc-alias-filter-out.rs @@ -0,0 +1,4 @@ +#![feature(doc_alias)] + +#[doc(alias = "true")] +pub struct Foo; diff --git a/src/test/rustdoc-js/doc-alias-filter.js b/src/test/rustdoc-js/doc-alias-filter.js new file mode 100644 index 00000000000..4b1e2e29704 --- /dev/null +++ b/src/test/rustdoc-js/doc-alias-filter.js @@ -0,0 +1,17 @@ +// exact-check + +const QUERY = 'true'; + +const FILTER_CRATE = 'doc_alias_filter'; + +const EXPECTED = { + 'others': [ + { + 'path': 'doc_alias_filter', + 'name': 'Foo', + 'alias': 'true', + 'href': '../doc_alias_filter/struct.Foo.html', + 'is_alias': true + }, + ], +}; diff --git a/src/test/rustdoc-js/doc-alias-filter.rs b/src/test/rustdoc-js/doc-alias-filter.rs new file mode 100644 index 00000000000..8887f8c2b01 --- /dev/null +++ b/src/test/rustdoc-js/doc-alias-filter.rs @@ -0,0 +1,7 @@ +#![feature(doc_alias)] + +#[doc(alias = "true")] +pub struct Foo; + +#[doc(alias = "false")] +pub struct Bar; |
