Skip to content

Commit 2d73d30

Browse files
committed
Fix incorrect inlining of RangeInclusive::size_hint
1 parent b25c845 commit 2d73d30

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/rustc_abi/src/layout.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ pub trait LayoutCalculator {
340340
..=all_indices.rev().find(|v| needs_disc(*v)).unwrap();
341341

342342
let count =
343-
niche_variants.end().index() as u128 - niche_variants.start().index() as u128;
343+
(niche_variants.end().index() as u128 - niche_variants.start().index() as u128) + 1;
344344

345345
// Find the field with the largest niche
346346
let (field_index, niche, (niche_start, niche_scalar)) = variants[largest_variant_index]

0 commit comments

Comments
 (0)