about summary refs log tree commit diff
path: root/src/libproc_macro/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/libproc_macro/lib.rs')
-rw-r--r--src/libproc_macro/lib.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libproc_macro/lib.rs b/src/libproc_macro/lib.rs
index f51dbc3772f..7efcd0cbf1d 100644
--- a/src/libproc_macro/lib.rs
+++ b/src/libproc_macro/lib.rs
@@ -715,6 +715,7 @@ impl Term {
         }
     }
 
+    // FIXME: Remove this, do not stabilize
     /// Get a reference to the interned string.
     #[unstable(feature = "proc_macro", issue = "38356")]
     pub fn as_str(&self) -> &str {
@@ -739,7 +740,7 @@ impl Term {
 #[unstable(feature = "proc_macro", issue = "38356")]
 impl fmt::Display for Term {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        self.as_str().fmt(f)
+        self.sym.as_str().fmt(f)
     }
 }
 
@@ -1131,7 +1132,7 @@ impl TokenTree {
             },
             self::TokenTree::Term(tt) => {
                 let ident = ast::Ident::new(tt.sym, tt.span.0);
-                let sym_str = tt.sym.as_str();
+                let sym_str = tt.sym.to_string();
                 let token = if sym_str.starts_with("'") {
                     Lifetime(ident)
                 } else if sym_str.starts_with("r#") {