Skip to content

Invalid integer literals are accepted #506

@kryptan

Description

@kryptan

Integer literals with suffix starting with e are accepted by proc_macro2 but not by proc_macro or Rust compiler.

    let _: TokenStream = "0einvalidSuffix".parse().unwrap();

This parses with proc_macro2 but panics with proc_macro.

Such literals are also rejected by Rust compiler: playground.

According to Rust reference INTEGER_LITERAL must end with SUFFIX_NO_E.

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