Skip to content

Commit 3b74d01

Browse files
committed
Assume has_to_int_unchecked
1 parent e4609ed commit 3b74d01

File tree

2 files changed

+0
-13
lines changed

2 files changed

+0
-13
lines changed

build.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@ use std::env;
33
fn main() {
44
let ac = autocfg::new();
55

6-
ac.emit_expression_cfg(
7-
"unsafe { 1f64.to_int_unchecked::<i32>() }",
8-
"has_to_int_unchecked",
9-
);
10-
116
ac.emit_expression_cfg("1u32.reverse_bits()", "has_reverse_bits");
127
ac.emit_expression_cfg("1u32.trailing_ones()", "has_leading_trailing_ones");
138
ac.emit_expression_cfg("1u32.div_euclid(1u32)", "has_div_euclid");

src/cast.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,6 @@ macro_rules! impl_to_primitive_float_to_float {
277277
)*}
278278
}
279279

280-
#[cfg(has_to_int_unchecked)]
281280
macro_rules! float_to_int_unchecked {
282281
// SAFETY: Must not be NaN or infinite; must be representable as the integer after truncating.
283282
// We already checked that the float is in the exclusive range `(MIN-1, MAX+1)`.
@@ -286,13 +285,6 @@ macro_rules! float_to_int_unchecked {
286285
};
287286
}
288287

289-
#[cfg(not(has_to_int_unchecked))]
290-
macro_rules! float_to_int_unchecked {
291-
($float:expr => $int:ty) => {
292-
$float as $int
293-
};
294-
}
295-
296288
macro_rules! impl_to_primitive_float_to_signed_int {
297289
($f:ident : $( $(#[$cfg:meta])* fn $method:ident -> $i:ident ; )*) => {$(
298290
#[inline]

0 commit comments

Comments
 (0)