Skip to content

Commit 96bbd1c

Browse files
committed
Rename cast_from_int to cast_from_int_like
1 parent 2fa550b commit 96bbd1c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/librustc_mir/interpret/cast.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,9 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
136136
if let Some(discr) = src.layout.ty.discriminant_for_variant(*self.tcx, index) {
137137
assert!(src.layout.is_zst());
138138
let discr_layout = self.layout_of(discr.ty)?;
139-
return Ok(self.cast_from_int(discr.val, discr_layout, dest_layout)?.into());
139+
return Ok(self
140+
.cast_from_int_like(discr.val, discr_layout, dest_layout)?
141+
.into());
140142
}
141143
}
142144
layout::Variants::Multiple { .. } => {}
@@ -173,10 +175,10 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
173175
// (b) cast from an integer-like (including bool, char, enums).
174176
// In both cases we want the bits.
175177
let bits = self.force_bits(src.to_scalar()?, src.layout.size)?;
176-
Ok(self.cast_from_int(bits, src.layout, dest_layout)?.into())
178+
Ok(self.cast_from_int_like(bits, src.layout, dest_layout)?.into())
177179
}
178180

179-
fn cast_from_int(
181+
fn cast_from_int_like(
180182
&self,
181183
v: u128, // raw bits
182184
src_layout: TyLayout<'tcx>,

0 commit comments

Comments
 (0)