Skip to content

Commit 485eff7

Browse files
committed
Remove proc_macro::SourceFile::is_real().
1 parent b337b15 commit 485eff7

File tree

2 files changed

+2
-20
lines changed

2 files changed

+2
-20
lines changed

proc_macro/src/bridge/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ macro_rules! with_api {
8686
fn clone($self: &$S::SourceFile) -> $S::SourceFile;
8787
fn eq($self: &$S::SourceFile, other: &$S::SourceFile) -> bool;
8888
fn path($self: &$S::SourceFile) -> String;
89-
fn is_real($self: &$S::SourceFile) -> bool;
9089
},
9190
Span {
9291
fn debug($self: $S::Span) -> String;

proc_macro/src/lib.rs

+2-19
Original file line numberDiff line numberDiff line change
@@ -623,36 +623,19 @@ impl SourceFile {
623623
/// Gets the path to this source file.
624624
///
625625
/// ### 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.
628626
///
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
630628
/// the command line, the path as given might not actually be valid.
631-
///
632-
/// [`is_real`]: Self::is_real
633629
#[unstable(feature = "proc_macro_span", issue = "54725")]
634630
pub fn path(&self) -> PathBuf {
635631
PathBuf::from(self.0.path())
636632
}
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-
}
647633
}
648634

649635
#[unstable(feature = "proc_macro_span", issue = "54725")]
650636
impl fmt::Debug for SourceFile {
651637
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()
656639
}
657640
}
658641

0 commit comments

Comments
 (0)