Skip to content

Commit

Permalink
Rollup merge of #103197 - est31:stabilize_proc_macro_source_text, r=p…
Browse files Browse the repository at this point in the history
…etrochenkov

Stabilize proc_macro::Span::source_text

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

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

Closes #101991
  • Loading branch information
matthiaskrgr authored Oct 20, 2022
2 parents ebdde35 + d89fb1d commit 62bb0c6
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 62bb0c6

Please sign in to comment.