Skip to content

Non-decimal ints with suffixes fail to parse #599

@Not-A-Normal-Robot

Description

@Not-A-Normal-Robot

Cargo.toml src/main.rs
[package]
name = "rontest"
version = "0.1.0"
edition = "2024"

[dependencies]
ron = "0.12"

fn main() {
  assert_eq!(
    ron::from_str::("0xAu32"),
    Ok(0xAu32)
  );
}

Result:

$ cargo r
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.01s
     Running `target/debug/rontest`

thread 'main' (741474) panicked at src/main.rs:2:3:
assertion `left == right` failed
  left: Err(SpannedError { code: TrailingCharacters, span: Span { start: Position { line: 1, col: 4 }, end: Position { line: 1, col: 4 } } })
 right: Ok(10)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions