Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 1df9b8a

Browse files
committedSep 4, 2023
Create node Item and AdtDef for anonymous adts
1 parent b2da370 commit 1df9b8a

File tree

51 files changed

+195
-328
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+195
-328
lines changed
 

‎compiler/rustc_ast/src/ast.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2093,9 +2093,9 @@ pub enum TyKind {
20932093
/// A tuple (`(A, B, C, D,...)`).
20942094
Tup(ThinVec<P<Ty>>),
20952095
/// An anonymous struct type i.e. `struct { foo: Type }`
2096-
AnonStruct(ThinVec<FieldDef>),
2096+
AnonStruct(NodeId, ThinVec<FieldDef>),
20972097
/// An anonymous union type i.e. `union { bar: Type }`
2098-
AnonUnion(ThinVec<FieldDef>),
2098+
AnonUnion(NodeId, ThinVec<FieldDef>),
20992099
/// A path (`module::module::...::Type`), optionally
21002100
/// "qualified", e.g., `<Vec<T> as SomeTrait>::SomeType`.
21012101
///

‎compiler/rustc_ast/src/mut_visit.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,8 @@ pub fn noop_visit_ty<T: MutVisitor>(ty: &mut P<Ty>, vis: &mut T) {
509509
visit_vec(bounds, |bound| vis.visit_param_bound(bound));
510510
}
511511
TyKind::MacCall(mac) => vis.visit_mac_call(mac),
512-
TyKind::AnonStruct(fields) | TyKind::AnonUnion(fields) => {
512+
TyKind::AnonStruct(id, fields) | TyKind::AnonUnion(id, fields) => {
513+
vis.visit_id(id);
513514
fields.flat_map_in_place(|field| vis.flat_map_field_def(field));
514515
}
515516
}

0 commit comments

Comments
 (0)
Please sign in to comment.