summaryrefslogtreecommitdiff
path: root/rust/proc-macro2/probe/proc_macro_span_file.rs
diff options
context:
space:
mode:
Diffstat (limited to 'rust/proc-macro2/probe/proc_macro_span_file.rs')
-rw-r--r--rust/proc-macro2/probe/proc_macro_span_file.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/rust/proc-macro2/probe/proc_macro_span_file.rs b/rust/proc-macro2/probe/proc_macro_span_file.rs
new file mode 100644
index 000000000000..f2dbc4056ebe
--- /dev/null
+++ b/rust/proc-macro2/probe/proc_macro_span_file.rs
@@ -0,0 +1,16 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
+// The subset of Span's API stabilized in Rust 1.88.
+
+extern crate proc_macro;
+
+use proc_macro::Span;
+use std::path::PathBuf;
+
+pub fn file(this: &Span) -> String {
+ this.file()
+}
+
+pub fn local_file(this: &Span) -> Option<PathBuf> {
+ this.local_file()
+}