@@ -623,36 +623,19 @@ impl SourceFile {
623
623
/// Gets the path to this source file.
624
624
///
625
625
/// ### Note
626
- /// If the code span associated with this `SourceFile` was generated by an external macro, this
627
- /// macro, this might not be an actual path on the filesystem. Use [`is_real`] to check.
628
626
///
629
- /// Also note that even if `is_real` returns `true`, if `--remap-path-prefix` was passed on
627
+ /// If `--remap-path-prefix` was passed on
630
628
/// the command line, the path as given might not actually be valid.
631
- ///
632
- /// [`is_real`]: Self::is_real
633
629
#[ unstable( feature = "proc_macro_span" , issue = "54725" ) ]
634
630
pub fn path ( & self ) -> PathBuf {
635
631
PathBuf :: from ( self . 0 . path ( ) )
636
632
}
637
-
638
- /// Returns `true` if this source file is a real source file, and not generated by an external
639
- /// macro's expansion.
640
- #[ unstable( feature = "proc_macro_span" , issue = "54725" ) ]
641
- pub fn is_real ( & self ) -> bool {
642
- // This is a hack until intercrate spans are implemented and we can have real source files
643
- // for spans generated in external macros.
644
- // https://github.com/rust-lang/rust/pull/43604#issuecomment-333334368
645
- self . 0 . is_real ( )
646
- }
647
633
}
648
634
649
635
#[ unstable( feature = "proc_macro_span" , issue = "54725" ) ]
650
636
impl fmt:: Debug for SourceFile {
651
637
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
652
- f. debug_struct ( "SourceFile" )
653
- . field ( "path" , & self . path ( ) )
654
- . field ( "is_real" , & self . is_real ( ) )
655
- . finish ( )
638
+ f. debug_struct ( "SourceFile" ) . field ( "path" , & self . path ( ) ) . finish ( )
656
639
}
657
640
}
658
641
0 commit comments