Move Spacing out of AttrAnnotatedTokenStream.

And into `AttrAnnotatedTokenTree::Token`.

PR #99887 did the same thing for `TokenStream`.
This commit is contained in:
Nicholas Nethercote
2022-09-09 11:51:23 +10:00
parent 1120c5e01d
commit 890e759ffc
5 changed files with 34 additions and 44 deletions

View File

@@ -644,7 +644,7 @@ pub fn noop_flat_map_param<T: MutVisitor>(mut param: Param, vis: &mut T) -> Smal
// No `noop_` prefix because there isn't a corresponding method in `MutVisitor`.
pub fn visit_attr_annotated_tt<T: MutVisitor>(tt: &mut AttrAnnotatedTokenTree, vis: &mut T) {
match tt {
AttrAnnotatedTokenTree::Token(token) => {
AttrAnnotatedTokenTree::Token(token, _) => {
visit_token(token, vis);
}
AttrAnnotatedTokenTree::Delimited(DelimSpan { open, close }, _delim, tts) => {
@@ -696,7 +696,7 @@ pub fn visit_attr_annotated_tts<T: MutVisitor>(
) {
if T::VISIT_TOKENS && !tts.is_empty() {
let tts = Lrc::make_mut(tts);
visit_vec(tts, |(tree, _is_joint)| visit_attr_annotated_tt(tree, vis));
visit_vec(tts, |tree| visit_attr_annotated_tt(tree, vis));
}
}