Skip to content

Commit

Permalink
Merge pull request #1109 from dtolnay/implqself
Browse files Browse the repository at this point in the history
Fix parsing trait impl with qself in trait type
  • Loading branch information
dtolnay authored Dec 22, 2021
2 parents 548d2d9 + 650fcff commit 04fdba9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2455,7 +2455,7 @@ pub mod parsing {
while let Type::Group(ty) = first_ty_ref {
first_ty_ref = &ty.elem;
}
if let Type::Path(_) = first_ty_ref {
if let Type::Path(TypePath { qself: None, .. }) = first_ty_ref {
while let Type::Group(ty) = first_ty {
first_ty = *ty.elem;
}
Expand Down
5 changes: 5 additions & 0 deletions tests/regression/issue1108.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#[test]
fn issue1108() {
let data = "impl<x<>>::x for";
let _ = syn::parse_file(data);
}

0 comments on commit 04fdba9

Please sign in to comment.