Skip to content

Commit 0df813f

Browse files
committed
rust: update num-traits to 0.2.15
1 parent 129b7bc commit 0df813f

File tree

13 files changed

+885
-286
lines changed

13 files changed

+885
-286
lines changed

src/rust/Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"files":{"Cargo.toml":"25ae881cd00d94ea9f9cb7844f32e3e58871fc9e45769ead9820d8d40c342ddb","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb","README.md":"dd03422a366071c147d9dec73f01ba8299ccf963a0b038eb85520908d9cd028c","RELEASES.md":"8be8fef421245ea7d9e8a4ab89056307095bfbc9730ca175a75968e6d01b68e4","build.rs":"14cb861026b2493f7b39e0f72ced0ccb95c9a5fd0bdce3158f23a27dac7577e8","src/bounds.rs":"4fbc6bf3550e4da7ef55c9eb96466c6e0aee7f7542d7c85cfd742f16e3b4729f","src/cast.rs":"8c8384dcdfaf926b9331399d528278fc73851f8b5e1105dee343f4f19557e932","src/float.rs":"73cc27228e7578d537c00b9b46e124e365c569a53a7e160fe0d1ad1dacf54fc8","src/identities.rs":"5b6238ebd52e1fadd5b405bc40ad81e45346bcb1c4b46cf1f0496a30be7c9bc4","src/int.rs":"c6e042ac4614529f07b0009271a6b97378451d6d3998e1dc407e76f9a050aa2d","src/lib.rs":"5ff4c0694c7db0538fdca2eb8290ecca4a05e0357607dd4bd078b2b762241094","src/macros.rs":"b589a98c2468ca98131c641a058601964c4e82d75129b1c16fdc17aca8779eca","src/ops/checked.rs":"b6dfae21fe1a5ce41e92074c57d204284975ec56d45e63cac5f0136b8c3643b4","src/ops/inv.rs":"dd80b9bd48d815f17855a25842287942317fa49d1fdcdd655b61bd20ef927cda","src/ops/mod.rs":"fd33030d6e5bd50b9797112b63d14e49ce53a61dd9cc88205c942fa79cb18cf5","src/ops/mul_add.rs":"368bdebb40b16f3b4b85cf50235954268ff601ec7a458a3a83fe433f47f86f6d","src/ops/overflowing.rs":"1b92882a5a738ea4cafdb0971101dc438be9043f540e1246f58f7c9ecf6348dc","src/ops/saturating.rs":"6fb4b2a2c78d9202152a84586d7b068444b78d3caed4b293980832672a234d4b","src/ops/wrapping.rs":"0acf88c0e5fc81a3c6790b31986ab9be5b16c720c9e27461fe5d69b710ffcaba","src/pow.rs":"9f78cb9c4d5987b59e16f4141723a33ff689781cc352f357b0cc0111d22cde3a","src/real.rs":"b5115bb2cfb752a59426bb3fcbabf9cff15521a00a3f8b5ef4dfc0b0b31bb1f4","src/sign.rs":"83562caa3501c6873558eb64c9e3bfe25b4b20d38562a7aa7cc9adafcb3ff037","tests/cast.rs":"0a41785611b3909ecb4a88d6d5264a85564f6de8fbfc761436d3c8baafc8e3d0"},"package":"9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290"}
1+
{"files":{"Cargo.toml":"5b2749641deeabb2dfcc8e4d7e26ccfbc306800021e0d24e8367f313e57f9def","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb","README.md":"81e7df6fa6bea6f8c2809f9af68e3d32e7a4504b93394f775d37ed3d9f7f9166","RELEASES.md":"e1f774cba66e5e15e1086ab8afebece771140dd4168f59dca8dd4fd5e50b72dc","build.rs":"cf682b2322303196e241048cb56d873597b78a3b4e3f275f6f761dadb33a65f5","src/bounds.rs":"c90190de4dfba13c49119dbdf889726f8ece1cbd7dfd4bbfa364ea995f627e49","src/cast.rs":"8c8384dcdfaf926b9331399d528278fc73851f8b5e1105dee343f4f19557e932","src/float.rs":"6a84820f4828515639565848a63359b3e69329aa36b990178adbfc7d141ef0c5","src/identities.rs":"5b6238ebd52e1fadd5b405bc40ad81e45346bcb1c4b46cf1f0496a30be7c9bc4","src/int.rs":"bb4c0f4ce8d71e262bd9119ab820dd5a79e2bd476a8ad7e84b2167733b11d9d8","src/lib.rs":"cc0c8352b3f29a22b17f76e9cfe12acb279ec2aac5e22a9395569d58445c137c","src/macros.rs":"ee96613a2c73a3bef10ec7ae4d359dbf5f0b41f83e8a87c3d62ccc18dd27e498","src/ops/checked.rs":"b6dfae21fe1a5ce41e92074c57d204284975ec56d45e63cac5f0136b8c3643b4","src/ops/euclid.rs":"71e0e181bd365c196a7dea980c2ec8bd47fd1d1d9b47bd3f401edcadb861eb0b","src/ops/inv.rs":"dd80b9bd48d815f17855a25842287942317fa49d1fdcdd655b61bd20ef927cda","src/ops/mod.rs":"3bea8b98fa7537c0a5b4562d1b9d4d49481f1e2e88941cfd4cc8f0f3f0870fb3","src/ops/mul_add.rs":"368bdebb40b16f3b4b85cf50235954268ff601ec7a458a3a83fe433f47f86f6d","src/ops/overflowing.rs":"1b92882a5a738ea4cafdb0971101dc438be9043f540e1246f58f7c9ecf6348dc","src/ops/saturating.rs":"6fb4b2a2c78d9202152a84586d7b068444b78d3caed4b293980832672a234d4b","src/ops/wrapping.rs":"0acf88c0e5fc81a3c6790b31986ab9be5b16c720c9e27461fe5d69b710ffcaba","src/pow.rs":"9f78cb9c4d5987b59e16f4141723a33ff689781cc352f357b0cc0111d22cde3a","src/real.rs":"b5115bb2cfb752a59426bb3fcbabf9cff15521a00a3f8b5ef4dfc0b0b31bb1f4","src/sign.rs":"83562caa3501c6873558eb64c9e3bfe25b4b20d38562a7aa7cc9adafcb3ff037","tests/cast.rs":"0a41785611b3909ecb4a88d6d5264a85564f6de8fbfc761436d3c8baafc8e3d0"},"package":"578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd"}

src/rust/vendor/num-traits/Cargo.toml

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,45 @@
33
# When uploading crates to the registry Cargo will automatically
44
# "normalize" Cargo.toml files for maximal compatibility
55
# with all versions of Cargo and also rewrite `path` dependencies
6-
# to registry (e.g., crates.io) dependencies
6+
# to registry (e.g., crates.io) dependencies.
77
#
8-
# If you believe there's an error in this file please file an
9-
# issue against the rust-lang/cargo repository. If you're
10-
# editing this file be aware that the upstream Cargo.toml
11-
# will likely look very different (and much more reasonable)
8+
# If you are reading this file be aware that the original Cargo.toml
9+
# will likely look very different (and much more reasonable).
10+
# See Cargo.toml.orig for the original contents.
1211

1312
[package]
1413
name = "num-traits"
15-
version = "0.2.14"
14+
version = "0.2.15"
1615
authors = ["The Rust Project Developers"]
1716
build = "build.rs"
18-
exclude = ["/bors.toml", "/ci/*", "/.github/*"]
17+
exclude = [
18+
"/bors.toml",
19+
"/ci/*",
20+
"/.github/*",
21+
]
1922
description = "Numeric traits for generic mathematics"
2023
homepage = "https://github.com/rust-num/num-traits"
2124
documentation = "https://docs.rs/num-traits"
2225
readme = "README.md"
23-
keywords = ["mathematics", "numerics"]
24-
categories = ["algorithms", "science", "no-std"]
26+
keywords = [
27+
"mathematics",
28+
"numerics",
29+
]
30+
categories = [
31+
"algorithms",
32+
"science",
33+
"no-std",
34+
]
2535
license = "MIT OR Apache-2.0"
2636
repository = "https://github.com/rust-num/num-traits"
37+
2738
[package.metadata.docs.rs]
2839
features = ["std"]
40+
2941
[dependencies.libm]
3042
version = "0.2.0"
3143
optional = true
44+
3245
[build-dependencies.autocfg]
3346
version = "1"
3447

src/rust/vendor/num-traits/README.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,6 @@ Add this to your `Cargo.toml`:
1616
num-traits = "0.2"
1717
```
1818

19-
and this to your crate root:
20-
21-
```rust
22-
extern crate num_traits;
23-
```
24-
2519
## Features
2620

2721
This crate can be used without the standard library (`#![no_std]`) by disabling

src/rust/vendor/num-traits/RELEASES.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,31 @@
1+
# Release 0.2.15 (2022-05-02)
2+
3+
- [The new `Euclid` trait calculates Euclidean division][195], where the
4+
remainder is always positive or zero.
5+
- [The new `LowerBounded` and `UpperBounded` traits][210] separately describe
6+
types with lower and upper bounds. These traits are automatically implemented
7+
for all fully-`Bounded` types.
8+
- [The new `Float::copysign` method copies the sign of the argument][207] to
9+
to the magnitude of `self`.
10+
- [The new `PrimInt::leading_ones` and `trailing_ones` methods][205] are the
11+
complement of the existing methods that count zero bits.
12+
- [The new `PrimInt::reverse_bits` method reverses the order of all bits][202]
13+
of a primitive integer.
14+
- [Improved `Num::from_str_radix` for floats][201], also [ignoring case][214].
15+
- [`Float` and `FloatCore` use more from `libm`][196] when that is enabled.
16+
17+
**Contributors**: @alion02, @clarfonthey, @cuviper, @ElectronicRU,
18+
@ibraheemdev, @SparrowLii, @sshilovsky, @tspiteri, @XAMPPRocky, @Xiretza
19+
20+
[195]: https://github.com/rust-num/num-traits/pull/195
21+
[196]: https://github.com/rust-num/num-traits/pull/196
22+
[201]: https://github.com/rust-num/num-traits/pull/201
23+
[202]: https://github.com/rust-num/num-traits/pull/202
24+
[205]: https://github.com/rust-num/num-traits/pull/205
25+
[207]: https://github.com/rust-num/num-traits/pull/207
26+
[210]: https://github.com/rust-num/num-traits/pull/210
27+
[214]: https://github.com/rust-num/num-traits/pull/214
28+
129
# Release 0.2.14 (2020-10-29)
230

331
- Clarify the license specification as "MIT OR Apache-2.0".

src/rust/vendor/num-traits/build.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,14 @@ fn main() {
1616
"has_to_int_unchecked",
1717
);
1818

19+
ac.emit_expression_cfg("1u32.reverse_bits()", "has_reverse_bits");
20+
ac.emit_expression_cfg("1u32.trailing_ones()", "has_leading_trailing_ones");
21+
ac.emit_expression_cfg("{ let mut x = 1; x += &2; }", "has_int_assignop_ref");
22+
ac.emit_expression_cfg("1u32.div_euclid(1u32)", "has_div_euclid");
23+
24+
if env::var_os("CARGO_FEATURE_STD").is_some() {
25+
ac.emit_expression_cfg("1f64.copysign(-1f64)", "has_copysign");
26+
}
27+
1928
autocfg::rerun_path("build.rs");
2029
}

src/rust/vendor/num-traits/src/bounds.rs

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,38 @@ use core::{u16, u32, u64, u8, usize};
88
/// Numbers which have upper and lower bounds
99
pub trait Bounded {
1010
// FIXME (#5527): These should be associated constants
11-
/// returns the smallest finite number this type can represent
11+
/// Returns the smallest finite number this type can represent
1212
fn min_value() -> Self;
13-
/// returns the largest finite number this type can represent
13+
/// Returns the largest finite number this type can represent
1414
fn max_value() -> Self;
1515
}
1616

17+
/// Numbers which have lower bounds
18+
pub trait LowerBounded {
19+
/// Returns the smallest finite number this type can represent
20+
fn min_value() -> Self;
21+
}
22+
23+
// FIXME: With a major version bump, this should be a supertrait instead
24+
impl<T: Bounded> LowerBounded for T {
25+
fn min_value() -> T {
26+
Bounded::min_value()
27+
}
28+
}
29+
30+
/// Numbers which have upper bounds
31+
pub trait UpperBounded {
32+
/// Returns the largest finite number this type can represent
33+
fn max_value() -> Self;
34+
}
35+
36+
// FIXME: With a major version bump, this should be a supertrait instead
37+
impl<T: Bounded> UpperBounded for T {
38+
fn max_value() -> T {
39+
Bounded::max_value()
40+
}
41+
}
42+
1743
macro_rules! bounded_impl {
1844
($t:ty, $min:expr, $max:expr) => {
1945
impl Bounded for $t {

0 commit comments

Comments
 (0)