-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
rustdoc: don't ignore path distance for doc aliases #147701
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
28724dc
7a62743
0707281
3ba87c4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| // exact-check | ||
|
|
||
| // consider path distance for doc aliases | ||
| // regression test for <https://github.com/rust-lang/rust/issues/146214> | ||
|
|
||
| const EXPECTED = [ | ||
| { | ||
| 'query': 'Foo::zzz', | ||
| 'others': [ | ||
| { 'path': 'alias_path_distance::Foo', 'name': 'baz' }, | ||
| ], | ||
| }, | ||
| { | ||
| 'query': '"Foo::zzz"', | ||
| 'others': [ | ||
| { 'path': 'alias_path_distance::Foo', 'name': 'baz' }, | ||
| ], | ||
| }, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you add a fuzzy query test like
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added, tho used |
||
| ]; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| #![crate_name = "alias_path_distance"] | ||
|
|
||
| pub struct Foo; | ||
| pub struct Bar; | ||
|
|
||
| impl Foo { | ||
| #[doc(alias = "zzz")] | ||
| pub fn baz() {} | ||
| } | ||
|
|
||
| impl Bar { | ||
| #[doc(alias = "zzz")] | ||
| pub fn baz() {} | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| // rank doc aliases lower than exact matches | ||
| // regression test for <https://github.com/rust-lang/rust/issues/140968> | ||
|
|
||
| const EXPECTED = { | ||
| 'query': 'Foo', | ||
| 'others': [ | ||
| { 'path': 'alias_rank_lower', 'name': 'Foo' }, | ||
| { 'path': 'alias_rank_lower', 'name': 'Bar' }, | ||
| ], | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| #![crate_name = "alias_rank_lower"] | ||
|
|
||
| pub struct Foo; | ||
|
|
||
| #[doc(alias = "Foo")] | ||
| pub struct Bar; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you meant "a space is both an alias...", but not sure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe either is grammatically correct.