Skip to content

Commit 7882bd6

Browse files
JohnTitorgitbot
authored and
gitbot
committed
Rollup merge of rust-lang#86136 - m-ou-se:proc-macro-open-close-span, r=m-ou-se
Stabilize span_open() and span_close(). This proposes to stabilize `Group::span_open()` and `Group::span_close()`. These are part of the `proc_macro_span` feature gate tracked in rust-lang#54725 Most of the features gated behind `proc_macro_span` are about source location information (file path, line and column information), expansion information (parent()), source_text(), etc. Those are not ready for stabilizaiton. However, getting the span of the `(` and `)` separately instead of only of the entire `(...)` can be very useful in proc macros, and doesn't seem blocked on anything that all the other parts of `proc_macro_span` are blocked on. So, this renames the feature gate for those two functions to `proc_macro_group_span` and stabilizes them.
2 parents 952eee2 + c33de9c commit 7882bd6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

proc_macro/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,7 @@ impl Group {
708708
/// pub fn span_open(&self) -> Span {
709709
/// ^
710710
/// ```
711-
#[unstable(feature = "proc_macro_span", issue = "54725")]
711+
#[stable(feature = "proc_macro_group_span", since = "1.55.0")]
712712
pub fn span_open(&self) -> Span {
713713
Span(self.0.span_open())
714714
}
@@ -719,7 +719,7 @@ impl Group {
719719
/// pub fn span_close(&self) -> Span {
720720
/// ^
721721
/// ```
722-
#[unstable(feature = "proc_macro_span", issue = "54725")]
722+
#[stable(feature = "proc_macro_group_span", since = "1.55.0")]
723723
pub fn span_close(&self) -> Span {
724724
Span(self.0.span_close())
725725
}

0 commit comments

Comments
 (0)