File tree Expand file tree Collapse file tree 4 files changed +27
-1
lines changed
src/librustdoc/html/render Expand file tree Collapse file tree 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(
423423 }
424424 Some ( path)
425425 } ) ;
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 ] ) ) ;
426434 }
427435
428436 // Omit the parent path if it is same to that of the prior item.
Original file line number Diff line number Diff line change 44const EXPECTED = {
55 'query' : 'OsString -> String' ,
66 'others' : [
7- { 'path' : 'std::ffi::os_str:: OsString' , 'name' : 'into_string' } ,
7+ { 'path' : 'std::ffi::OsString' , 'name' : 'into_string' } ,
88 ]
99} ;
Original file line number Diff line number Diff line change @@ -14,4 +14,13 @@ const EXPECTED = [
1414 { 'path' : 'reexport' , 'name' : 'AnotherOne' } ,
1515 ] ,
1616 } ,
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+ } ,
1726] ;
Original file line number Diff line number Diff line change 22// This is a DWIM case, since renaming the export probably means the intent is also different.
33// For the de-duplication case of exactly the same name, see reexport-dedup
44
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+
514pub mod fmt {
615 pub struct Subscriber ;
716}
You can’t perform that action at this time.
0 commit comments