diff options
| author | bors <bors@rust-lang.org> | 2023-03-26 12:05:38 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-03-26 12:05:38 +0000 |
| commit | 89c2e3d3d75486e52473de3ae38f0ca6efeffef2 (patch) | |
| tree | 07df5b9bb2675e15c5ecc5e4d55cc379f1cdecd7 /compiler/rustc_codegen_cranelift | |
| parent | 2420bd34ba68a625840022de2a56aec228500359 (diff) | |
| parent | 4aa4ce6ee26045f74f28d6a5067d01bf54221616 (diff) | |
| download | rust-89c2e3d3d75486e52473de3ae38f0ca6efeffef2.tar.gz rust-89c2e3d3d75486e52473de3ae38f0ca6efeffef2.zip | |
Auto merge of #109626 - matthiaskrgr:rollup-k0y7bdd, r=matthiaskrgr
Rollup of 6 pull requests Successful merges: - #109007 (rustdoc: skip `// some variants omitted` if enum is `#[non_exhaustive]`) - #109593 (Rustdoc Book refer to rustdoc::missing_doc_code_examples. Fixes #109592.) - #109595 (Improve "Auto-hide trait implementation documentation" GUI test) - #109619 (Still-further-specializable projections are ambiguous in new solver) - #109620 (Correct typo (`back_box` -> `black_box`)) - #109621 (Refactor: `VariantIdx::from_u32(0)` -> `FIRST_VARIANT`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_codegen_cranelift')
| -rw-r--r-- | compiler/rustc_codegen_cranelift/src/base.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_codegen_cranelift/src/lib.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_codegen_cranelift/src/unsize.rs | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_codegen_cranelift/src/base.rs b/compiler/rustc_codegen_cranelift/src/base.rs index 2107ae147e9..1825fb8cb22 100644 --- a/compiler/rustc_codegen_cranelift/src/base.rs +++ b/compiler/rustc_codegen_cranelift/src/base.rs @@ -785,7 +785,7 @@ fn codegen_stmt<'tcx>( let variant_dest = lval.downcast_variant(fx, variant_index); (variant_index, variant_dest, active_field_index) } - _ => (VariantIdx::from_u32(0), lval, None), + _ => (FIRST_VARIANT, lval, None), }; if active_field_index.is_some() { assert_eq!(operands.len(), 1); diff --git a/compiler/rustc_codegen_cranelift/src/lib.rs b/compiler/rustc_codegen_cranelift/src/lib.rs index bed79859f51..1bd03403f24 100644 --- a/compiler/rustc_codegen_cranelift/src/lib.rs +++ b/compiler/rustc_codegen_cranelift/src/lib.rs @@ -86,7 +86,7 @@ mod prelude { self, FloatTy, Instance, InstanceDef, IntTy, ParamEnv, Ty, TyCtxt, TypeAndMut, TypeFoldable, TypeVisitableExt, UintTy, }; - pub(crate) use rustc_target::abi::{Abi, Scalar, Size, VariantIdx}; + pub(crate) use rustc_target::abi::{Abi, Scalar, Size, VariantIdx, FIRST_VARIANT}; pub(crate) use rustc_data_structures::fx::FxHashMap; diff --git a/compiler/rustc_codegen_cranelift/src/unsize.rs b/compiler/rustc_codegen_cranelift/src/unsize.rs index ecf187a0b0f..93eefd92342 100644 --- a/compiler/rustc_codegen_cranelift/src/unsize.rs +++ b/compiler/rustc_codegen_cranelift/src/unsize.rs @@ -146,7 +146,7 @@ pub(crate) fn coerce_unsized_into<'tcx>( (&ty::Adt(def_a, _), &ty::Adt(def_b, _)) => { assert_eq!(def_a, def_b); - for i in 0..def_a.variant(VariantIdx::new(0)).fields.len() { + for i in 0..def_a.variant(FIRST_VARIANT).fields.len() { let src_f = src.value_field(fx, mir::Field::new(i)); let dst_f = dst.place_field(fx, mir::Field::new(i)); |
