Impl Copy for Token and TokenKind.

This commit is contained in:
Nicholas Nethercote
2024-05-16 09:22:37 +10:00
parent bb495d6d3e
commit 4d8f7577b5
20 changed files with 56 additions and 57 deletions

View File

@@ -547,7 +547,7 @@ impl<'a> Parser<'a> {
// Recovery
mutbl = Mutability::Mut;
let (dyn_tok, dyn_tok_sp) = (self.token.clone(), self.token_spacing);
let (dyn_tok, dyn_tok_sp) = (self.token, self.token_spacing);
self.bump();
self.bump_with((dyn_tok, dyn_tok_sp));
}
@@ -886,7 +886,7 @@ impl<'a> Parser<'a> {
/// ```
fn parse_generic_bound(&mut self) -> PResult<'a, GenericBound> {
let lo = self.token.span;
let leading_token = self.prev_token.clone();
let leading_token = self.prev_token;
let has_parens = self.eat(exp!(OpenParen));
let bound = if self.token.is_lifetime() {