@@ -1191,48 +1191,16 @@ macro_rules! json_unexpected {
11911191 ( ) => { } ;
11921192}
11931193
1194- /// possible compiler hint that a branch is likely
1195- #[ cfg( feature = "hints" ) ]
1196- #[ macro_export]
1197- macro_rules! likely {
1198- ( $e: expr) => {
1199- :: std:: intrinsics:: likely( $e)
1200- } ;
1201- }
1202-
12031194/// possible compiler hint that a branch is unlikely
12041195#[ cfg( feature = "hints" ) ]
1205- #[ macro_export]
12061196macro_rules! unlikely {
12071197 ( $e: expr) => { { :: std:: intrinsics:: unlikely( $e) } } ;
12081198}
12091199
1210- /// possible compiler hint that a branch is likely
1211- ///
1212- /// Technique borrowed from here: <https://github.com/rust-lang/hashbrown/pull/209>
1213- #[ cfg( not( feature = "hints" ) ) ]
1214- #[ macro_export]
1215- macro_rules! likely {
1216- ( $e: expr_2021) => { {
1217- #[ inline]
1218- #[ cold]
1219- fn cold( ) { }
1220-
1221- let cond = $e;
1222-
1223- if !cond {
1224- cold( ) ;
1225- }
1226-
1227- cond
1228- } } ;
1229- }
1230-
12311200/// possible compiler hint that a branch is unlikely
12321201///
12331202/// Technique borrowed from here: <https://github.com/rust-lang/hashbrown/pull/209>
12341203#[ cfg( not( feature = "hints" ) ) ]
1235- #[ macro_export]
12361204macro_rules! unlikely {
12371205 ( $e: expr_2021) => { {
12381206 #[ inline]
@@ -1249,61 +1217,60 @@ macro_rules! unlikely {
12491217 } } ;
12501218}
12511219
1252- /// static cast to an i8
1253- #[ macro_export]
1254- macro_rules! static_cast_i8 {
1255- ( $v: expr_2021) => {
1256- :: std:: transmute:: <_, i8 >( $v)
1257- } ;
1258- }
1220+ pub ( crate ) use unlikely;
12591221
12601222/// static cast to an i32
1261- #[ macro_export ]
1223+ #[ allow ( unused_macros ) ]
12621224macro_rules! static_cast_i32 {
12631225 ( $v: expr_2021) => {
12641226 :: std:: mem:: transmute:: <u32 , i32 >( $v)
12651227 } ;
12661228}
1229+ #[ allow( unused_imports) ]
1230+ pub ( crate ) use static_cast_i32;
12671231
12681232/// static cast to an u32
1269- #[ macro_export ]
1233+ #[ allow ( unused_macros ) ]
12701234macro_rules! static_cast_u32 {
12711235 ( $v: expr_2021) => {
12721236 // #[allow(clippy::missing_transmute_annotations)]
12731237 :: std:: mem:: transmute:: <i32 , u32 >( $v)
12741238 } ;
12751239}
1240+ #[ allow( unused_imports) ]
1241+ pub ( crate ) use static_cast_u32;
12761242
12771243/// static cast to an i64
1278- #[ macro_export]
12791244macro_rules! static_cast_i64 {
12801245 ( $v: expr_2021) => {
12811246 :: std:: mem:: transmute:: <u64 , i64 >( $v)
12821247 } ;
12831248}
1249+ pub ( crate ) use static_cast_i64;
12841250
12851251/// static cast to an i64
1286- #[ macro_export ]
1252+ #[ cfg ( all ( feature = "approx-number-parsing" , feature = "i128" ) ) ]
12871253macro_rules! static_cast_i128 {
12881254 ( $v: expr_2021) => {
12891255 :: std:: mem:: transmute:: <_, i128 >( $v)
12901256 } ;
12911257}
1258+ #[ cfg( all( feature = "approx-number-parsing" , feature = "i128" ) ) ]
1259+ pub ( crate ) use static_cast_i128;
12921260
12931261/// static cast to an u64
1294- #[ macro_export]
12951262macro_rules! static_cast_u64 {
12961263 ( $v: expr_2021) => {
12971264 :: std:: mem:: transmute:: <i64 , u64 >( $v)
12981265 } ;
12991266}
1267+ pub ( crate ) use static_cast_u64;
13001268
13011269/// Custom `try!` macro that does no `From` conversions
13021270///
13031271/// FROM serde-json
13041272/// We only use our own error type; no need for From conversions provided by the
13051273/// standard library's try! macro. This reduces lines of LLVM IR by 4%.
1306- #[ macro_export]
13071274macro_rules! stry {
13081275 ( $e: expr_2021) => {
13091276 match $e {
@@ -1312,6 +1279,8 @@ macro_rules! stry {
13121279 }
13131280 } ;
13141281}
1282+ #[ allow( unused_imports) ]
1283+ pub ( crate ) use stry;
13151284
13161285#[ cfg( test) ]
13171286mod test {
0 commit comments