Skip to content

Commit 31656e7

Browse files
committedApr 17, 2023
Auto merge of #110458 - matthiaskrgr:rollup-1xcxmgc, r=matthiaskrgr
Rollup of 9 pull requests Successful merges: - #104055 (Migrate diagnostics in `rustc_borrowck`) - #110257 (fix false positives for `unused_parens` around unary and binary operations) - #110313 (allow `repr(align = x)` on inherent methods) - #110337 (Correct default value for default-linker-libraries) - #110386 (Clean up traversal macros) - #110394 (Various minor Idx-related tweaks) - #110425 (Encode def span for `ConstParam`) - #110434 (Check freeze with right param-env in `deduced_param_attrs`) - #110455 (tests: adapt for LLVM change 5b386b8) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents e49122f + c81e8b8 commit 31656e7

File tree

50 files changed

+973
-569
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+973
-569
lines changed
 

‎compiler/rustc_abi/src/layout.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -461,8 +461,8 @@ pub trait LayoutCalculator {
461461
let all_indices = variants.indices();
462462
let needs_disc =
463463
|index: VariantIdx| index != largest_variant_index && !absent(&variants[index]);
464-
let niche_variants = all_indices.clone().find(|v| needs_disc(*v)).unwrap().index()
465-
..=all_indices.rev().find(|v| needs_disc(*v)).unwrap().index();
464+
let niche_variants = all_indices.clone().find(|v| needs_disc(*v)).unwrap()
465+
..=all_indices.rev().find(|v| needs_disc(*v)).unwrap();
466466

467467
let count = niche_variants.size_hint().1.unwrap() as u128;
468468

@@ -560,8 +560,7 @@ pub trait LayoutCalculator {
560560
tag: niche_scalar,
561561
tag_encoding: TagEncoding::Niche {
562562
untagged_variant: largest_variant_index,
563-
niche_variants: (VariantIdx::new(*niche_variants.start())
564-
..=VariantIdx::new(*niche_variants.end())),
563+
niche_variants,
565564
niche_start,
566565
},
567566
tag_field: 0,

‎compiler/rustc_abi/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use bitflags::bitflags;
1111
use rustc_data_structures::intern::Interned;
1212
#[cfg(feature = "nightly")]
1313
use rustc_data_structures::stable_hasher::StableOrd;
14-
use rustc_index::vec::{Idx, IndexSlice, IndexVec};
14+
use rustc_index::vec::{IndexSlice, IndexVec};
1515
#[cfg(feature = "nightly")]
1616
use rustc_macros::HashStable_Generic;
1717
#[cfg(feature = "nightly")]

0 commit comments

Comments
 (0)
Please sign in to comment.