@@ -66,7 +66,8 @@ impl Emitter for SilentOnIgnoredFilesEmitter {
66
66
}
67
67
if let Some ( primary_span) = & db. span . primary_span ( ) {
68
68
let file_name = self . source_map . span_to_filename ( * primary_span) ;
69
- if let rustc_span:: FileName :: Real ( ref path) = file_name {
69
+ if let rustc_span:: FileName :: Real ( rustc_span:: RealFileName :: Named ( ref path) ) = file_name
70
+ {
70
71
if self
71
72
. ignore_path_set
72
73
. is_match ( & FileName :: Real ( path. to_path_buf ( ) ) )
@@ -162,7 +163,9 @@ impl ParseSess {
162
163
pub ( crate ) fn is_file_parsed ( & self , path : & Path ) -> bool {
163
164
self . parse_sess
164
165
. source_map ( )
165
- . get_source_file ( & rustc_span:: FileName :: Real ( path. to_path_buf ( ) ) )
166
+ . get_source_file ( & rustc_span:: FileName :: Real (
167
+ rustc_span:: RealFileName :: Named ( path. to_path_buf ( ) ) ,
168
+ ) )
166
169
. is_some ( )
167
170
}
168
171
@@ -277,7 +280,7 @@ mod tests {
277
280
use crate :: config:: IgnoreList ;
278
281
use crate :: is_nightly_channel;
279
282
use crate :: utils:: mk_sp;
280
- use rustc_span:: { FileName as SourceMapFileName , MultiSpan , DUMMY_SP } ;
283
+ use rustc_span:: { FileName as SourceMapFileName , MultiSpan , RealFileName , DUMMY_SP } ;
281
284
use std:: path:: PathBuf ;
282
285
283
286
struct TestEmitter {
@@ -337,7 +340,10 @@ mod tests {
337
340
let source_map = Rc :: new ( SourceMap :: new ( FilePathMapping :: empty ( ) ) ) ;
338
341
let source =
339
342
String :: from ( r#"extern "system" fn jni_symbol!( funcName ) ( ... ) -> {} "# ) ;
340
- source_map. new_source_file ( SourceMapFileName :: Real ( PathBuf :: from ( "foo.rs" ) ) , source) ;
343
+ source_map. new_source_file (
344
+ SourceMapFileName :: Real ( RealFileName :: Named ( PathBuf :: from ( "foo.rs" ) ) ) ,
345
+ source,
346
+ ) ;
341
347
let mut emitter = build_emitter (
342
348
Rc :: clone ( & num_emitted_errors) ,
343
349
Rc :: clone ( & can_reset_errors) ,
@@ -361,7 +367,10 @@ mod tests {
361
367
let ignore_list = get_ignore_list ( r#"ignore = ["foo.rs"]"# ) ;
362
368
let source_map = Rc :: new ( SourceMap :: new ( FilePathMapping :: empty ( ) ) ) ;
363
369
let source = String :: from ( r#"pub fn bar() { 1x; }"# ) ;
364
- source_map. new_source_file ( SourceMapFileName :: Real ( PathBuf :: from ( "foo.rs" ) ) , source) ;
370
+ source_map. new_source_file (
371
+ SourceMapFileName :: Real ( RealFileName :: Named ( PathBuf :: from ( "foo.rs" ) ) ) ,
372
+ source,
373
+ ) ;
365
374
let mut emitter = build_emitter (
366
375
Rc :: clone ( & num_emitted_errors) ,
367
376
Rc :: clone ( & can_reset_errors) ,
@@ -384,7 +393,10 @@ mod tests {
384
393
let can_reset_errors = Rc :: new ( RefCell :: new ( false ) ) ;
385
394
let source_map = Rc :: new ( SourceMap :: new ( FilePathMapping :: empty ( ) ) ) ;
386
395
let source = String :: from ( r#"pub fn bar() { 1x; }"# ) ;
387
- source_map. new_source_file ( SourceMapFileName :: Real ( PathBuf :: from ( "foo.rs" ) ) , source) ;
396
+ source_map. new_source_file (
397
+ SourceMapFileName :: Real ( RealFileName :: Named ( PathBuf :: from ( "foo.rs" ) ) ) ,
398
+ source,
399
+ ) ;
388
400
let mut emitter = build_emitter (
389
401
Rc :: clone ( & num_emitted_errors) ,
390
402
Rc :: clone ( & can_reset_errors) ,
@@ -411,12 +423,16 @@ mod tests {
411
423
let foo_source = String :: from ( r#"pub fn foo() { 1x; }"# ) ;
412
424
let fatal_source =
413
425
String :: from ( r#"extern "system" fn jni_symbol!( funcName ) ( ... ) -> {} "# ) ;
414
- source_map
415
- . new_source_file ( SourceMapFileName :: Real ( PathBuf :: from ( "bar.rs" ) ) , bar_source) ;
416
- source_map
417
- . new_source_file ( SourceMapFileName :: Real ( PathBuf :: from ( "foo.rs" ) ) , foo_source) ;
418
426
source_map. new_source_file (
419
- SourceMapFileName :: Real ( PathBuf :: from ( "fatal.rs" ) ) ,
427
+ SourceMapFileName :: Real ( RealFileName :: Named ( PathBuf :: from ( "bar.rs" ) ) ) ,
428
+ bar_source,
429
+ ) ;
430
+ source_map. new_source_file (
431
+ SourceMapFileName :: Real ( RealFileName :: Named ( PathBuf :: from ( "foo.rs" ) ) ) ,
432
+ foo_source,
433
+ ) ;
434
+ source_map. new_source_file (
435
+ SourceMapFileName :: Real ( RealFileName :: Named ( PathBuf :: from ( "fatal.rs" ) ) ) ,
420
436
fatal_source,
421
437
) ;
422
438
let mut emitter = build_emitter (
0 commit comments