File tree 4 files changed +27
-1
lines changed
src/librustdoc/html/render
4 files changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -423,6 +423,14 @@ pub(crate) fn build_index(
423
423
}
424
424
Some ( path)
425
425
} ) ;
426
+ } else if let Some ( parent_idx) = item. parent_idx {
427
+ let i = <isize as TryInto < usize > >:: try_into ( parent_idx) . unwrap ( ) ;
428
+ item. path = {
429
+ let p = & crate_paths[ i] . 1 ;
430
+ join_with_double_colon ( & p[ ..p. len ( ) - 1 ] )
431
+ } ;
432
+ item. exact_path =
433
+ crate_paths[ i] . 2 . as_ref ( ) . map ( |xp| join_with_double_colon ( & xp[ ..xp. len ( ) - 1 ] ) ) ;
426
434
}
427
435
428
436
// Omit the parent path if it is same to that of the prior item.
Original file line number Diff line number Diff line change 4
4
const EXPECTED = {
5
5
'query' : 'OsString -> String' ,
6
6
'others' : [
7
- { 'path' : 'std::ffi::os_str:: OsString' , 'name' : 'into_string' } ,
7
+ { 'path' : 'std::ffi::OsString' , 'name' : 'into_string' } ,
8
8
]
9
9
} ;
Original file line number Diff line number Diff line change @@ -14,4 +14,13 @@ const EXPECTED = [
14
14
{ 'path' : 'reexport' , 'name' : 'AnotherOne' } ,
15
15
] ,
16
16
} ,
17
+ {
18
+ 'query' : 'fn:Equivalent::equivalent' ,
19
+ 'others' : [
20
+ // These results must never contain `reexport::equivalent::NotEquivalent`,
21
+ // since that path does not exist.
22
+ { 'path' : 'equivalent::Equivalent' , 'name' : 'equivalent' } ,
23
+ { 'path' : 'reexport::NotEquivalent' , 'name' : 'equivalent' } ,
24
+ ] ,
25
+ } ,
17
26
] ;
Original file line number Diff line number Diff line change 2
2
// This is a DWIM case, since renaming the export probably means the intent is also different.
3
3
// For the de-duplication case of exactly the same name, see reexport-dedup
4
4
5
+ //@ aux-crate:equivalent=equivalent.rs
6
+ //@ compile-flags: --extern equivalent
7
+ //@ aux-build:equivalent.rs
8
+ //@ build-aux-docs
9
+ #[ doc( inline) ]
10
+ pub extern crate equivalent;
11
+ #[ doc( inline) ]
12
+ pub use equivalent:: Equivalent as NotEquivalent ;
13
+
5
14
pub mod fmt {
6
15
pub struct Subscriber ;
7
16
}
You can’t perform that action at this time.
0 commit comments