Skip to content

Commit d50abd0

Browse files
committed
Use ref
1 parent 225a4bf commit d50abd0

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

compiler/rustc_mir/src/interpret/validity.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,7 @@ impl<'rt, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> ValidityVisitor<'rt, 'mir, '
623623
scalar_layout: &ScalarAbi,
624624
) -> InterpResult<'tcx> {
625625
let value = self.read_scalar(op)?;
626-
let valid_range = scalar_layout.valid_range;
626+
let valid_range = scalar_layout.valid_range.clone();
627627
let AllocationRange { start: lo, end: hi } = valid_range;
628628
// Determine the allowed range
629629
// `max_hi` is as big as the size fits

compiler/rustc_target/src/abi/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -985,7 +985,7 @@ impl Niche {
985985
}
986986

987987
pub fn available<C: HasDataLayout>(&self, cx: &C) -> u128 {
988-
let Scalar { value, valid_range: v } = self.scalar;
988+
let Scalar { value, valid_range: ref v } = self.scalar;
989989
let bits = value.size(cx).bits();
990990
assert!(bits <= 128);
991991
let max_value = !0u128 >> (128 - bits);
@@ -998,7 +998,7 @@ impl Niche {
998998
pub fn reserve<C: HasDataLayout>(&self, cx: &C, count: u128) -> Option<(u128, Scalar)> {
999999
assert!(count > 0);
10001000

1001-
let Scalar { value, valid_range: v } = self.scalar;
1001+
let Scalar { value, valid_range: ref v } = self.scalar;
10021002
let bits = value.size(cx).bits();
10031003
assert!(bits <= 128);
10041004
let max_value = !0u128 >> (128 - bits);

0 commit comments

Comments
 (0)