Skip to content

Integer constant treated as 16 bit #4401

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
d3zd3z opened this issue Jan 9, 2013 · 1 comment
Closed

Integer constant treated as 16 bit #4401

d3zd3z opened this issue Jan 9, 2013 · 1 comment

Comments

@d3zd3z
Copy link

d3zd3z commented Jan 9, 2013

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)

@nikomatsakis
Copy link
Contributor

Dup of #3211 (but thank you!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants