Impl Copy
for Token
and TokenKind
.
This commit is contained in:
parent
bb495d6d3e
commit
4d8f7577b5
20 changed files with 56 additions and 57 deletions
|
@ -333,7 +333,7 @@ impl From<IdentIsRaw> for bool {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, PartialEq, Encodable, Decodable, Debug, HashStable_Generic)]
|
||||
#[derive(Clone, Copy, PartialEq, Encodable, Decodable, Debug, HashStable_Generic)]
|
||||
pub enum TokenKind {
|
||||
/* Expression-operator symbols. */
|
||||
/// `=`
|
||||
|
@ -471,7 +471,7 @@ pub enum TokenKind {
|
|||
Eof,
|
||||
}
|
||||
|
||||
#[derive(Clone, PartialEq, Encodable, Decodable, Debug, HashStable_Generic)]
|
||||
#[derive(Clone, Copy, PartialEq, Encodable, Decodable, Debug, HashStable_Generic)]
|
||||
pub struct Token {
|
||||
pub kind: TokenKind,
|
||||
pub span: Span,
|
||||
|
|
|
@ -482,7 +482,7 @@ impl TokenStream {
|
|||
Delimiter::Invisible(InvisibleOrigin::FlattenToken),
|
||||
TokenStream::token_alone(token::Lifetime(ident.name, is_raw), ident.span),
|
||||
),
|
||||
_ => TokenTree::Token(token.clone(), spacing),
|
||||
_ => TokenTree::Token(*token, spacing),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue