about summary refs log tree commit diff
path: root/compiler/rustc_ast/src
diff options
context:
space:
mode:
authorTyler Mandry <tmandry@google.com>2020-09-10 02:18:46 +0000
committerTyler Mandry <tmandry@google.com>2020-09-10 02:18:46 +0000
commitfdff7defc9a21fc63a1586efab87694723144793 (patch)
tree3780e84ac1623f737932b5a8406eca325601792f /compiler/rustc_ast/src
parent97eb606e4b2becd17d46a67d87169f52b210e67c (diff)
downloadrust-fdff7defc9a21fc63a1586efab87694723144793.tar.gz
rust-fdff7defc9a21fc63a1586efab87694723144793.zip
Revert "Rollup merge of #76285 - matklad:censor-spacing, r=petrochenkov"
This reverts commit 85cee57fd791d670d92dc61e0ad71594128dd45a, reversing
changes made to b4d387302416c90a3f70211770292d8d8ab5e07d.
Diffstat (limited to 'compiler/rustc_ast/src')
-rw-r--r--compiler/rustc_ast/src/tokenstream.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_ast/src/tokenstream.rs b/compiler/rustc_ast/src/tokenstream.rs
index fb98f55a215..151acddae84 100644
--- a/compiler/rustc_ast/src/tokenstream.rs
+++ b/compiler/rustc_ast/src/tokenstream.rs
@@ -403,8 +403,8 @@ impl Cursor {
         self.index = index;
     }
 
-    pub fn look_ahead(&self, n: usize) -> Option<&TokenTree> {
-        self.stream.0[self.index..].get(n).map(|(tree, _)| tree)
+    pub fn look_ahead(&self, n: usize) -> Option<TokenTree> {
+        self.stream.0[self.index..].get(n).map(|(tree, _)| tree.clone())
     }
 }