@@ -65,7 +65,8 @@ impl Emitter for SilentOnIgnoredFilesEmitter {
65
65
}
66
66
if let Some ( primary_span) = & db. span . primary_span ( ) {
67
67
let file_name = self . source_map . span_to_filename ( * primary_span) ;
68
- if let rustc_span:: FileName :: Real ( ref path) = file_name {
68
+ if let rustc_span:: FileName :: Real ( rustc_span:: RealFileName :: Named ( ref path) ) = file_name
69
+ {
69
70
if self
70
71
. ignore_path_set
71
72
. is_match ( & FileName :: Real ( path. to_path_buf ( ) ) )
@@ -158,7 +159,9 @@ impl ParseSess {
158
159
pub ( crate ) fn is_file_parsed ( & self , path : & Path ) -> bool {
159
160
self . parse_sess
160
161
. source_map ( )
161
- . get_source_file ( & rustc_span:: FileName :: Real ( path. to_path_buf ( ) ) )
162
+ . get_source_file ( & rustc_span:: FileName :: Real (
163
+ rustc_span:: RealFileName :: Named ( path. to_path_buf ( ) ) ,
164
+ ) )
162
165
. is_some ( )
163
166
}
164
167
@@ -266,7 +269,7 @@ mod tests {
266
269
use crate :: config:: IgnoreList ;
267
270
use crate :: formatting:: utils:: mk_sp;
268
271
use crate :: is_nightly_channel;
269
- use rustc_span:: { FileName as SourceMapFileName , MultiSpan , DUMMY_SP } ;
272
+ use rustc_span:: { FileName as SourceMapFileName , MultiSpan , RealFileName , DUMMY_SP } ;
270
273
use std:: path:: PathBuf ;
271
274
272
275
struct TestEmitter {
@@ -326,7 +329,10 @@ mod tests {
326
329
let source_map = Rc :: new ( SourceMap :: new ( FilePathMapping :: empty ( ) ) ) ;
327
330
let source =
328
331
String :: from ( r#"extern "system" fn jni_symbol!( funcName ) ( ... ) -> {} "# ) ;
329
- source_map. new_source_file ( SourceMapFileName :: Real ( PathBuf :: from ( "foo.rs" ) ) , source) ;
332
+ source_map. new_source_file (
333
+ SourceMapFileName :: Real ( RealFileName :: Named ( PathBuf :: from ( "foo.rs" ) ) ) ,
334
+ source,
335
+ ) ;
330
336
let mut emitter = build_emitter (
331
337
Rc :: clone ( & num_emitted_errors) ,
332
338
Rc :: clone ( & can_reset_errors) ,
@@ -350,7 +356,10 @@ mod tests {
350
356
let ignore_list = get_ignore_list ( r#"ignore = ["foo.rs"]"# ) ;
351
357
let source_map = Rc :: new ( SourceMap :: new ( FilePathMapping :: empty ( ) ) ) ;
352
358
let source = String :: from ( r#"pub fn bar() { 1x; }"# ) ;
353
- source_map. new_source_file ( SourceMapFileName :: Real ( PathBuf :: from ( "foo.rs" ) ) , source) ;
359
+ source_map. new_source_file (
360
+ SourceMapFileName :: Real ( RealFileName :: Named ( PathBuf :: from ( "foo.rs" ) ) ) ,
361
+ source,
362
+ ) ;
354
363
let mut emitter = build_emitter (
355
364
Rc :: clone ( & num_emitted_errors) ,
356
365
Rc :: clone ( & can_reset_errors) ,
@@ -373,7 +382,10 @@ mod tests {
373
382
let can_reset_errors = Rc :: new ( RefCell :: new ( false ) ) ;
374
383
let source_map = Rc :: new ( SourceMap :: new ( FilePathMapping :: empty ( ) ) ) ;
375
384
let source = String :: from ( r#"pub fn bar() { 1x; }"# ) ;
376
- source_map. new_source_file ( SourceMapFileName :: Real ( PathBuf :: from ( "foo.rs" ) ) , source) ;
385
+ source_map. new_source_file (
386
+ SourceMapFileName :: Real ( RealFileName :: Named ( PathBuf :: from ( "foo.rs" ) ) ) ,
387
+ source,
388
+ ) ;
377
389
let mut emitter = build_emitter (
378
390
Rc :: clone ( & num_emitted_errors) ,
379
391
Rc :: clone ( & can_reset_errors) ,
@@ -400,12 +412,16 @@ mod tests {
400
412
let foo_source = String :: from ( r#"pub fn foo() { 1x; }"# ) ;
401
413
let fatal_source =
402
414
String :: from ( r#"extern "system" fn jni_symbol!( funcName ) ( ... ) -> {} "# ) ;
403
- source_map
404
- . new_source_file ( SourceMapFileName :: Real ( PathBuf :: from ( "bar.rs" ) ) , bar_source) ;
405
- source_map
406
- . new_source_file ( SourceMapFileName :: Real ( PathBuf :: from ( "foo.rs" ) ) , foo_source) ;
407
415
source_map. new_source_file (
408
- SourceMapFileName :: Real ( PathBuf :: from ( "fatal.rs" ) ) ,
416
+ SourceMapFileName :: Real ( RealFileName :: Named ( PathBuf :: from ( "bar.rs" ) ) ) ,
417
+ bar_source,
418
+ ) ;
419
+ source_map. new_source_file (
420
+ SourceMapFileName :: Real ( RealFileName :: Named ( PathBuf :: from ( "foo.rs" ) ) ) ,
421
+ foo_source,
422
+ ) ;
423
+ source_map. new_source_file (
424
+ SourceMapFileName :: Real ( RealFileName :: Named ( PathBuf :: from ( "fatal.rs" ) ) ) ,
409
425
fatal_source,
410
426
) ;
411
427
let mut emitter = build_emitter (
0 commit comments