From d72fc5ce445c9a84dc289334b8aa7b34a144619b Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Mon, 31 Jul 2023 12:32:32 +1000 Subject: [PATCH] Remove `TokenTreeCursor::replace_prev_and_rewind`. It's no longer used. --- compiler/rustc_ast/src/tokenstream.rs | 9 --------- 1 file changed, 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) { - 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)]