about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2023-07-31 12:32:32 +1000
committerNicholas Nethercote <n.nethercote@gmail.com>2023-07-31 14:47:06 +1000
commitd72fc5ce445c9a84dc289334b8aa7b34a144619b (patch)
treeeb48d05139e0ba479bd078418eea13f4778040ac
parentff7d5ba65e94980fbfb13793ef5d503ffad559b0 (diff)
downloadrust-d72fc5ce445c9a84dc289334b8aa7b34a144619b.tar.gz
rust-d72fc5ce445c9a84dc289334b8aa7b34a144619b.zip
Remove `TokenTreeCursor::replace_prev_and_rewind`.
It's no longer used.
-rw-r--r--compiler/rustc_ast/src/tokenstream.rs9
1 files changed, 0 insertions, 9 deletions
diff --git a/compiler/rustc_ast/src/tokenstream.rs b/compiler/rustc_ast/src/tokenstream.rs
index 50b4e68a1bd..e9591c7c8db 100644
--- a/compiler/rustc_ast/src/tokenstream.rs
+++ b/compiler/rustc_ast/src/tokenstream.rs
@@ -714,15 +714,6 @@ impl TokenTreeCursor {
     pub fn look_ahead(&self, n: usize) -> Option<&TokenTree> {
         self.stream.0.get(self.index + n)
     }
-
-    // Replace the previously obtained token tree with `tts`, and rewind to
-    // just before them.
-    pub fn replace_prev_and_rewind(&mut self, tts: Vec<TokenTree>) {
-        assert!(self.index > 0);
-        self.index -= 1;
-        let stream = Lrc::make_mut(&mut self.stream.0);
-        stream.splice(self.index..self.index + 1, tts);
-    }
 }
 
 #[derive(Debug, Copy, Clone, PartialEq, Encodable, Decodable, HashStable_Generic)]