Skip to content

Commit

Permalink
fix(rust-parse): Fix infinite loop with do_item_user_type
Browse files Browse the repository at this point in the history
  • Loading branch information
chorman0773 committed Aug 2, 2023
1 parent ba1754e commit e8106ed
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions rust/src/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,7 @@ pub fn do_struct_field(

let span = Span::between(start_span, ty.span);
let body = StructField { vis, name, ty };
println!("{:?}", body);
Ok(Spanned { span, body })
}

Expand Down Expand Up @@ -622,6 +623,7 @@ pub fn do_user_type_struct(
end_span = where_clauses.span;
}

println!("before do_constructor");
let ctor = match do_constructor(&mut tree) {
Ok(ctor) => match &ctor.body {
Constructor::Tuple(_) => {
Expand All @@ -638,6 +640,7 @@ pub fn do_user_type_struct(
Err(d) => return Err(d | e),
},
};
println!("after do_constructor");

let span = Span::between(start_span, ctor.span);

Expand Down Expand Up @@ -673,6 +676,7 @@ pub fn do_item_user_type(
},
};
let span = user_type.span; // copy
tree.accept();
Ok(Spanned {
body: ItemBody::UserType(user_type),
span,
Expand Down

0 comments on commit e8106ed

Please sign in to comment.