diff options
| author | Oli Scherer <github333195615777966@oli-obk.de> | 2025-07-24 10:19:20 +0000 |
|---|---|---|
| committer | Oli Scherer <github333195615777966@oli-obk.de> | 2025-07-29 14:08:15 +0000 |
| commit | 75bdbf25e39f073b35eadedcf575affac7762a86 (patch) | |
| tree | dda912558bb387a3f3462b05fff7a3d1872b6cd5 /compiler/rustc_middle/src | |
| parent | 45b0c8d03e627d55f814a4cd03b90c5068664ac8 (diff) | |
| download | rust-75bdbf25e39f073b35eadedcf575affac7762a86.tar.gz rust-75bdbf25e39f073b35eadedcf575affac7762a86.zip | |
Pick the largest niche even if the largest niche is wrapped around
Diffstat (limited to 'compiler/rustc_middle/src')
| -rw-r--r-- | compiler/rustc_middle/src/ty/layout.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_middle/src/ty/layout.rs b/compiler/rustc_middle/src/ty/layout.rs index a5123576fc6..aed94f9aa04 100644 --- a/compiler/rustc_middle/src/ty/layout.rs +++ b/compiler/rustc_middle/src/ty/layout.rs @@ -107,8 +107,8 @@ impl abi::Integer { abi::Integer::I8 }; - // If there are no negative values, we can use the unsigned fit. - if min >= 0 { + // Pick the smallest fit. + if unsigned_fit <= signed_fit { (cmp::max(unsigned_fit, at_least), false) } else { (cmp::max(signed_fit, at_least), true) |
