File tree Expand file tree Collapse file tree 3 files changed +54
-0
lines changed
src/librustdoc/html/static/js Expand file tree Collapse file tree 3 files changed +54
-0
lines changed Original file line number Diff line number Diff line change @@ -3340,6 +3340,13 @@ class DocSearch {
3340
3340
return a - b ;
3341
3341
}
3342
3342
3343
+ // sort doc alias items later
3344
+ a = Number ( aaa . item . is_alias === true ) ;
3345
+ b = Number ( bbb . item . is_alias === true ) ;
3346
+ if ( a !== b ) {
3347
+ return a - b ;
3348
+ }
3349
+
3343
3350
// sort by item name (lexicographically larger goes later)
3344
3351
let aw = aaa . word ;
3345
3352
let bw = bbb . word ;
Original file line number Diff line number Diff line change
1
+ // exact-check
2
+
3
+ // Checking that doc aliases are always listed after items with equivalent matching.
4
+
5
+ const EXPECTED = [
6
+ {
7
+ 'query' : 'coo' ,
8
+ 'others' : [
9
+ {
10
+ 'path' : 'doc_alias_after_other_items' ,
11
+ 'name' : 'Foo' ,
12
+ 'href' : '../doc_alias_after_other_items/struct.Foo.html' ,
13
+ } ,
14
+ {
15
+ 'path' : 'doc_alias_after_other_items' ,
16
+ 'name' : 'bar' ,
17
+ 'alias' : 'Boo' ,
18
+ 'is_alias' : true
19
+ } ,
20
+ ] ,
21
+ } ,
22
+ {
23
+ 'query' : '"confiture"' ,
24
+ 'others' : [
25
+ {
26
+ 'path' : 'doc_alias_after_other_items' ,
27
+ 'name' : 'Confiture' ,
28
+ 'href' : '../doc_alias_after_other_items/struct.Confiture.html' ,
29
+ } ,
30
+ {
31
+ 'path' : 'doc_alias_after_other_items' ,
32
+ 'name' : 'this_is_a_long_name' ,
33
+ 'alias' : 'Confiture' ,
34
+ 'is_alias' : true
35
+ } ,
36
+ ] ,
37
+ } ,
38
+ ] ;
Original file line number Diff line number Diff line change
1
+ pub struct Foo ;
2
+
3
+ #[ doc( alias = "Boo" ) ]
4
+ pub fn bar ( ) { }
5
+
6
+ pub struct Confiture ;
7
+
8
+ #[ doc( alias = "Confiture" ) ]
9
+ pub fn this_is_a_long_name ( ) { }
You can’t perform that action at this time.
0 commit comments