-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Showing
6 changed files
with
55 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// exact-check | ||
|
||
const QUERY = 'true'; | ||
|
||
const FILTER_CRATE = 'some_other_crate'; | ||
|
||
const EXPECTED = { | ||
'others': [], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#![feature(doc_alias)] | ||
|
||
#[doc(alias = "true")] | ||
pub struct Foo; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
}, | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#![feature(doc_alias)] | ||
|
||
#[doc(alias = "true")] | ||
pub struct Foo; | ||
|
||
#[doc(alias = "false")] | ||
pub struct Bar; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters