-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rustdoc: implement bag semantics for function parameter search
This tweak to the function signature search engine makes things so that, if a type is repeated in the search query, it'll only match if the function actually includes it that many times.
- Loading branch information
Showing
3 changed files
with
94 additions
and
26 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,20 @@ | ||
// exact-check | ||
|
||
const QUERY = [ | ||
'P', | ||
'P, P', | ||
]; | ||
|
||
const EXPECTED = [ | ||
{ | ||
'in_args': [ | ||
{ 'path': 'search_bag_semantics', 'name': 'alacazam' }, | ||
{ 'path': 'search_bag_semantics', 'name': 'abracadabra' }, | ||
], | ||
}, | ||
{ | ||
'others': [ | ||
{ 'path': 'search_bag_semantics', 'name': 'abracadabra' }, | ||
], | ||
}, | ||
]; |
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 @@ | ||
pub struct P; | ||
|
||
pub fn abracadabra(a: P, b: P) {} | ||
pub fn alacazam(a: P) {} |