Skip to content

Commit 355707b

Browse files
bors[bot]kpcyrdcuviper
authored
Merge #110
110: Bump dependencies r=cuviper a=kpcyrd This bumps rand and quickcheck to the latest version. We're about to ship num-bigint with this patch applied. Co-authored-by: kpcyrd <[email protected]> Co-authored-by: Josh Stone <[email protected]>
2 parents 480a4da + e7cdb53 commit 355707b

File tree

22 files changed

+219
-263
lines changed

22 files changed

+219
-263
lines changed

.travis.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
language: rust
22
sudo: false
33
rust:
4-
- 1.15.0
5-
- 1.22.0 # rand
6-
- 1.26.0 # has_i128
74
- 1.31.0 # 2018!
5+
- 1.32.0 # rand
6+
- 1.34.0 # quickcheck
87
- 1.36.0 # alloc
98
- stable
109
- beta
@@ -27,7 +26,7 @@ matrix:
2726
before_script:
2827
- rustup target add $TARGET
2928
script:
30-
- cargo build --verbose --target $TARGET --no-default-features --features "i128 serde"
29+
- cargo build --verbose --target $TARGET --no-default-features --features "serde rand"
3130
- name: "rustfmt"
3231
rust: 1.31.0
3332
before_script:

Cargo.toml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,17 @@ name = "shootout-pidigits"
3737
[dependencies.num-integer]
3838
version = "0.1.42"
3939
default-features = false
40+
features = ["i128"]
4041

4142
[dependencies.num-traits]
4243
version = "0.2.11"
4344
default-features = false
45+
features = ["i128"]
4446

4547
[dependencies.rand]
4648
optional = true
47-
version = "0.5"
49+
version = "0.7"
4850
default-features = false
49-
features = ["std"]
5051

5152
[dependencies.serde]
5253
optional = true
@@ -55,17 +56,11 @@ default-features = false
5556

5657
[dependencies.quickcheck]
5758
optional = true
58-
version = "0.8"
59-
default-features = false
60-
61-
[dependencies.quickcheck_macros]
62-
optional = true
63-
version = "0.8"
59+
version = "0.9"
6460
default-features = false
6561

6662
[features]
6763
default = ["std"]
68-
i128 = ["num-integer/i128", "num-traits/i128"]
6964
std = ["num-integer/std", "num-traits/std"]
7065

7166
[build-dependencies]

README.md

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![crate](https://img.shields.io/crates/v/num-bigint.svg)](https://crates.io/crates/num-bigint)
44
[![documentation](https://docs.rs/num-bigint/badge.svg)](https://docs.rs/num-bigint)
5-
![minimum rustc 1.15](https://img.shields.io/badge/rustc-1.15+-red.svg)
5+
![minimum rustc 1.31](https://img.shields.io/badge/rustc-1.31+-red.svg)
66
[![Travis status](https://travis-ci.org/rust-num/num-bigint.svg?branch=master)](https://travis-ci.org/rust-num/num-bigint)
77

88
Big integer types for Rust, `BigInt` and `BigUint`.
@@ -13,7 +13,7 @@ Add this to your `Cargo.toml`:
1313

1414
```toml
1515
[dependencies]
16-
num-bigint = "0.2"
16+
num-bigint = "0.3"
1717
```
1818

1919
and this to your crate root:
@@ -29,30 +29,26 @@ The `std` crate feature is enabled by default, and is mandatory before Rust
2929
`default-features = false`, you must manually enable the `std` feature yourself
3030
if your compiler is not new enough.
3131

32-
Implementations for `i128` and `u128` are only available with Rust 1.26 and
33-
later. The build script automatically detects this, but you can make it
34-
mandatory by enabling the `i128` crate feature.
35-
3632
### Random Generation
3733

3834
`num-bigint` supports the generation of random big integers when the `rand`
3935
feature is enabled. To enable it include rand as
4036

4137
```toml
42-
rand = "0.5"
43-
num-bigint = { version = "0.2", features = ["rand"] }
38+
rand = "0.7"
39+
num-bigint = { version = "0.3", features = ["rand"] }
4440
```
4541

4642
Note that you must use the version of `rand` that `num-bigint` is compatible
47-
with: `0.5`.
43+
with: `0.7`.
4844

4945
## Releases
5046

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

5349
## Compatibility
5450

55-
The `num-bigint` crate is tested for rustc 1.15 and greater.
51+
The `num-bigint` crate is tested for rustc 1.31 and greater.
5652

5753
## Alternatives
5854

@@ -62,7 +58,7 @@ table offers a brief comparison to a few alternatives.
6258

6359
| Crate | License | Min rustc | Implementation |
6460
| :--------------- | :------------- | :-------- | :------------- |
65-
| **`num-bigint`** | MIT/Apache-2.0 | 1.15 | pure rust |
61+
| **`num-bigint`** | MIT/Apache-2.0 | 1.31 | pure rust |
6662
| [`ramp`] | Apache-2.0 | nightly | rust and inline assembly |
6763
| [`rug`] | LGPL-3.0+ | 1.31 | bundles [GMP] via [`gmp-mpfr-sys`] |
6864
| [`rust-gmp`] | MIT | stable? | links to [GMP] |

benches/bigint.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ extern crate test;
99

1010
use num_bigint::{BigInt, BigUint, RandBigInt};
1111
use num_traits::{FromPrimitive, Num, One, Pow, Zero};
12-
use rand::{SeedableRng, StdRng};
12+
use rand::rngs::StdRng;
13+
use rand::SeedableRng;
1314
use std::mem::replace;
1415
use test::Bencher;
1516

benches/gcd.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ extern crate test;
1010
use num_bigint::{BigUint, RandBigInt};
1111
use num_integer::Integer;
1212
use num_traits::Zero;
13-
use rand::{SeedableRng, StdRng};
13+
use rand::rngs::StdRng;
14+
use rand::SeedableRng;
1415
use test::Bencher;
1516

1617
fn get_rng() -> StdRng {

benches/roots.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ extern crate test;
88

99
use num_bigint::{BigUint, RandBigInt};
1010
use num_traits::Pow;
11-
use rand::{SeedableRng, StdRng};
11+
use rand::rngs::StdRng;
12+
use rand::SeedableRng;
1213
use test::Bencher;
1314

1415
// The `big64` cases demonstrate the speed of cases where the value

build.rs

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,9 @@ use std::io::Write;
77
use std::path::Path;
88

99
fn main() {
10-
let ac = autocfg::new();
11-
12-
if ac.probe_type("i128") {
13-
autocfg::emit("has_i128");
14-
15-
let pointer_width = env::var("CARGO_CFG_TARGET_POINTER_WIDTH");
16-
if pointer_width.as_ref().map(String::as_str) == Ok("64") {
17-
autocfg::emit("u64_digit");
18-
}
19-
} else if env::var_os("CARGO_FEATURE_I128").is_some() {
20-
panic!("i128 support was not detected!");
10+
let pointer_width = env::var("CARGO_CFG_TARGET_POINTER_WIDTH");
11+
if pointer_width.as_ref().map(String::as_str) == Ok("64") {
12+
autocfg::emit("u64_digit");
2113
}
2214

2315
autocfg::rerun_path("build.rs");

ci/big_quickcheck/Cargo.toml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[package]
2+
name = "big_quickcheck"
3+
version = "0.1.0"
4+
authors = ["Josh Stone <[email protected]>"]
5+
6+
[dependencies]
7+
num-integer = "0.1.42"
8+
num-traits = "0.2.11"
9+
quickcheck = "0.9"
10+
quickcheck_macros = "0.9"
11+
12+
[dependencies.num-bigint]
13+
features = ["quickcheck"]
14+
path = "../.."

tests/quickcheck.rs renamed to ci/big_quickcheck/src/lib.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1-
#![cfg(feature = "quickcheck")]
2-
#![cfg(feature = "quickcheck_macros")]
1+
//! Quickcheck of `BigUint` and `BigInt`
2+
//!
3+
//! This test is in a completely separate crate so we can use `quickcheck_macros` only when
4+
//! `quickcheck` is active. The main crate can't have optional dev-dependencies, and it's
5+
//! better not to expose it as a "feature" optional dependency.
6+
7+
#![cfg(test)]
38

49
extern crate num_bigint;
510
extern crate num_integer;

ci/big_rand/Cargo.toml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[package]
2+
name = "big_rand"
3+
version = "0.1.0"
4+
authors = ["Josh Stone <[email protected]>"]
5+
6+
[dependencies]
7+
num-traits = "0.2.11"
8+
rand_chacha = "0.2"
9+
rand_isaac = "0.2"
10+
rand_xorshift = "0.2"
11+
12+
[dependencies.num-bigint]
13+
features = ["rand"]
14+
path = "../.."
15+
16+
[dependencies.rand]
17+
features = ["small_rng"]
18+
version = "0.7"

0 commit comments

Comments
 (0)