Skip to content

Commit 54d9bc6

Browse files
committed
Move LazyTokenStream attributes to field level
Type-level attributes don't propagate through Option<T>, so apply #[equiv_mode=ignore], #[match=ignore], and #[rewrite_ignore] directly to all tokens fields instead of on the LazyTokenStream flag definition.
1 parent c2a682a commit 54d9bc6

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

c2rust-refactor/gen/ast.txt

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ struct Crate {
3232

3333
#[rewrite_print_recover] #[rewrite_seq_item] #[rewrite_extra_strategies=item_header]
3434
#[nonterminal] #[extend_span]
35-
struct Item { ident, #[match=ignore] attrs, id, kind, vis, span, #[match=ignore] tokens }
35+
struct Item { ident, #[match=ignore] attrs, id, kind, vis, span, #[equiv_mode=ignore] #[match=ignore] #[rewrite_ignore] tokens }
3636
enum ItemKind {
3737
ExternCrate(name),
3838
Use(vp),
@@ -98,7 +98,7 @@ enum UseTreeKind {
9898
struct UseTree { kind, prefix, span }
9999

100100
#[extend_span]
101-
struct AssocItem { id, ident, #[match=ignore] attrs, vis, kind, span, #[match=ignore] tokens }
101+
struct AssocItem { id, ident, #[match=ignore] attrs, vis, kind, span, #[equiv_mode=ignore] #[match=ignore] #[rewrite_ignore] tokens }
102102
enum AssocItemKind {
103103
Const(defaultness, ty, init),
104104
Fn(fn),
@@ -122,7 +122,7 @@ struct FieldDef { #[match=ignore] attrs, id, span, vis, ident, ty, is_placeholde
122122

123123
struct ForeignMod { unsafety, abi, #[mac_table_seq] items }
124124
#[rewrite_print_recover] #[rewrite_seq_item] #[extend_span]
125-
struct ForeignItem { ident, #[match=ignore] attrs, kind, id, span, vis, #[match=ignore] tokens }
125+
struct ForeignItem { ident, #[match=ignore] attrs, kind, id, span, vis, #[equiv_mode=ignore] #[match=ignore] #[rewrite_ignore] tokens }
126126
enum ForeignItemKind {
127127
Fn(fn),
128128
Static(ty, mutbl, init),
@@ -158,7 +158,7 @@ enum TraitBoundModifier {
158158
}
159159

160160
#[match=ignore]
161-
struct Visibility { kind, span, #[match=ignore] tokens }
161+
struct Visibility { kind, span, #[equiv_mode=ignore] #[match=ignore] #[rewrite_ignore] tokens }
162162

163163
#[match=ignore]
164164
enum VisibilityKind {
@@ -168,7 +168,7 @@ enum VisibilityKind {
168168
}
169169

170170
#[match=custom] #[rewrite_print_recover] #[mac_table_record] #[nonterminal]
171-
struct Ty { id, kind, span, #[match=ignore] tokens }
171+
struct Ty { id, kind, span, #[equiv_mode=ignore] #[match=ignore] #[rewrite_ignore] tokens }
172172
struct MutTy { ty, mutbl }
173173
enum TyKind {
174174
Slice(ty),
@@ -276,7 +276,7 @@ enum StmtKind {
276276
}
277277

278278
#[extend_span]
279-
struct Local { id, pat, ty, kind, span, #[match=ignore] attrs, #[match=ignore] tokens }
279+
struct Local { id, pat, ty, kind, span, #[match=ignore] attrs, #[equiv_mode=ignore] #[match=ignore] #[rewrite_ignore] tokens }
280280
enum LocalKind {
281281
Decl,
282282
Init(expr),
@@ -285,7 +285,7 @@ enum LocalKind {
285285

286286

287287
#[match=custom] #[rewrite_print_recover] #[extend_span] #[mac_table_record] #[nonterminal]
288-
struct Expr { id, kind, span, #[match=ignore] attrs, #[match=ignore] tokens }
288+
struct Expr { id, kind, span, #[match=ignore] attrs, #[equiv_mode=ignore] #[match=ignore] #[rewrite_ignore] tokens }
289289
#[prec_contains_expr]
290290
enum ExprKind {
291291
Box(#[prec=PREFIX] expr),
@@ -397,13 +397,13 @@ struct Block {
397397
id,
398398
rules,
399399
span,
400-
#[match=ignore] tokens,
400+
#[equiv_mode=ignore] #[match=ignore] #[rewrite_ignore] tokens,
401401
could_be_bare_literal,
402402
}
403403

404404

405405
#[match=custom] #[mac_table_record] #[nonterminal]
406-
struct Pat { id, kind, span, #[match=ignore] tokens }
406+
struct Pat { id, kind, span, #[equiv_mode=ignore] #[match=ignore] #[rewrite_ignore] tokens }
407407
enum PatKind {
408408
Wild,
409409
Ident(mode, id, pat),
@@ -536,10 +536,10 @@ enum RangeLimits {
536536
#[no_node_id] #[rewrite_print] #[rewrite_custom=SeqItem]
537537
struct Attribute { kind, id, style, span }
538538
enum AttrKind {
539-
Normal(item, #[match=ignore] tokens),
539+
Normal(item, #[equiv_mode=ignore] #[match=ignore] #[rewrite_ignore] tokens),
540540
DocComment(kind, symbol),
541541
}
542-
struct AttrItem { path, args, #[match=ignore] tokens }
542+
struct AttrItem { path, args, #[equiv_mode=ignore] #[match=ignore] #[rewrite_ignore] tokens }
543543
enum AttrStyle {
544544
Outer,
545545
Inner,
@@ -551,7 +551,7 @@ enum CommentKind {
551551
}
552552

553553
#[match=custom] #[nonterminal]
554-
struct Path { span, segments, #[match=ignore] tokens }
554+
struct Path { span, segments, #[equiv_mode=ignore] #[match=ignore] #[rewrite_ignore] tokens }
555555
struct PathSegment { ident, id, args }
556556

557557
enum GenericArgs {
@@ -576,7 +576,7 @@ struct MacCallStmt {
576576
mac,
577577
style,
578578
#[match=ignore] attrs,
579-
#[match=ignore] tokens,
579+
#[equiv_mode=ignore] #[match=ignore] #[rewrite_ignore] tokens,
580580
}
581581
struct MacCall { path, args, prior_type_ascription }
582582
enum MacStmtStyle {
@@ -592,7 +592,7 @@ struct MacroDef { body, macro_rules }
592592

593593
enum MacArgs {
594594
Empty,
595-
Delimited(span, delim, #[match=ignore] tokens),
595+
Delimited(span, delim, #[equiv_mode=ignore] #[match=ignore] #[rewrite_ignore] tokens),
596596
Eq(span, value),
597597
}
598598

0 commit comments

Comments
 (0)