-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Display {integer}::MIN/MAX in integer range suggestions rather than the expanded value #56393
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
Comments
This was referenced Nov 30, 2018
zackmdavis
added a commit
to zackmdavis/rust
that referenced
this issue
Dec 23, 2018
While many programmers may intuitively appreciate the significance of magic numbers like −2147483648, Rust is about empowering everyone to build reliable and efficient software! It's a bit more legible to print the constant names. The `max_as_i128`, &c. methods strewn in libsyntax are a bit unsightly, but I fear this is really the most natural way to solve the problem. Resolves rust-lang#56393.
zackmdavis
added a commit
to zackmdavis/rust
that referenced
this issue
Dec 23, 2018
While many programmers may intuitively appreciate the significance of magic numbers like −2147483648, Rust is about empowering everyone to build reliable and efficient software! It's a bit more legible to print the constant names. The `max_as_i128`, &c. methods strewn in libsyntax are a bit unsightly, but I fear this is really the most natural way to solve the problem. Resolves rust-lang#56393.
zackmdavis
added a commit
to zackmdavis/rust
that referenced
this issue
Aug 7, 2019
While many programmers may intuitively appreciate the significance of "magic numbers" like −2147483648, Rust is about empowering everyone to build reliable and efficient software! It's a bit more legible to print the constant names (even noisy fully-qualified-paths thereof). The bit-manipulation methods mirror those in `librustc_mir::hair::pattern::_match::all_constructors`; thanks to the immortal Varkor for guidance. Resolves rust-lang#56393.
bors
added a commit
that referenced
this issue
Aug 7, 2019
…_cognition, r=varkor pretty-pretty extremal constants! (A resurrection of the defunct #57073.) While many programmers may intuitively appreciate the significance of "magic numbers" like −2147483648, Rust is about empowering everyone to build reliable and efficient software! It's a bit more legible to print the constant names (even noisy fully-qualified-paths thereof). The bit-manipulation methods mirror those in `librustc_mir::hair::pattern::_match::all_constructors`; thanks to the immortal Varkor for guidance. Resolves #56393. r? @varkor
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Once exhaustive integer matching has been stabilised, we'll be getting errors like this:
It would be nicer to display these as
::std::i32::MIN
(or::core
, etc.) instead (or provide a hint telling the user this).See https://github.com/rust-lang/rust/pull/56362/files/4fc5758a67e38b21e975fc9efe071dd58f4b98c6#diff-1d41dba9e92e851833cbeb40c504a40b for instance, where we display
-2147483648i32
rather than::std::i32::MIN
.The text was updated successfully, but these errors were encountered: