Remove proc_macro2::FileName in favor of PathBuf
diff --git a/src/lib.rs b/src/lib.rs
index 2f632f6..4f8f59d 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -58,6 +58,8 @@
use std::hash::{Hash, Hasher};
use std::iter::FromIterator;
use std::marker;
+#[cfg(procmacro2_semver_exempt)]
+use std::path::PathBuf;
use std::rc::Rc;
use std::str::FromStr;
@@ -211,10 +213,6 @@
}
}
-// Returned by reference, so we can't easily wrap it.
-#[cfg(procmacro2_semver_exempt)]
-pub use imp::FileName;
-
/// The source file of a given `Span`.
///
/// This type is semver exempt and not exposed by default.
@@ -237,7 +235,7 @@
/// may not actually be valid.
///
/// [`is_real`]: #method.is_real
- pub fn path(&self) -> &FileName {
+ pub fn path(&self) -> PathBuf {
self.0.path()
}
@@ -249,13 +247,6 @@
}
#[cfg(procmacro2_semver_exempt)]
-impl AsRef<FileName> for SourceFile {
- fn as_ref(&self) -> &FileName {
- self.0.path()
- }
-}
-
-#[cfg(procmacro2_semver_exempt)]
impl fmt::Debug for SourceFile {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
self.0.fmt(f)