Skip to content

Commit e31d619

Browse files
committed
Delete use of proc_macro::Span::before/after
1 parent 528e761 commit e31d619

File tree

4 files changed

+2
-62
lines changed

4 files changed

+2
-62
lines changed

build.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,7 @@ fn main() {
111111
println!("cargo:rustc-cfg=wrap_proc_macro");
112112
}
113113

114-
if version.nightly
115-
&& feature_allowed("proc_macro_span")
116-
&& feature_allowed("proc_macro_span_shrink")
117-
{
114+
if version.nightly && feature_allowed("proc_macro_span") {
118115
println!("cargo:rustc-cfg=proc_macro_span");
119116
}
120117

src/fallback.rs

-20
Original file line numberDiff line numberDiff line change
@@ -541,26 +541,6 @@ impl Span {
541541
})
542542
}
543543

544-
#[cfg(procmacro2_semver_exempt)]
545-
pub fn before(&self) -> Span {
546-
Span {
547-
#[cfg(span_locations)]
548-
lo: self.lo,
549-
#[cfg(span_locations)]
550-
hi: self.lo,
551-
}
552-
}
553-
554-
#[cfg(procmacro2_semver_exempt)]
555-
pub fn after(&self) -> Span {
556-
Span {
557-
#[cfg(span_locations)]
558-
lo: self.hi,
559-
#[cfg(span_locations)]
560-
hi: self.hi,
561-
}
562-
}
563-
564544
#[cfg(not(span_locations))]
565545
pub fn join(&self, _other: Span) -> Option<Span> {
566546
Some(Span {})

src/lib.rs

+1-22
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,7 @@
8787
8888
// Proc-macro2 types in rustdoc of other crates get linked to here.
8989
#![doc(html_root_url = "https://docs.rs/proc-macro2/1.0.59")]
90-
#![cfg_attr(
91-
any(proc_macro_span, super_unstable),
92-
feature(proc_macro_span, proc_macro_span_shrink)
93-
)]
90+
#![cfg_attr(any(proc_macro_span, super_unstable), feature(proc_macro_span))]
9491
#![cfg_attr(super_unstable, feature(proc_macro_def_site))]
9592
#![cfg_attr(doc_cfg, feature(doc_cfg))]
9693
#![allow(
@@ -494,24 +491,6 @@ impl Span {
494491
self.inner.end()
495492
}
496493

497-
/// Creates an empty span pointing to directly before this span.
498-
///
499-
/// This method is semver exempt and not exposed by default.
500-
#[cfg(all(procmacro2_semver_exempt, any(not(wrap_proc_macro), super_unstable)))]
501-
#[cfg_attr(doc_cfg, doc(cfg(procmacro2_semver_exempt)))]
502-
pub fn before(&self) -> Span {
503-
Span::_new(self.inner.before())
504-
}
505-
506-
/// Creates an empty span pointing to directly after this span.
507-
///
508-
/// This method is semver exempt and not exposed by default.
509-
#[cfg(all(procmacro2_semver_exempt, any(not(wrap_proc_macro), super_unstable)))]
510-
#[cfg_attr(doc_cfg, doc(cfg(procmacro2_semver_exempt)))]
511-
pub fn after(&self) -> Span {
512-
Span::_new(self.inner.after())
513-
}
514-
515494
/// Create a new span encompassing `self` and `other`.
516495
///
517496
/// Returns `None` if `self` and `other` are from different files.

src/wrapper.rs

-16
Original file line numberDiff line numberDiff line change
@@ -483,22 +483,6 @@ impl Span {
483483
}
484484
}
485485

486-
#[cfg(super_unstable)]
487-
pub fn before(&self) -> Span {
488-
match self {
489-
Span::Compiler(s) => Span::Compiler(s.before()),
490-
Span::Fallback(s) => Span::Fallback(s.before()),
491-
}
492-
}
493-
494-
#[cfg(super_unstable)]
495-
pub fn after(&self) -> Span {
496-
match self {
497-
Span::Compiler(s) => Span::Compiler(s.after()),
498-
Span::Fallback(s) => Span::Fallback(s.after()),
499-
}
500-
}
501-
502486
pub fn join(&self, other: Span) -> Option<Span> {
503487
let ret = match (self, other) {
504488
#[cfg(proc_macro_span)]

0 commit comments

Comments
 (0)