Skip to content

Commit e80a221

Browse files
committed
Auto merge of #124141 - nnethercote:rm-Nonterminal-and-TokenKind-Interpolated, r=petrochenkov
Remove `Nonterminal` and `TokenKind::Interpolated` A third attempt at this; the first attempt was #96724 and the second was #114647. r? `@ghost`
2 parents 2ab6be8 + ce70a79 commit e80a221

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/macros.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -858,18 +858,18 @@ impl MacroArgParser {
858858
};
859859

860860
self.result.push(ParsedMacroArg {
861-
kind: MacroArgKind::Repeat(delim, inner, another, self.last_tok.clone()),
861+
kind: MacroArgKind::Repeat(delim, inner, another, self.last_tok),
862862
});
863863
Some(())
864864
}
865865

866-
fn update_buffer(&mut self, t: &Token) {
866+
fn update_buffer(&mut self, t: Token) {
867867
if self.buf.is_empty() {
868-
self.start_tok = t.clone();
868+
self.start_tok = t;
869869
} else {
870870
let needs_space = match next_space(&self.last_tok.kind) {
871-
SpaceState::Ident => ident_like(t),
872-
SpaceState::Punctuation => !ident_like(t),
871+
SpaceState::Ident => ident_like(&t),
872+
SpaceState::Punctuation => !ident_like(&t),
873873
SpaceState::Always => true,
874874
SpaceState::Never => false,
875875
};
@@ -878,7 +878,7 @@ impl MacroArgParser {
878878
}
879879
}
880880

881-
self.buf.push_str(&pprust::token_to_string(t));
881+
self.buf.push_str(&pprust::token_to_string(&t));
882882
}
883883

884884
fn need_space_prefix(&self) -> bool {
@@ -937,7 +937,7 @@ impl MacroArgParser {
937937
) if self.is_meta_var => {
938938
self.add_meta_variable(&mut iter)?;
939939
}
940-
TokenTree::Token(ref t, _) => self.update_buffer(t),
940+
&TokenTree::Token(t, _) => self.update_buffer(t),
941941
&TokenTree::Delimited(_dspan, _spacing, delimited, ref tts) => {
942942
if !self.buf.is_empty() {
943943
if next_space(&self.last_tok.kind) == SpaceState::Always {

0 commit comments

Comments
 (0)