mirror of
https://gitee.com/openharmony/third_party_rust_proc-macro2
synced 2024-11-23 15:29:39 +00:00
Merge pull request #41 from alexcrichton/unstable
Span::unstable to expose the proc_macro::Span
This commit is contained in:
commit
31ac177a66
@ -162,6 +162,12 @@ impl Span {
|
||||
Span(imp::Span::def_site())
|
||||
}
|
||||
|
||||
/// This method is only available when the `"unstable"` feature is enabled.
|
||||
#[cfg(feature = "unstable")]
|
||||
pub fn unstable(self) -> proc_macro::Span {
|
||||
self.0.unstable()
|
||||
}
|
||||
|
||||
#[cfg(procmacro2_unstable)]
|
||||
pub fn source_file(&self) -> SourceFile {
|
||||
SourceFile(self.0.source_file())
|
||||
|
@ -225,6 +225,10 @@ impl Span {
|
||||
Span(proc_macro::Span::def_site())
|
||||
}
|
||||
|
||||
pub fn unstable(self) -> proc_macro::Span {
|
||||
self.0
|
||||
}
|
||||
|
||||
#[cfg(procmacro2_unstable)]
|
||||
pub fn source_file(&self) -> SourceFile {
|
||||
SourceFile::new(self.0.source_file())
|
||||
|
Loading…
Reference in New Issue
Block a user