Skip to content

Commit 3b0631a

Browse files
committed
Sync from rust db0cbc4
2 parents d0547f4 + bb5ac03 commit 3b0631a

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/base.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -774,7 +774,7 @@ fn codegen_stmt<'tcx>(
774774
let variant_dest = lval.downcast_variant(fx, variant_index);
775775
(variant_index, variant_dest, active_field_index)
776776
}
777-
_ => (VariantIdx::from_u32(0), lval, None),
777+
_ => (FIRST_VARIANT, lval, None),
778778
};
779779
if active_field_index.is_some() {
780780
assert_eq!(operands.len(), 1);

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ mod prelude {
8686
self, FloatTy, Instance, InstanceDef, IntTy, ParamEnv, Ty, TyCtxt, TypeAndMut,
8787
TypeFoldable, TypeVisitableExt, UintTy,
8888
};
89-
pub(crate) use rustc_target::abi::{Abi, Scalar, Size, VariantIdx};
89+
pub(crate) use rustc_target::abi::{Abi, Scalar, Size, VariantIdx, FIRST_VARIANT};
9090

9191
pub(crate) use rustc_data_structures::fx::FxHashMap;
9292

src/unsize.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ pub(crate) fn coerce_unsized_into<'tcx>(
146146
(&ty::Adt(def_a, _), &ty::Adt(def_b, _)) => {
147147
assert_eq!(def_a, def_b);
148148

149-
for i in 0..def_a.variant(VariantIdx::new(0)).fields.len() {
149+
for i in 0..def_a.variant(FIRST_VARIANT).fields.len() {
150150
let src_f = src.value_field(fx, mir::Field::new(i));
151151
let dst_f = dst.place_field(fx, mir::Field::new(i));
152152

0 commit comments

Comments
 (0)