Skip to content

Commit

Permalink
Silence lint in fit_signed and fit_unsigned
Browse files Browse the repository at this point in the history
  • Loading branch information
estebank committed Oct 16, 2019
1 parent 220b9b2 commit 916936c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/librustc_target/abi/mod.rs
Expand Up @@ -488,6 +488,7 @@ impl Integer {

/// Finds the smallest Integer type which can represent the signed value.
pub fn fit_signed(x: i128) -> Integer {
#[cfg_attr(not(stage0), allow(overlapping_patterns))]
match x {
-0x0000_0000_0000_0080..=0x0000_0000_0000_007f => I8,
-0x0000_0000_0000_8000..=0x0000_0000_0000_7fff => I16,
Expand All @@ -499,6 +500,7 @@ impl Integer {

/// Finds the smallest Integer type which can represent the unsigned value.
pub fn fit_unsigned(x: u128) -> Integer {
#[cfg_attr(not(stage0), allow(overlapping_patterns))]
match x {
0..=0x0000_0000_0000_00ff => I8,
0..=0x0000_0000_0000_ffff => I16,
Expand Down

0 comments on commit 916936c

Please sign in to comment.