diff options
| author | Nicholas Nethercote <nnethercote@mozilla.com> | 2019-02-15 08:31:44 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <nnethercote@mozilla.com> | 2019-02-18 09:38:34 +1100 |
| commit | d26bf742db0754893567401e49ae8b016c878a92 (patch) | |
| tree | 891c27d6805a649ded71e355b64abaa1783f391d /src/libsyntax_ext | |
| parent | f47ec2ad5b6887b3d400aee49e2294bd27733d18 (diff) | |
| download | rust-d26bf742db0754893567401e49ae8b016c878a92.tar.gz rust-d26bf742db0754893567401e49ae8b016c878a92.zip | |
Change `Token::interpolated_to_tokenstream()`.
It is currently a method of `Token`, but it only is valid to call if `self` is a `Token::Interpolated`. This commit eliminates the possibility of misuse by changing it to an associated function that takes a `Nonterminal`, which also simplifies the call sites. This requires splitting out a new function, `nonterminal_to_string`.
Diffstat (limited to 'src/libsyntax_ext')
| -rw-r--r-- | src/libsyntax_ext/proc_macro_server.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libsyntax_ext/proc_macro_server.rs b/src/libsyntax_ext/proc_macro_server.rs index fd82dac5ab6..60ce65baa48 100644 --- a/src/libsyntax_ext/proc_macro_server.rs +++ b/src/libsyntax_ext/proc_macro_server.rs @@ -178,8 +178,8 @@ impl FromInternal<(TreeAndJoint, &'_ ParseSess, &'_ mut Vec<Self>)> tt!(Punct::new('#', false)) } - Interpolated(_) => { - let stream = token.interpolated_to_tokenstream(sess, span); + Interpolated(nt) => { + let stream = Token::interpolated_to_tokenstream(sess, nt, span); TokenTree::Group(Group { delimiter: Delimiter::None, stream, |
