Skip to content

i64::MIN literal out of range warning #16684

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
mahkoh opened this issue Aug 22, 2014 · 3 comments · Fixed by #17013
Closed

i64::MIN literal out of range warning #16684

mahkoh opened this issue Aug 22, 2014 · 3 comments · Fixed by #17013
Labels
A-lints Area: Lints (warnings about flaws in source code) such as unused_mut.

Comments

@mahkoh
Copy link
Contributor

mahkoh commented Aug 22, 2014

let x: i64 = -9223372036854775808;
warning: literal out of range for its type, #[warn(type_overflow)] on by default
@robertg
Copy link

robertg commented Aug 29, 2014

I was investigating this, and somewhere along the linting it basically ends up being a node representing +9223372036854775808, which would clearly cause this warning message.

I will continue working on this.

@mahkoh
Copy link
Contributor Author

mahkoh commented Aug 29, 2014

I guess that's right. When you look at the rustc output you can see that only the digits but not the - are underlined.

@robertg
Copy link

robertg commented Sep 5, 2014

So regarding the above, it actually wasn't the case where the AST was broken. It was rather that we weren't utilizing the propagated sign properly.

robertg pushed a commit to robertg/rust that referenced this issue Sep 5, 2014
 - Ensures the propagated negation sign is properly utilized during type
   checking.
 - Removed redundant type checking, specifically regarding the out of bounds checking
   on a bounded type.
 - Closes rust-lang#16684
bors added a commit to rust-lang-ci/rust that referenced this issue Mar 3, 2024
fix: Don't panic on synthetic syntax in inference diagnostics

Temporary fix for rust-lang/rust-analyzer#16682

We ought to rethink how we attach diagnostics to things, as IDs don't work for `format_args` like that!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lints Area: Lints (warnings about flaws in source code) such as unused_mut.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants