about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-10-20 07:58:55 +0200
committerGitHub <noreply@github.com>2022-10-20 07:58:55 +0200
commit62bb0c6fdd593d963a7b036ece4b28d3ee8fbb49 (patch)
tree666e8c36a3349c5e34211fb748dfe0272485ed51
parentebdde35dced40adb46f8aad054fb2adb86b39427 (diff)
parentd89fb1dee5bf47ae9bd9051b296da379e01f1755 (diff)
downloadrust-62bb0c6fdd593d963a7b036ece4b28d3ee8fbb49.tar.gz
rust-62bb0c6fdd593d963a7b036ece4b28d3ee8fbb49.zip
Rollup merge of #103197 - est31:stabilize_proc_macro_source_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](https://github.com/rust-lang/rust/issues/101991#issuecomment-1279393265).

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

Closes #101991
-rw-r--r--library/proc_macro/src/lib.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/library/proc_macro/src/lib.rs b/library/proc_macro/src/lib.rs
index f9c7d3e172c..8001fcff648 100644
--- a/library/proc_macro/src/lib.rs
+++ b/library/proc_macro/src/lib.rs
@@ -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()
     }