]> git.lizzy.rs Git - rust.git/commit
Change `Token::interpolated_to_tokenstream()`.
authorNicholas Nethercote <nnethercote@mozilla.com>
Thu, 14 Feb 2019 21:31:44 +0000 (08:31 +1100)
committerNicholas Nethercote <nnethercote@mozilla.com>
Sun, 17 Feb 2019 22:38:34 +0000 (09:38 +1100)
commitd26bf742db0754893567401e49ae8b016c878a92
tree891c27d6805a649ded71e355b64abaa1783f391d
parentf47ec2ad5b6887b3d400aee49e2294bd27733d18
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`.
src/librustc/hir/lowering.rs
src/libsyntax/parse/token.rs
src/libsyntax/print/pprust.rs
src/libsyntax_ext/proc_macro_server.rs