@@ -320,7 +320,7 @@ impl SourceMap {
320
320
// Note that filename may not be a valid path, eg it may be `<anon>` etc,
321
321
// but this is okay because the directory determined by `path.pop()` will
322
322
// be empty, so the working directory will be used.
323
- let ( filename, _ ) = self . path_mapping . map_filename_prefix ( & filename) ;
323
+ let filename = self . path_mapping . map_filename_prefix ( & filename) ;
324
324
325
325
let file_id = StableSourceFileId :: new_from_name ( & filename, LOCAL_CRATE ) ;
326
326
match self . source_file_by_stable_id ( file_id) {
@@ -995,7 +995,7 @@ impl SourceMap {
995
995
996
996
pub fn get_source_file ( & self , filename : & FileName ) -> Option < Lrc < SourceFile > > {
997
997
// Remap filename before lookup
998
- let filename = self . path_mapping ( ) . map_filename_prefix ( filename) . 0 ;
998
+ let filename = self . path_mapping ( ) . map_filename_prefix ( filename) ;
999
999
for sf in self . files . borrow ( ) . source_files . iter ( ) {
1000
1000
if filename == sf. name {
1001
1001
return Some ( sf. clone ( ) ) ;
@@ -1150,7 +1150,7 @@ impl FilePathMapping {
1150
1150
/// Given a `file`, map it using the `remap-path-prefix` options for the current [`Session`].
1151
1151
///
1152
1152
/// Public for use in rustc_metadata::decoder
1153
- pub fn map_filename_prefix ( & self , file : & FileName ) -> ( FileName , bool ) {
1153
+ pub fn map_filename_prefix ( & self , file : & FileName ) -> FileName {
1154
1154
match file {
1155
1155
FileName :: Real ( realfile @ RealFileName :: LocalPath ( local_path) ) => {
1156
1156
let ( mapped_path, mapped) = self . map_prefix ( local_path) ;
@@ -1162,16 +1162,16 @@ impl FilePathMapping {
1162
1162
} else {
1163
1163
realfile. clone ( )
1164
1164
} ;
1165
- ( FileName :: Real ( realfile) , mapped )
1165
+ FileName :: Real ( realfile)
1166
1166
}
1167
1167
existing @ FileName :: Real ( RealFileName :: Remapped { .. } ) => {
1168
1168
// This can happen if we are remapping the name of file that was loaded in a
1169
1169
// different Session, and inconsistent `remap-path-prefix` flags were passed between
1170
1170
// sessions. It's unclear what to do here. For now, respect the original flag, not
1171
1171
// the flag from the current session.
1172
- ( existing. clone ( ) , false )
1172
+ existing. clone ( )
1173
1173
}
1174
- other => ( other. clone ( ) , false ) ,
1174
+ other => other. clone ( ) ,
1175
1175
}
1176
1176
}
1177
1177
0 commit comments