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

@@ -2554,7 +2554,7 @@ fn look(p: &Parser<'_>, dist: usize, kind: rustc_ast::token::TokenKind) {
// Do the `assert_eq` outside the closure so that `track_caller` works.
// (`#![feature(closure_track_caller)]` + `#[track_caller]` on the closure
// doesn't give the line number in the test below if the assertion fails.)
let tok = p.look_ahead(dist, |tok| tok.clone());
let tok = p.look_ahead(dist, |tok| *tok);
assert_eq!(kind, tok.kind);
}