diff options
| author | Tobias Decking <Tobias.Decking@gmail.com> | 2025-05-08 15:00:59 +0200 |
|---|---|---|
| committer | Trevor Gross <t.gross35@gmail.com> | 2025-05-13 15:01:51 +0200 |
| commit | d16c82dba15f4aaf61874f6668417856002d32a6 (patch) | |
| tree | a44bb82a197fd006e4a59afff938bc509662dead /library/compiler-builtins | |
| parent | 65663b538fd8c3a593b0470b1d966100ac968a77 (diff) | |
| download | rust-d16c82dba15f4aaf61874f6668417856002d32a6.tar.gz rust-d16c82dba15f4aaf61874f6668417856002d32a6.zip | |
Fix `i256::MAX`
Diffstat (limited to 'library/compiler-builtins')
| -rw-r--r-- | library/compiler-builtins/compiler-builtins/src/int/big.rs | 2 | ||||
| -rw-r--r-- | library/compiler-builtins/libm/src/math/support/big.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/library/compiler-builtins/compiler-builtins/src/int/big.rs b/library/compiler-builtins/compiler-builtins/src/int/big.rs index 61f1349d9a4..1402efb8ed4 100644 --- a/library/compiler-builtins/compiler-builtins/src/int/big.rs +++ b/library/compiler-builtins/compiler-builtins/src/int/big.rs @@ -65,7 +65,7 @@ impl MinInt for i256 { const ZERO: Self = Self([0u64; 4]); const ONE: Self = Self([1, 0, 0, 0]); const MIN: Self = Self([0, 0, 0, 1 << 63]); - const MAX: Self = Self([u64::MAX, u64::MAX, u64::MAX, u64::MAX << 1]); + const MAX: Self = Self([u64::MAX, u64::MAX, u64::MAX, u64::MAX >> 1]); } macro_rules! impl_common { diff --git a/library/compiler-builtins/libm/src/math/support/big.rs b/library/compiler-builtins/libm/src/math/support/big.rs index f24c063cd34..8a52d86cc98 100644 --- a/library/compiler-builtins/libm/src/math/support/big.rs +++ b/library/compiler-builtins/libm/src/math/support/big.rs @@ -83,7 +83,7 @@ impl MinInt for i256 { }; const MAX: Self = Self { lo: u128::MAX, - hi: u128::MAX << 1, + hi: u128::MAX >> 1, }; } |
