From owner-dev-commits-ports-main@freebsd.org Sat Jun 19 15:15:12 2021 Return-Path: Delivered-To: dev-commits-ports-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D5FB665B70C; Sat, 19 Jun 2021 15:15:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G6fVS3w6Nz3t9s; Sat, 19 Jun 2021 15:15:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5DD4718657; Sat, 19 Jun 2021 15:15:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15JFFC23067006; Sat, 19 Jun 2021 15:15:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15JFFC6Y067005; Sat, 19 Jun 2021 15:15:12 GMT (envelope-from git) Date: Sat, 19 Jun 2021 15:15:12 GMT Message-Id: <202106191515.15JFFC6Y067005@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Tobias Kortkamp Subject: git: 3de77d5f0c45 - main - shells/ion: Unbreak with Rust 1.53.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tobik X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3de77d5f0c458d11681daae6d1e04539538b82da Auto-Submitted: auto-generated X-BeenThere: dev-commits-ports-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the main branch of the FreeBSD ports repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jun 2021 15:15:12 -0000 The branch main has been updated by tobik: URL: https://cgit.FreeBSD.org/ports/commit/?id=3de77d5f0c458d11681daae6d1e04539538b82da commit 3de77d5f0c458d11681daae6d1e04539538b82da Author: Tobias Kortkamp AuthorDate: 2021-06-19 11:55:32 +0000 Commit: Tobias Kortkamp CommitDate: 2021-06-19 15:13:18 +0000 shells/ion: Unbreak with Rust 1.53.0 errorr[E0308]: mismatched types --> cargo-crates/lexical-core-0.4.2/src/atof/algorithm/bigcomp.rs:242:55 | 242 | let nlz = den.leading_zeros().wrapping_sub(wlz) & (u32::BITS - 1); | ^^^^^^^^^^^^^^^ expected `usize`, found `u32` error[E0277]: no implementation for `usize & u32` http://package18.nyi.freebsd.org/data/122amd64-default-foo/2021-06-18_08h51m30s/logs/errors/ion-shell-1.0.5.1355_20.log PR: 256653 --- ...exical-core-0.4.2_src_atof_algorithm_bigcomp.rs | 39 ++++ ...lexical-core-0.4.2_src_atof_algorithm_bigint.rs | 11 ++ ...s_lexical-core-0.4.2_src_atof_algorithm_math.rs | 211 +++++++++++++++++++++ 3 files changed, 261 insertions(+) diff --git a/shells/ion/files/patch-cargo-crates_lexical-core-0.4.2_src_atof_algorithm_bigcomp.rs b/shells/ion/files/patch-cargo-crates_lexical-core-0.4.2_src_atof_algorithm_bigcomp.rs new file mode 100644 index 000000000000..de43fa43e954 --- /dev/null +++ b/shells/ion/files/patch-cargo-crates_lexical-core-0.4.2_src_atof_algorithm_bigcomp.rs @@ -0,0 +1,39 @@ +error[E0308]: mismatched types + --> cargo-crates/lexical-core-0.4.2/src/atof/algorithm/bigcomp.rs:242:55 + | +242 | let nlz = den.leading_zeros().wrapping_sub(wlz) & (u32::BITS - 1); + | ^^^^^^^^^^^^^^^ expected `usize`, found `u32` + +error[E0277]: no implementation for `usize & u32` + +https://github.com/Alexhuszagh/rust-lexical/commit/05f2cf96b080a81e2bee1f30ae389dc4f9cb6d00 + +--- cargo-crates/lexical-core-0.4.2/src/atof/algorithm/bigcomp.rs.orig 2021-06-19 11:52:10 UTC ++++ cargo-crates/lexical-core-0.4.2/src/atof/algorithm/bigcomp.rs +@@ -239,7 +239,7 @@ pub(super) fn make_ratio(radix: u32, sci_exp + // Scale the denominator so it has the number of bits + // in the radix as the number of leading zeros. + let wlz = integral_binary_factor(radix).as_usize(); +- let nlz = den.leading_zeros().wrapping_sub(wlz) & (u32::BITS - 1); ++ let nlz = den.leading_zeros().wrapping_sub(wlz) & (::BITS - 1); + small::ishl_bits(den.data_mut(), nlz); + den.exp -= nlz.as_i32(); + +@@ -257,7 +257,7 @@ pub(super) fn make_ratio(radix: u32, sci_exp + // denominator will be normalized. + // We need to add one to the quotient,since we're calculating the + // ceiling of the divmod. +- let (q, r) = shift.ceil_divmod(Limb::BITS); ++ let (q, r) = shift.ceil_divmod(::BITS); + // Since we're using a power from the denominator to the + // numerator, we to invert r, not add u32::BITS. + let r = -r; +@@ -265,7 +265,7 @@ pub(super) fn make_ratio(radix: u32, sci_exp + num.exp -= r; + if !q.is_zero() { + den.pad_zero_digits(q); +- den.exp -= Limb::BITS.as_i32() * q.as_i32(); ++ den.exp -= ::BITS.as_i32() * q.as_i32(); + } + } + diff --git a/shells/ion/files/patch-cargo-crates_lexical-core-0.4.2_src_atof_algorithm_bigint.rs b/shells/ion/files/patch-cargo-crates_lexical-core-0.4.2_src_atof_algorithm_bigint.rs new file mode 100644 index 000000000000..60e427164f78 --- /dev/null +++ b/shells/ion/files/patch-cargo-crates_lexical-core-0.4.2_src_atof_algorithm_bigint.rs @@ -0,0 +1,11 @@ +--- cargo-crates/lexical-core-0.4.2/src/atof/algorithm/bigint.rs.orig 2021-06-19 12:08:24 UTC ++++ cargo-crates/lexical-core-0.4.2/src/atof/algorithm/bigint.rs +@@ -81,7 +81,7 @@ pub(super) fn parse_mantissa(slc: FloatSlice, radix: u + let small_powers = Bigint::small_powers(radix); + let count = slc.mantissa_digits(); + let bits = count / integral_binary_factor(radix).as_usize(); +- let bytes = bits / Limb::BITS; ++ let bytes = bits / ::BITS; + + // Main loop + let step = small_powers.len() - 2; diff --git a/shells/ion/files/patch-cargo-crates_lexical-core-0.4.2_src_atof_algorithm_math.rs b/shells/ion/files/patch-cargo-crates_lexical-core-0.4.2_src_atof_algorithm_math.rs new file mode 100644 index 000000000000..726e2b97d42e --- /dev/null +++ b/shells/ion/files/patch-cargo-crates_lexical-core-0.4.2_src_atof_algorithm_math.rs @@ -0,0 +1,211 @@ +--- cargo-crates/lexical-core-0.4.2/src/atof/algorithm/math.rs.orig 2021-06-19 12:08:38 UTC ++++ cargo-crates/lexical-core-0.4.2/src/atof/algorithm/math.rs +@@ -952,7 +952,7 @@ pub fn mul(x: Limb, y: Limb, carry: Limb) + // the following is always true: + // `Wide::max_value() - (Narrow::max_value() * Narrow::max_value()) >= Narrow::max_value()` + let z: Wide = as_wide(x) * as_wide(y) + as_wide(carry); +- (as_limb(z), as_limb(z >> Limb::BITS)) ++ (as_limb(z), as_limb(z >> ::BITS)) + } + + /// Multiply two small integers (with carry) (and return if overflow happens). +@@ -975,7 +975,7 @@ pub fn div(x: Limb, y: Limb, rem: Limb) + -> (Limb, Limb) + { + // Cannot overflow, as long as wide is 2x as wide. +- let x = as_wide(x) | (as_wide(rem) << Limb::BITS); ++ let x = as_wide(x) | (as_wide(rem) << ::BITS); + let y = as_wide(y); + (as_limb(x / y), as_limb(x % y)) + } +@@ -1042,7 +1042,7 @@ pub fn leading_zeros(x: &[Limb]) -> usize { + pub fn trailing_zeros(x: &[Limb]) -> usize { + // Get the index of the last non-zero value + let index = trailing_zero_limbs(x); +- let mut count = index.saturating_mul(Limb::BITS); ++ let mut count = index.saturating_mul(::BITS); + if let Some(value) = x.get(index) { + count = count.saturating_add(value.trailing_zeros().as_usize()); + } +@@ -1057,7 +1057,7 @@ pub fn bit_length(x: &[Limb]) -> usize { + // Avoid overflowing, calculate via total number of bits + // minus leading zero bits. + let nlz = leading_zeros(x); +- Limb::BITS.checked_mul(x.len()) ++ ::BITS.checked_mul(x.len()) + .map(|v| v - nlz) + .unwrap_or(usize::max_value()) + } +@@ -1076,14 +1076,14 @@ pub fn limb_length(x: &[Limb]) -> usize { + /// + /// Returns the truncated bits. + /// +-/// Assumes `n < Limb::BITS`, IE, internally shifting bits. ++/// Assumes `n < ::BITS`, IE, internally shifting bits. + #[inline] + pub fn ishr_bits(x: &mut T, n: usize) + -> Limb + where T: CloneableVecLike + { +- // Need to shift by the number of `bits % Limb::BITS`. +- let bits = Limb::BITS; ++ // Need to shift by the number of `bits % ::BITS`. ++ let bits = ::BITS; + debug_assert!(n < bits && n != 0); + + // Internally, for each item, we shift left by n, and add the previous +@@ -1129,9 +1129,9 @@ pub fn ishr(x: &mut T, n: usize) + -> bool + where T: CloneableVecLike + { +- let bits = Limb::BITS; +- // Need to pad with zeros for the number of `bits / Limb::BITS`, +- // and shift-left with carry for `bits % Limb::BITS`. ++ let bits = ::BITS; ++ // Need to pad with zeros for the number of `bits / ::BITS`, ++ // and shift-left with carry for `bits % ::BITS`. + let rem = n % bits; + let div = n / bits; + let is_zero = match div.is_zero() { +@@ -1182,13 +1182,13 @@ pub fn shr(x: &[Limb], n: usize) + + /// Shift-left bits inside a buffer. + /// +-/// Assumes `n < Limb::BITS`, IE, internally shifting bits. ++/// Assumes `n < ::BITS`, IE, internally shifting bits. + #[inline] + pub fn ishl_bits(x: &mut T, n: usize) + where T: CloneableVecLike + { +- // Need to shift by the number of `bits % Limb::BITS)`. +- let bits = Limb::BITS; ++ // Need to shift by the number of `bits % ::BITS)`. ++ let bits = ::BITS; + debug_assert!(n < bits); + if n.is_zero() { + return; +@@ -1218,7 +1218,7 @@ pub fn ishl_bits(x: &mut T, n: usize) + + /// Shift-left bits inside a buffer. + /// +-/// Assumes `n < Limb::BITS`, IE, internally shifting bits. ++/// Assumes `n < ::BITS`, IE, internally shifting bits. + #[inline] + pub fn shl_bits(x: &[Limb], n: usize) + -> T +@@ -1248,9 +1248,9 @@ pub fn ishl_limbs(x: &mut T, n: usize) + pub fn ishl(x: &mut T, n: usize) + where T: CloneableVecLike + { +- let bits = Limb::BITS; +- // Need to pad with zeros for the number of `bits / Limb::BITS`, +- // and shift-left with carry for `bits % Limb::BITS`. ++ let bits = ::BITS; ++ // Need to pad with zeros for the number of `bits / ::BITS`, ++ // and shift-left with carry for `bits % ::BITS`. + let rem = n % bits; + let div = n / bits; + ishl_bits(x, rem); +@@ -1903,7 +1903,7 @@ pub fn mul(x: &[Limb], y: &[Limb]) + // DIVISION + + /// Constants for algorithm D. +-const ALGORITHM_D_B: Wide = 1 << Limb::BITS; ++const ALGORITHM_D_B: Wide = 1 << ::BITS; + const ALGORITHM_D_M: Wide = ALGORITHM_D_B - 1; + + /// Calculate qhat (an estimate for the quotient). +@@ -1924,7 +1924,7 @@ fn calculate_qhat(x: &[Limb], y: &[Limb], j: usize) + // rhat = (x[j+n]*B + x[j+n-1]) - qhat*y[n-1]; + let x_jn = as_wide(x[j+n]); + let x_jn1 = as_wide(x[j+n-1]); +- let num = (x_jn << Limb::BITS) + x_jn1; ++ let num = (x_jn << ::BITS) + x_jn1; + let den = as_wide(y[n-1]); + let mut qhat = num / den; + let mut rhat = num - qhat * den; +@@ -1941,7 +1941,7 @@ fn calculate_qhat(x: &[Limb], y: &[Limb], j: usize) + let y_n2 = as_wide(y[n-2]); + let y_n1 = as_wide(y[n-1]); + // This only happens when the leading bit of qhat is set. +- while qhat >= ALGORITHM_D_B || qhat * y_n2 > (rhat << Limb::BITS) + x_jn2 { ++ while qhat >= ALGORITHM_D_B || qhat * y_n2 > (rhat << ::BITS) + x_jn2 { + qhat -= 1; + rhat += y_n1; + if rhat >= ALGORITHM_D_B { +@@ -1982,7 +1982,7 @@ fn multiply_and_subtract(x: &mut T, y: &T, qhat: Wi + let p = qhat * y_i; + t = x_ij.wrapping_sub(k).wrapping_sub(as_signed_wide(p & ALGORITHM_D_M)); + x[i+j] = as_limb(t); +- k = as_signed_wide(p >> Limb::BITS) - (t >> Limb::BITS); ++ k = as_signed_wide(p >> ::BITS) - (t >> ::BITS); + } + t = as_signed_wide(x[j+n]) - k; + x[j+n] = as_limb(t); +@@ -2039,7 +2039,7 @@ fn add_back(x: &mut T, y: &T, mut t: SignedWide, j: + for i in 0..n { + t = as_signed_wide(as_wide(x[i+j]) + as_wide(y[i])) + k; + x[i+j] = as_limb(t); +- k = t >> Limb::BITS; ++ k = t >> ::BITS; + } + let x_jn = as_signed_wide(x[j+n]) + k; + x[j+n] = as_limb(x_jn); +@@ -2063,7 +2063,7 @@ fn calculate_remainder(x: &[Limb], y: &[Limb], s: u + let n = y.len(); + let mut r = T::default(); + r.reserve_exact(n); +- let rs = Limb::BITS - s; ++ let rs = ::BITS - s; + for i in 0..n-1 { + let xi = as_wide(x[i]) >> s; + let xi1 = as_wide(x[i+1]) << rs; +@@ -2199,9 +2199,9 @@ pub fn quorem(x: &mut T, y: &T) + let mut carry: Wide = 0; + for j in 0..m { + let p = as_wide(y[j]) * as_wide(q) + carry; +- carry = p >> Limb::BITS; ++ carry = p >> ::BITS; + let t = as_wide(x[j]).wrapping_sub(p & mask).wrapping_sub(borrow); +- borrow = (t >> Limb::BITS) & 1; ++ borrow = (t >> ::BITS) & 1; + x[j] = as_limb(t); + } + small::normalize(x); +@@ -2214,9 +2214,9 @@ pub fn quorem(x: &mut T, y: &T) + let mut carry: Wide = 0; + for j in 0..m { + let p = as_wide(y[j]) + carry; +- carry = p >> Limb::BITS; ++ carry = p >> ::BITS; + let t = as_wide(x[j]).wrapping_sub(p & mask).wrapping_sub(borrow); +- borrow = (t >> Limb::BITS) & 1; ++ borrow = (t >> ::BITS) & 1; + x[j] = as_limb(t); + } + small::normalize(x); +@@ -3126,18 +3126,18 @@ mod tests { + fn leading_zeros_test() { + assert_eq!(Bigint::new().leading_zeros(), 0); + +- assert_eq!(Bigint::from_u16(0xFF).leading_zeros(), Limb::BITS-8); +- assert_eq!(Bigint::from_u32(0xFF).leading_zeros(), Limb::BITS-8); ++ assert_eq!(Bigint::from_u16(0xFF).leading_zeros(), ::BITS-8); ++ assert_eq!(Bigint::from_u32(0xFF).leading_zeros(), ::BITS-8); + assert_eq!(Bigint::from_u64(0xFF00000000).leading_zeros(), 24); + assert_eq!(Bigint::from_u128(0xFF000000000000000000000000).leading_zeros(), 24); + +- assert_eq!(Bigint::from_u16(0xF).leading_zeros(), Limb::BITS-4); +- assert_eq!(Bigint::from_u32(0xF).leading_zeros(), Limb::BITS-4); ++ assert_eq!(Bigint::from_u16(0xF).leading_zeros(), ::BITS-4); ++ assert_eq!(Bigint::from_u32(0xF).leading_zeros(), ::BITS-4); + assert_eq!(Bigint::from_u64(0xF00000000).leading_zeros(), 28); + assert_eq!(Bigint::from_u128(0xF000000000000000000000000).leading_zeros(), 28); + +- assert_eq!(Bigint::from_u16(0xF0).leading_zeros(), Limb::BITS-8); +- assert_eq!(Bigint::from_u32(0xF0).leading_zeros(), Limb::BITS-8); ++ assert_eq!(Bigint::from_u16(0xF0).leading_zeros(), ::BITS-8); ++ assert_eq!(Bigint::from_u32(0xF0).leading_zeros(), ::BITS-8); + assert_eq!(Bigint::from_u64(0xF000000000).leading_zeros(), 24); + assert_eq!(Bigint::from_u128(0xF0000000000000000000000000).leading_zeros(), 24); + }