Skip to content

Internal error panic when parsing "impl<x<>>::x for" malformed syn::File #1108

Closed
@5225225

Description

@5225225

Found by a fuzzer, it looks to me that fuzzer panics are valid as long as they're not stack overflows. (Considered adding a fuzzer with a length limit and a comment saying as much? Could also test for round-tripping to some extent). Tried to minimise it as much as I can, but i can't do any more than this.

Test case:

#[test]
fn parse() {
    let data = "impl<x<>>::x for";
    
    let _: Result<syn::File, _> = syn::parse_str(data);
}

❤️

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions