pretty-pretty extremal constants!

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.
This commit is contained in:
Zack M. Davis
2019-07-06 19:41:12 -07:00
parent c326c2e0f1
commit d1cdb02e4d
12 changed files with 62 additions and 45 deletions

View File

@@ -3,5 +3,5 @@ fn func((1, (Some(1), 2..=3)): (isize, (Option<isize>, isize))) { }
fn main() {
let (1, (Some(1), 2..=3)) = (1, (None, 2));
//~^ ERROR refutable pattern in local binding: `(-2147483648i32..=0i32, _)` not covered
//~^ ERROR refutable pattern in local binding: `(std::i32::MIN..=0i32, _)` not covered
}