Skip to content

Commit

Permalink
Rollup merge of rust-lang#103197 - est31:stabilize_proc_macro_source_…
Browse files Browse the repository at this point in the history
…text, r=petrochenkov

Stabilize proc_macro::Span::source_text

Splits `proc_macro::Span::source_text` into a new feature gate and stabilizes it. The [FCP is complete](rust-lang#101991 (comment)).

```Rust
impl Span {
    pub fn source_text(&self) -> Option<String>;
}
```

Closes rust-lang#101991
  • Loading branch information
Dylan-DPC committed Oct 19, 2022
2 parents 021551b + d89fb1d commit 3d429d8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion library/proc_macro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ impl Span {
/// Note: The observable result of a macro should only rely on the tokens and
/// not on this source text. The result of this function is a best effort to
/// be used for diagnostics only.
#[unstable(feature = "proc_macro_span", issue = "54725")]
#[stable(feature = "proc_macro_source_text", since = "CURRENT_RUSTC_VERSION")]
pub fn source_text(&self) -> Option<String> {
self.0.source_text()
}
Expand Down

0 comments on commit 3d429d8

Please sign in to comment.