diff options
| author | John Kåre Alsaker <john.kare.alsaker@gmail.com> | 2018-04-09 23:49:25 +0200 |
|---|---|---|
| committer | John Kåre Alsaker <john.kare.alsaker@gmail.com> | 2018-04-30 05:27:05 +0200 |
| commit | 221b7ca3c27df5bb4729a7060e169c0a34dab9d0 (patch) | |
| tree | 8ce37598c9a9da46410474eac18c436cc8b19d4d /src/libproc_macro | |
| parent | 78bcd9b5fea31d8a4738e3cbd423a285db73f84d (diff) | |
| download | rust-221b7ca3c27df5bb4729a7060e169c0a34dab9d0.tar.gz rust-221b7ca3c27df5bb4729a7060e169c0a34dab9d0.zip | |
Remove usages of Term::as_str and mark it for removal
Diffstat (limited to 'src/libproc_macro')
| -rw-r--r-- | src/libproc_macro/lib.rs | 5 | ||||
| -rw-r--r-- | src/libproc_macro/quote.rs | 2 |
2 files changed, 4 insertions, 3 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#") { diff --git a/src/libproc_macro/quote.rs b/src/libproc_macro/quote.rs index d1f8e75192a..70f0b078399 100644 --- a/src/libproc_macro/quote.rs +++ b/src/libproc_macro/quote.rs @@ -183,7 +183,7 @@ impl Quote for Op { impl Quote for Term { fn quote(self) -> TokenStream { - quote!(::Term::new((quote self.as_str()), (quote self.span()))) + quote!(::Term::new((quote self.sym.as_str()), (quote self.span()))) } } |
