File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed
src/librustdoc/html/render
tests/run-make/rustdoc-remapped-paths Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ use rustc_hir::def_id::{DefIdMap, LOCAL_CRATE};
1414use rustc_middle:: ty:: TyCtxt ;
1515use rustc_session:: Session ;
1616use rustc_span:: edition:: Edition ;
17- use rustc_span:: { BytePos , FileName , Symbol } ;
17+ use rustc_span:: { BytePos , FileName , RemapPathScopeComponents , Symbol } ;
1818use tracing:: info;
1919
2020use super :: print_item:: { full_path, print_item, print_item_path} ;
@@ -365,7 +365,7 @@ impl<'tcx> Context<'tcx> {
365365
366366 // We can safely ignore synthetic `SourceFile`s.
367367 let file = match span. filename ( self . sess ( ) ) {
368- FileName :: Real ( ref path) => path. local_path ( ) ? . to_path_buf ( ) ,
368+ FileName :: Real ( ref path) => path. path ( RemapPathScopeComponents :: MACRO ) . to_path_buf ( ) ,
369369 _ => return None ,
370370 } ;
371371 let file = & file;
@@ -499,7 +499,7 @@ impl<'tcx> Context<'tcx> {
499499 } = options;
500500
501501 let src_root = match krate. src ( tcx) {
502- FileName :: Real ( ref p) => match p. local_path ( ) . map ( |p| p . parent ( ) ) . flatten ( ) {
502+ FileName :: Real ( ref p) => match p. path ( RemapPathScopeComponents :: MACRO ) . parent ( ) {
503503 Some ( p) => p. to_path_buf ( ) ,
504504 None => PathBuf :: new ( ) ,
505505 } ,
Original file line number Diff line number Diff line change @@ -18,7 +18,6 @@ fn main() {
1818
1919 // Let's verify that "Source" links for dep exist in `MyStruct` page
2020 let reexport_MyStruct_content = rfs:: read_to_string ( "doc/reexport/struct.MyStruct.html" ) ;
21- // FIXME: Those assert don't work!
2221 assert ! ( reexport_MyStruct_content. contains( r#""../src/dep/dep.rs.html#1">Source"# ) ) ;
2322 assert ! ( reexport_MyStruct_content. contains( r#""../src/dep/dep.rs.html#6">Source"# ) ) ;
2423}
You can’t perform that action at this time.
0 commit comments