Skip to content

TokenStream::from_str does not return an error on invalid tokens #168

@canndrew

Description

@canndrew

I tried passing some text which contains invalid Rust tokens to TokenStream::from_str hoping that I could inspect the Err variant to get information on where the lex error is. Instead from_str prints directly to stderr and panics.

This method should probably give me the option to handle the error myself since I can always .unwrap() if I want to.

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