From 916936c77488d0a75cc254b5bdc9a787c8ed8768 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Esteban=20K=C3=BCber?= Date: Thu, 29 Aug 2019 17:20:20 -0700 Subject: [PATCH] Silence lint in `fit_signed` and `fit_unsigned` --- src/librustc_target/abi/mod.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/librustc_target/abi/mod.rs b/src/librustc_target/abi/mod.rs index fde5c5bed4d9..2feee73847df 100644 --- a/src/librustc_target/abi/mod.rs +++ b/src/librustc_target/abi/mod.rs @@ -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, @@ -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,