diff --git a/Cargo.toml b/Cargo.toml index 9feed18..4ff8291 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,10 +5,10 @@ documentation = "https://docs.rs/num-integer" homepage = "https://github.com/rust-num/num-integer" keywords = ["mathematics", "numerics"] categories = ["algorithms", "science", "no-std"] -license = "MIT/Apache-2.0" +license = "MIT OR Apache-2.0" repository = "https://github.com/rust-num/num-integer" name = "num-integer" -version = "0.1.43" +version = "0.1.44" readme = "README.md" build = "build.rs" exclude = ["/bors.toml", "/ci/*", "/.github/*"] diff --git a/README.md b/README.md index 249d5f0..5f638cd 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,6 @@ Implementations for `i128` and `u128` are only available with Rust 1.26 and later. The build script automatically detects this, but you can make it mandatory by enabling the `i128` crate feature. - ## Releases Release notes are available in [RELEASES.md](RELEASES.md). @@ -48,3 +47,18 @@ Release notes are available in [RELEASES.md](RELEASES.md). ## Compatibility The `num-integer` crate is tested for rustc 1.8 and greater. + +## License + +Licensed under either of + + * [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0) + * [MIT license](http://opensource.org/licenses/MIT) + +at your option. + +### Contribution + +Unless you explicitly state otherwise, any contribution intentionally submitted +for inclusion in the work by you, as defined in the Apache-2.0 license, shall be +dual licensed as above, without any additional terms or conditions. diff --git a/RELEASES.md b/RELEASES.md index 7273696..05be073 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1,3 +1,13 @@ +# Release 0.1.44 (2020-10-29) + +- [The "i128" feature now bypasses compiler probing][35]. The build script + used to probe anyway and panic if requested support wasn't found, but + sometimes this ran into bad corner cases with `autocfg`. + +**Contributors**: @cuviper + +[35]: https://github.com/rust-num/num-integer/pull/35 + # Release 0.1.43 (2020-06-11) - [The new `Average` trait][31] computes fast integer averages, rounded up or diff --git a/build.rs b/build.rs index e483c15..37c9857 100644 --- a/build.rs +++ b/build.rs @@ -3,11 +3,10 @@ extern crate autocfg; use std::env; fn main() { - let ac = autocfg::new(); - if ac.probe_type("i128") { - println!("cargo:rustc-cfg=has_i128"); - } else if env::var_os("CARGO_FEATURE_I128").is_some() { - panic!("i128 support was not detected!"); + // If the "i128" feature is explicity requested, don't bother probing for it. + // It will still cause a build error if that was set improperly. + if env::var_os("CARGO_FEATURE_I128").is_some() || autocfg::new().probe_type("i128") { + autocfg::emit("has_i128"); } autocfg::rerun_path("build.rs");