Skip to content

Commit

Permalink
Merge #35
Browse files Browse the repository at this point in the history
35: Trust the "i128" feature, and release 0.1.44 r=cuviper a=cuviper

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.

Co-authored-by: Josh Stone <cuviper@gmail.com>
  • Loading branch information
bors[bot] and cuviper committed Oct 29, 2020
2 parents cc05da6 + 1714566 commit 4d166cb
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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/*"]
Expand Down
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,25 @@ 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).

## 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.
10 changes: 10 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
9 changes: 4 additions & 5 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 4d166cb

Please sign in to comment.