diff options
| author | Lukas Wirth <lukastw97@gmail.com> | 2023-09-29 18:15:07 +0200 |
|---|---|---|
| committer | Lukas Wirth <lukastw97@gmail.com> | 2023-10-02 21:31:16 +0200 |
| commit | 2d73d30a3c4d5d06dbdc35c3cf2aabf9e3387a3d (patch) | |
| tree | 4b06a76311a9824efde05b88f35417843a293388 | |
| parent | b25c84510d8ba2a90f49d265a57395ce05ad6a64 (diff) | |
| download | rust-2d73d30a3c4d5d06dbdc35c3cf2aabf9e3387a3d.tar.gz rust-2d73d30a3c4d5d06dbdc35c3cf2aabf9e3387a3d.zip | |
Fix incorrect inlining of RangeInclusive::size_hint
| -rw-r--r-- | compiler/rustc_abi/src/layout.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_abi/src/layout.rs b/compiler/rustc_abi/src/layout.rs index 63983363f46..8f3c445dc91 100644 --- a/compiler/rustc_abi/src/layout.rs +++ b/compiler/rustc_abi/src/layout.rs @@ -340,7 +340,7 @@ pub trait LayoutCalculator { ..=all_indices.rev().find(|v| needs_disc(*v)).unwrap(); let count = - niche_variants.end().index() as u128 - niche_variants.start().index() as u128; + (niche_variants.end().index() as u128 - niche_variants.start().index() as u128) + 1; // Find the field with the largest niche let (field_index, niche, (niche_start, niche_scalar)) = variants[largest_variant_index] |
