Skip to content

Bring back generic parameters for indices in rustc_abi and make it compile on stable #116269

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Oct 6, 2023
Prev Previous commit
Next Next commit
Fix incorrect inlining of RangeInclusive::size_hint
  • Loading branch information
Veykril committed Oct 2, 2023
commit 2d73d30a3c4d5d06dbdc35c3cf2aabf9e3387a3d
2 changes: 1 addition & 1 deletion compiler/rustc_abi/src/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down