about summary refs log tree commit diff
path: root/compiler/rustc_parse/src
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2023-07-31 15:51:08 +1000
committerNicholas Nethercote <n.nethercote@gmail.com>2023-08-02 10:03:16 +1000
commitdb7b07aa028b65b4d85610e81fecb0d2382b8c76 (patch)
tree96f13654a56efd9df3cd4f9d2838ee195cf12138 /compiler/rustc_parse/src
parentd9f2fdfaed8d18ede6d113426279c86d84d92445 (diff)
downloadrust-db7b07aa028b65b4d85610e81fecb0d2382b8c76.tar.gz
rust-db7b07aa028b65b4d85610e81fecb0d2382b8c76.zip
Inline and remove `parse_all_token_trees`.
It has a single call site.
Diffstat (limited to 'compiler/rustc_parse/src')
-rw-r--r--compiler/rustc_parse/src/parser/mod.rs11
1 files changed, 1 insertions, 10 deletions
diff --git a/compiler/rustc_parse/src/parser/mod.rs b/compiler/rustc_parse/src/parser/mod.rs
index b452eb6a401..4b23f5a6de1 100644
--- a/compiler/rustc_parse/src/parser/mod.rs
+++ b/compiler/rustc_parse/src/parser/mod.rs
@@ -1251,7 +1251,7 @@ impl<'a> Parser<'a> {
     }
 
     /// Parses a single token tree from the input.
-    pub(crate) fn parse_token_tree(&mut self) -> TokenTree {
+    pub fn parse_token_tree(&mut self) -> TokenTree {
         match self.token.kind {
             token::OpenDelim(..) => {
                 // Grab the tokens within the delimiters.
@@ -1287,15 +1287,6 @@ impl<'a> Parser<'a> {
         }
     }
 
-    /// Parses a stream of tokens into a list of `TokenTree`s, up to EOF.
-    pub fn parse_all_token_trees(&mut self) -> Vec<TokenTree> {
-        let mut tts = Vec::new();
-        while self.token != token::Eof {
-            tts.push(self.parse_token_tree());
-        }
-        tts
-    }
-
     pub fn parse_tokens(&mut self) -> TokenStream {
         let mut result = Vec::new();
         loop {