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 @@ -3365,6 +3365,13 @@ class DocSearch {
33653365                    return  a  -  b ; 
33663366                } 
33673367
3368+                 // sort doc alias items later 
3369+                 a  =  Number ( aaa . item . is_alias  ===  true ) ; 
3370+                 b  =  Number ( bbb . item . is_alias  ===  true ) ; 
3371+                 if  ( a  !==  b )  { 
3372+                     return  a  -  b ; 
3373+                 } 
3374+ 
33683375                // sort by item name (lexicographically larger goes later) 
33693376                let  aw  =  aaa . word ; 
33703377                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