Skip to content

Commit ccbbf7d

Browse files
committed
Assume 128-bit integer support
1 parent 85f6e98 commit ccbbf7d

File tree

7 files changed

+2
-22
lines changed

7 files changed

+2
-22
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ matrix:
1818
before_script:
1919
- rustup target add $TARGET
2020
script:
21-
- cargo build --verbose --target $TARGET --no-default-features --features i128,rand,serde
21+
- cargo build --verbose --target $TARGET --no-default-features --features rand,serde
2222
- name: "rustfmt"
2323
rust: 1.31.0
2424
before_script:

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ features = ["std", "serde", "rand"]
2222
[dependencies.num-traits]
2323
version = "0.2.11"
2424
default-features = false
25+
features = ["i128"]
2526

2627
[dependencies.serde]
2728
optional = true
@@ -35,7 +36,6 @@ default-features = false
3536

3637
[features]
3738
default = ["std"]
38-
i128 = ["num-traits/i128"]
3939
std = ["num-traits/std"]
4040

4141
[build-dependencies]

README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,6 @@ Features based on `Float` types are only available when `std` is enabled. Where
3737
possible, `FloatCore` is used instead. Formatting complex numbers only supports
3838
format width when `std` is enabled.
3939

40-
Implementations for `i128` and `u128` are only available with Rust 1.26 and
41-
later. The build script automatically detects this, but you can make it
42-
mandatory by enabling the `i128` crate feature.
43-
4440
## Releases
4541

4642
Release notes are available in [RELEASES.md](RELEASES.md).

build.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,8 @@
11
extern crate autocfg;
22

3-
use std::env;
4-
53
fn main() {
64
let ac = autocfg::new();
75

8-
if ac.probe_type("i128") {
9-
println!("cargo:rustc-cfg=has_i128");
10-
} else if env::var_os("CARGO_FEATURE_I128").is_some() {
11-
panic!("i128 support was not detected!");
12-
}
13-
146
// autocfg doesn't have a direct way to probe for `const fn` yet.
157
if ac.probe_rustc_version(1, 31) {
168
autocfg::emit("has_const_fn");

src/cast.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ impl<T: ToPrimitive + Num> ToPrimitive for Complex<T> {
2222
impl_to_primitive!(i16, to_i16);
2323
impl_to_primitive!(i32, to_i32);
2424
impl_to_primitive!(i64, to_i64);
25-
#[cfg(has_i128)]
2625
impl_to_primitive!(u128, to_u128);
27-
#[cfg(has_i128)]
2826
impl_to_primitive!(i128, to_i128);
2927
impl_to_primitive!(f32, to_f32);
3028
impl_to_primitive!(f64, to_f64);
@@ -53,9 +51,7 @@ impl<T: FromPrimitive + Num> FromPrimitive for Complex<T> {
5351
impl_from_primitive!(i16, from_i16);
5452
impl_from_primitive!(i32, from_i32);
5553
impl_from_primitive!(i64, from_i64);
56-
#[cfg(has_i128)]
5754
impl_from_primitive!(u128, from_u128);
58-
#[cfg(has_i128)]
5955
impl_from_primitive!(i128, from_i128);
6056
impl_from_primitive!(f32, from_f32);
6157
impl_from_primitive!(f64, from_f64);

src/lib.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1086,9 +1086,6 @@ impl<T: Clone + Num> Rem<T> for Complex<T> {
10861086
}
10871087
}
10881088

1089-
#[cfg(not(has_i128))]
1090-
real_arithmetic!(usize, u8, u16, u32, u64, isize, i8, i16, i32, i64, f32, f64);
1091-
#[cfg(has_i128)]
10921089
real_arithmetic!(usize, u8, u16, u32, u64, u128, isize, i8, i16, i32, i64, i128, f32, f64);
10931090

10941091
/* constants */

src/pow.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ pow_impl!(u16, i16);
7676
pow_impl!(u32, i32);
7777
pow_impl!(u64, i64);
7878
pow_impl!(usize, isize);
79-
#[cfg(has_i128)]
8079
pow_impl!(u128, i128);
8180

8281
// Note: we can't add `impl<T: Float> Pow<T> for Complex<T>` because new blanket impls are a

0 commit comments

Comments
 (0)