-
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.
rustdoc-search: fix order-independence bug
- Loading branch information
Showing
4 changed files
with
207 additions
and
72 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
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,91 @@ | ||
// ignore-order | ||
// exact-check | ||
|
||
// Make sure that results are order-agnostic, even when there's search items that only differ | ||
// by generics. | ||
|
||
const EXPECTED = [ | ||
{ | ||
'query': 'Wrap', | ||
'in_args': [ | ||
{ 'path': 'generics_match_ambiguity', 'name': 'bar' }, | ||
{ 'path': 'generics_match_ambiguity', 'name': 'foo' }, | ||
], | ||
}, | ||
{ | ||
'query': 'Wrap<i32>', | ||
'in_args': [ | ||
{ 'path': 'generics_match_ambiguity', 'name': 'bar' }, | ||
{ 'path': 'generics_match_ambiguity', 'name': 'foo' }, | ||
], | ||
}, | ||
{ | ||
'query': 'Wrap<i32>, Wrap<i32, u32>', | ||
'others': [ | ||
{ 'path': 'generics_match_ambiguity', 'name': 'bar' }, | ||
{ 'path': 'generics_match_ambiguity', 'name': 'foo' }, | ||
], | ||
}, | ||
{ | ||
'query': 'Wrap<i32, u32>, Wrap<i32>', | ||
'others': [ | ||
{ 'path': 'generics_match_ambiguity', 'name': 'bar' }, | ||
{ 'path': 'generics_match_ambiguity', 'name': 'foo' }, | ||
], | ||
}, | ||
{ | ||
'query': 'W3<i32>, W3<i32, u32>', | ||
'others': [ | ||
{ 'path': 'generics_match_ambiguity', 'name': 'baaa' }, | ||
{ 'path': 'generics_match_ambiguity', 'name': 'baab' }, | ||
{ 'path': 'generics_match_ambiguity', 'name': 'baac' }, | ||
{ 'path': 'generics_match_ambiguity', 'name': 'baad' }, | ||
{ 'path': 'generics_match_ambiguity', 'name': 'baae' }, | ||
{ 'path': 'generics_match_ambiguity', 'name': 'baaf' }, | ||
{ 'path': 'generics_match_ambiguity', 'name': 'baag' }, | ||
{ 'path': 'generics_match_ambiguity', 'name': 'baah' }, | ||
], | ||
}, | ||
{ | ||
'query': 'W3<i32, u32>, W3<i32>', | ||
'others': [ | ||
{ 'path': 'generics_match_ambiguity', 'name': 'baaa' }, | ||
{ 'path': 'generics_match_ambiguity', 'name': 'baab' }, | ||
{ 'path': 'generics_match_ambiguity', 'name': 'baac' }, | ||
{ 'path': 'generics_match_ambiguity', 'name': 'baad' }, | ||
{ 'path': 'generics_match_ambiguity', 'name': 'baae' }, | ||
{ 'path': 'generics_match_ambiguity', 'name': 'baaf' }, | ||
{ 'path': 'generics_match_ambiguity', 'name': 'baag' }, | ||
{ 'path': 'generics_match_ambiguity', 'name': 'baah' }, | ||
], | ||
}, | ||
{ | ||
'query': 'W2<i32>, W2<i32, u32>', | ||
'others': [ | ||
{ 'path': 'generics_match_ambiguity', 'name': 'baag' }, | ||
{ 'path': 'generics_match_ambiguity', 'name': 'baah' }, | ||
], | ||
}, | ||
{ | ||
'query': 'W2<i32, u32>, W2<i32>', | ||
'others': [ | ||
{ 'path': 'generics_match_ambiguity', 'name': 'baag' }, | ||
{ 'path': 'generics_match_ambiguity', 'name': 'baah' }, | ||
], | ||
}, | ||
{ | ||
'query': 'W2<i32>, W3<i32, u32>', | ||
'others': [ | ||
{ 'path': 'generics_match_ambiguity', 'name': 'baac' }, | ||
{ 'path': 'generics_match_ambiguity', 'name': 'baaf' }, | ||
{ 'path': 'generics_match_ambiguity', 'name': 'baag' }, | ||
], | ||
}, | ||
{ | ||
'query': 'W2<i32>, W2<i32>', | ||
'others': [ | ||
{ 'path': 'generics_match_ambiguity', 'name': 'baag' }, | ||
{ 'path': 'generics_match_ambiguity', 'name': 'baah' }, | ||
], | ||
}, | ||
]; |
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 @@ | ||
pub struct Wrap<T, U = ()>(pub T, pub U); | ||
|
||
pub fn foo(a: Wrap<i32>, b: Wrap<i32, u32>) {} | ||
pub fn bar(a: Wrap<i32, u32>, b: Wrap<i32>) {} | ||
|
||
pub struct W2<T>(pub T); | ||
pub struct W3<T, U = ()>(pub T, pub U); | ||
|
||
pub fn baaa(a: W3<i32>, b: W3<i32, u32>) {} | ||
pub fn baab(a: W3<i32, u32>, b: W3<i32>) {} | ||
pub fn baac(a: W2<W3<i32>>, b: W3<i32, u32>) {} | ||
pub fn baad(a: W2<W3<i32, u32>>, b: W3<i32>) {} | ||
pub fn baae(a: W3<i32>, b: W2<W3<i32, u32>>) {} | ||
pub fn baaf(a: W3<i32, u32>, b: W2<W3<i32>>) {} | ||
pub fn baag(a: W2<W3<i32>>, b: W2<W3<i32, u32>>) {} | ||
pub fn baah(a: W2<W3<i32, u32>>, b: W2<W3<i32>>) {} | ||
// |