Skip to content

Stabilize proc_macro::Span::{start,end,line,column}. #139865

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 26, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions library/proc_macro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -513,29 +513,29 @@ impl Span {
}

/// Creates an empty span pointing to directly before this span.
#[unstable(feature = "proc_macro_span", issue = "54725")]
#[stable(feature = "proc_macro_span_location", since = "CURRENT_RUSTC_VERSION")]
pub fn start(&self) -> Span {
Span(self.0.start())
}

/// Creates an empty span pointing to directly after this span.
#[unstable(feature = "proc_macro_span", issue = "54725")]
#[stable(feature = "proc_macro_span_location", since = "CURRENT_RUSTC_VERSION")]
pub fn end(&self) -> Span {
Span(self.0.end())
}

/// The one-indexed line of the source file where the span starts.
///
/// To obtain the line of the span's end, use `span.end().line()`.
#[unstable(feature = "proc_macro_span", issue = "54725")]
#[stable(feature = "proc_macro_span_location", since = "CURRENT_RUSTC_VERSION")]
pub fn line(&self) -> usize {
self.0.line()
}

/// The one-indexed column of the source file where the span starts.
///
/// To obtain the column of the span's end, use `span.end().column()`.
#[unstable(feature = "proc_macro_span", issue = "54725")]
#[stable(feature = "proc_macro_span_location", since = "CURRENT_RUSTC_VERSION")]
pub fn column(&self) -> usize {
self.0.column()
}
Expand Down
Loading