rustdoc-search: single result for items with multiple paths
This change uses the same "exact" paths as trait implementors and type alias inlining to track items with multiple reachable paths. This way, if you search for `vec`, you get only the `std` exports of it, and not the one from `alloc`. It still includes all the items in the search index so that you can search for them by all available paths. For example, try `core::option` and `std::option`, and notice that the results page doesn't show duplicates, but still shows all the items in their respective crates.
This commit is contained in:
parent
ab5bda1aa7
commit
f36c5af359
13 changed files with 313 additions and 25 deletions
|
@ -3,17 +3,47 @@ const EXPECTED = [
|
|||
'query': 'Vec::new',
|
||||
'others': [
|
||||
{ 'path': 'std::vec::Vec', 'name': 'new' },
|
||||
{ 'path': 'alloc::vec::Vec', 'name': 'new' },
|
||||
{ 'path': 'std::vec::Vec', 'name': 'new_in' },
|
||||
{ 'path': 'alloc::vec::Vec', 'name': 'new_in' },
|
||||
],
|
||||
},
|
||||
{
|
||||
'query': 'prelude::vec',
|
||||
'others': [
|
||||
{ 'path': 'std::prelude::rust_2024', 'name': 'Vec' },
|
||||
],
|
||||
},
|
||||
{
|
||||
'query': 'Vec new',
|
||||
'others': [
|
||||
{ 'path': 'std::vec::Vec', 'name': 'new' },
|
||||
{ 'path': 'alloc::vec::Vec', 'name': 'new' },
|
||||
{ 'path': 'std::vec::Vec', 'name': 'new_in' },
|
||||
],
|
||||
},
|
||||
{
|
||||
'query': 'std::Vec::new',
|
||||
'others': [
|
||||
{ 'path': 'std::vec::Vec', 'name': 'new' },
|
||||
{ 'path': 'std::vec::Vec', 'name': 'new_in' },
|
||||
],
|
||||
},
|
||||
{
|
||||
'query': 'std Vec new',
|
||||
'others': [
|
||||
{ 'path': 'std::vec::Vec', 'name': 'new' },
|
||||
{ 'path': 'std::vec::Vec', 'name': 'new_in' },
|
||||
],
|
||||
},
|
||||
{
|
||||
'query': 'alloc::Vec::new',
|
||||
'others': [
|
||||
{ 'path': 'alloc::vec::Vec', 'name': 'new' },
|
||||
{ 'path': 'alloc::vec::Vec', 'name': 'new_in' },
|
||||
],
|
||||
},
|
||||
{
|
||||
'query': 'alloc Vec new',
|
||||
'others': [
|
||||
{ 'path': 'alloc::vec::Vec', 'name': 'new' },
|
||||
{ 'path': 'alloc::vec::Vec', 'name': 'new_in' },
|
||||
],
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue