Skip to content

0e+10 is invalid whereas 00e+10 is valid #40408

Closed
@qnighy

Description

@qnighy

I found this line in the lexer prevents 0e+10 to be parsed as a float, whereas 00e+10 is allowed anyway. Is this a bug or an intended behavior?

This is a code I tested on Rust Playground:

fn main() {
  // OK
  println!("{}", 0);
  // OK
  println!("{}", 00e+10);
  // Parse Error
  println!("{}", 0e+10);
}

It seems natural that both of them are banned or both of them are allowed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions