Skip to content

Integer constant treated as 16 bit #4401

Closed
@d3zd3z

Description

@d3zd3z

The following code prints 16959 instead of 999999 (999999 & 0xFFFF == 16959).

fn main() {
    let mut count = 0;
    for 999_999.times() {
        count += 1;
    }
    io::println(fmt!("%u", count));
}

Tested as of 09bb07b (I'm building tip now to reteset)

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