Skip to content

Commit 8574880

Browse files
committed
Auto merge of #106023 - JohnTitor:rollup-k8mettz, r=JohnTitor
Rollup of 8 pull requests Successful merges: - #105584 (add assert messages if chunks/windows are length 0) - #105602 (interpret: add read_machine_[ui]size convenience methods) - #105824 (str.lines() docstring: clarify that line endings are not returned) - #105980 (Refer to "Waker" rather than "RawWaker" in `drop` comment) - #105986 (Fix typo in reading_half_a_pointer.rs) - #105995 (Add regression test for #96530) - #106008 (Sort lint_groups in no_lint_suggestion) - #106014 (Add comment explaining what the scrape-examples-toggle.goml GUI test is about) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents bdbe392 + 4d50fa6 commit 8574880

File tree

26 files changed

+127
-75
lines changed

26 files changed

+127
-75
lines changed

compiler/rustc_const_eval/src/interpret/intrinsics.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -303,15 +303,15 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
303303
}
304304
sym::offset => {
305305
let ptr = self.read_pointer(&args[0])?;
306-
let offset_count = self.read_scalar(&args[1])?.to_machine_isize(self)?;
306+
let offset_count = self.read_machine_isize(&args[1])?;
307307
let pointee_ty = substs.type_at(0);
308308

309309
let offset_ptr = self.ptr_offset_inbounds(ptr, pointee_ty, offset_count)?;
310310
self.write_pointer(offset_ptr, dest)?;
311311
}
312312
sym::arith_offset => {
313313
let ptr = self.read_pointer(&args[0])?;
314-
let offset_count = self.read_scalar(&args[1])?.to_machine_isize(self)?;
314+
let offset_count = self.read_machine_isize(&args[1])?;
315315
let pointee_ty = substs.type_at(0);
316316

317317
let pointee_size = i64::try_from(self.layout_of(pointee_ty)?.size.bytes()).unwrap();
@@ -670,7 +670,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
670670
count: &OpTy<'tcx, <M as Machine<'mir, 'tcx>>::Provenance>,
671671
nonoverlapping: bool,
672672
) -> InterpResult<'tcx> {
673-
let count = self.read_scalar(&count)?.to_machine_usize(self)?;
673+
let count = self.read_machine_usize(&count)?;
674674
let layout = self.layout_of(src.layout.ty.builtin_deref(true).unwrap().ty)?;
675675
let (size, align) = (layout.size, layout.align.abi);
676676
// `checked_mul` enforces a too small bound (the correct one would probably be machine_isize_max),
@@ -698,7 +698,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
698698

699699
let dst = self.read_pointer(&dst)?;
700700
let byte = self.read_scalar(&byte)?.to_u8()?;
701-
let count = self.read_scalar(&count)?.to_machine_usize(self)?;
701+
let count = self.read_machine_usize(&count)?;
702702

703703
// `checked_mul` enforces a too small bound (the correct one would probably be machine_isize_max),
704704
// but no actual allocation can be big enough for the difference to be noticeable.

compiler/rustc_const_eval/src/interpret/operand.rs

+11
Original file line numberDiff line numberDiff line change
@@ -404,13 +404,24 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
404404
Ok(self.read_immediate(op)?.to_scalar())
405405
}
406406

407+
// Pointer-sized reads are fairly common and need target layout access, so we wrap them in
408+
// convenience functions.
409+
407410
/// Read a pointer from a place.
408411
pub fn read_pointer(
409412
&self,
410413
op: &OpTy<'tcx, M::Provenance>,
411414
) -> InterpResult<'tcx, Pointer<Option<M::Provenance>>> {
412415
self.read_scalar(op)?.to_pointer(self)
413416
}
417+
/// Read a pointer-sized unsigned integer from a place.
418+
pub fn read_machine_usize(&self, op: &OpTy<'tcx, M::Provenance>) -> InterpResult<'tcx, u64> {
419+
self.read_scalar(op)?.to_machine_usize(self)
420+
}
421+
/// Read a pointer-sized signed integer from a place.
422+
pub fn read_machine_isize(&self, op: &OpTy<'tcx, M::Provenance>) -> InterpResult<'tcx, i64> {
423+
self.read_scalar(op)?.to_machine_isize(self)
424+
}
414425

415426
/// Turn the wide MPlace into a string (must already be dereferenced!)
416427
pub fn read_str(&self, mplace: &MPlaceTy<'tcx, M::Provenance>) -> InterpResult<'tcx, &str> {

compiler/rustc_const_eval/src/interpret/projection.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ where
363363
Index(local) => {
364364
let layout = self.layout_of(self.tcx.types.usize)?;
365365
let n = self.local_to_op(self.frame(), local, Some(layout))?;
366-
let n = self.read_scalar(&n)?.to_machine_usize(self)?;
366+
let n = self.read_machine_usize(&n)?;
367367
self.place_index(base, n)?
368368
}
369369
ConstantIndex { offset, min_length, from_end } => {
@@ -392,7 +392,7 @@ where
392392
Index(local) => {
393393
let layout = self.layout_of(self.tcx.types.usize)?;
394394
let n = self.local_to_op(self.frame(), local, Some(layout))?;
395-
let n = self.read_scalar(&n)?.to_machine_usize(self)?;
395+
let n = self.read_machine_usize(&n)?;
396396
self.operand_index(base, n)?
397397
}
398398
ConstantIndex { offset, min_length, from_end } => {

compiler/rustc_lint/src/context.rs

+10-1
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,16 @@ impl LintStore {
483483
return CheckLintNameResult::NoLint(Some(Symbol::intern(&name_lower)));
484484
}
485485
// ...if not, search for lints with a similar name
486-
let groups = self.lint_groups.keys().copied().map(Symbol::intern);
486+
// Note: find_best_match_for_name depends on the sort order of its input vector.
487+
// To ensure deterministic output, sort elements of the lint_groups hash map.
488+
// Also, never suggest deprecated lint groups.
489+
let mut groups: Vec<_> = self
490+
.lint_groups
491+
.iter()
492+
.filter_map(|(k, LintGroup { depr, .. })| if depr.is_none() { Some(k) } else { None })
493+
.collect();
494+
groups.sort();
495+
let groups = groups.iter().map(|k| Symbol::intern(k));
487496
let lints = self.lints.iter().map(|l| Symbol::intern(&l.name_lower()));
488497
let names: Vec<Symbol> = groups.chain(lints).collect();
489498
let suggestion = find_best_match_for_name(&names, Symbol::intern(&name_lower), None);

library/core/src/slice/mod.rs

+9-9
Original file line numberDiff line numberDiff line change
@@ -893,7 +893,7 @@ impl<T> [T] {
893893
#[stable(feature = "chunks_exact", since = "1.31.0")]
894894
#[inline]
895895
pub fn chunks_exact(&self, chunk_size: usize) -> ChunksExact<'_, T> {
896-
assert_ne!(chunk_size, 0);
896+
assert_ne!(chunk_size, 0, "chunks cannot have a size of zero");
897897
ChunksExact::new(self, chunk_size)
898898
}
899899

@@ -935,7 +935,7 @@ impl<T> [T] {
935935
#[stable(feature = "chunks_exact", since = "1.31.0")]
936936
#[inline]
937937
pub fn chunks_exact_mut(&mut self, chunk_size: usize) -> ChunksExactMut<'_, T> {
938-
assert_ne!(chunk_size, 0);
938+
assert_ne!(chunk_size, 0, "chunks cannot have a size of zero");
939939
ChunksExactMut::new(self, chunk_size)
940940
}
941941

@@ -1017,7 +1017,7 @@ impl<T> [T] {
10171017
#[inline]
10181018
#[must_use]
10191019
pub fn as_chunks<const N: usize>(&self) -> (&[[T; N]], &[T]) {
1020-
assert_ne!(N, 0);
1020+
assert_ne!(N, 0, "chunks cannot have a size of zero");
10211021
let len = self.len() / N;
10221022
let (multiple_of_n, remainder) = self.split_at(len * N);
10231023
// SAFETY: We already panicked for zero, and ensured by construction
@@ -1048,7 +1048,7 @@ impl<T> [T] {
10481048
#[inline]
10491049
#[must_use]
10501050
pub fn as_rchunks<const N: usize>(&self) -> (&[T], &[[T; N]]) {
1051-
assert_ne!(N, 0);
1051+
assert_ne!(N, 0, "chunks cannot have a size of zero");
10521052
let len = self.len() / N;
10531053
let (remainder, multiple_of_n) = self.split_at(self.len() - len * N);
10541054
// SAFETY: We already panicked for zero, and ensured by construction
@@ -1087,7 +1087,7 @@ impl<T> [T] {
10871087
#[unstable(feature = "array_chunks", issue = "74985")]
10881088
#[inline]
10891089
pub fn array_chunks<const N: usize>(&self) -> ArrayChunks<'_, T, N> {
1090-
assert_ne!(N, 0);
1090+
assert_ne!(N, 0, "chunks cannot have a size of zero");
10911091
ArrayChunks::new(self)
10921092
}
10931093

@@ -1166,7 +1166,7 @@ impl<T> [T] {
11661166
#[inline]
11671167
#[must_use]
11681168
pub fn as_chunks_mut<const N: usize>(&mut self) -> (&mut [[T; N]], &mut [T]) {
1169-
assert_ne!(N, 0);
1169+
assert_ne!(N, 0, "chunks cannot have a size of zero");
11701170
let len = self.len() / N;
11711171
let (multiple_of_n, remainder) = self.split_at_mut(len * N);
11721172
// SAFETY: We already panicked for zero, and ensured by construction
@@ -1203,7 +1203,7 @@ impl<T> [T] {
12031203
#[inline]
12041204
#[must_use]
12051205
pub fn as_rchunks_mut<const N: usize>(&mut self) -> (&mut [T], &mut [[T; N]]) {
1206-
assert_ne!(N, 0);
1206+
assert_ne!(N, 0, "chunks cannot have a size of zero");
12071207
let len = self.len() / N;
12081208
let (remainder, multiple_of_n) = self.split_at_mut(self.len() - len * N);
12091209
// SAFETY: We already panicked for zero, and ensured by construction
@@ -1244,7 +1244,7 @@ impl<T> [T] {
12441244
#[unstable(feature = "array_chunks", issue = "74985")]
12451245
#[inline]
12461246
pub fn array_chunks_mut<const N: usize>(&mut self) -> ArrayChunksMut<'_, T, N> {
1247-
assert_ne!(N, 0);
1247+
assert_ne!(N, 0, "chunks cannot have a size of zero");
12481248
ArrayChunksMut::new(self)
12491249
}
12501250

@@ -1276,7 +1276,7 @@ impl<T> [T] {
12761276
#[unstable(feature = "array_windows", issue = "75027")]
12771277
#[inline]
12781278
pub fn array_windows<const N: usize>(&self) -> ArrayWindows<'_, T, N> {
1279-
assert_ne!(N, 0);
1279+
assert_ne!(N, 0, "windows cannot have a size of zero");
12801280
ArrayWindows::new(self)
12811281
}
12821282

library/core/src/str/mod.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -970,8 +970,10 @@ impl str {
970970

971971
/// An iterator over the lines of a string, as string slices.
972972
///
973-
/// Lines are ended with either a newline (`\n`) or a carriage return with
974-
/// a line feed (`\r\n`).
973+
/// Lines are split at line endings that are either newlines (`\n`) or
974+
/// sequences of a carriage return followed by a line feed (`\r\n`).
975+
///
976+
/// Line terminators are not included in the lines returned by the iterator.
975977
///
976978
/// The final line ending is optional. A string that ends with a final line
977979
/// ending will return the same lines as an otherwise identical string

library/core/src/task/wake.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ pub struct RawWakerVTable {
104104
/// pointer.
105105
wake_by_ref: unsafe fn(*const ()),
106106

107-
/// This function gets called when a [`RawWaker`] gets dropped.
107+
/// This function gets called when a [`Waker`] gets dropped.
108108
///
109109
/// The implementation of this function must make sure to release any
110110
/// resources that are associated with this instance of a [`RawWaker`] and
@@ -151,7 +151,7 @@ impl RawWakerVTable {
151151
///
152152
/// # `drop`
153153
///
154-
/// This function gets called when a [`RawWaker`] gets dropped.
154+
/// This function gets called when a [`Waker`] gets dropped.
155155
///
156156
/// The implementation of this function must make sure to release any
157157
/// resources that are associated with this instance of a [`RawWaker`] and

src/test/rustdoc-gui/scrape-examples-toggle.goml

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// This tests checks that the "scraped examples" toggle is working as expected.
12
goto: "file://" + |DOC_PATH| + "/scrape_examples/fn.test_many.html"
23

34
// Clicking "More examples..." will open additional examples

src/test/ui/typeck/issue-96530.rs

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
struct Person {
2+
first_name: String,
3+
age: u32,
4+
}
5+
6+
fn first_woman(man: &Person) -> Person {
7+
Person {
8+
first_name: "Eve".to_string(),
9+
..man.clone() //~ ERROR: mismatched types
10+
}
11+
}
12+
13+
fn main() {
14+
let adam = Person {
15+
first_name: "Adam".to_string(),
16+
age: 0,
17+
};
18+
19+
let eve = first_woman(&adam);
20+
}

src/test/ui/typeck/issue-96530.stderr

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
error[E0308]: mismatched types
2+
--> $DIR/issue-96530.rs:9:11
3+
|
4+
LL | ..man.clone()
5+
| ^^^^^^^^^^^ expected struct `Person`, found `&Person`
6+
7+
error: aborting due to previous error
8+
9+
For more information about this error, try `rustc --explain E0308`.

src/tools/miri/src/eval.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ impl MainThreadState {
233233
this.machine.main_fn_ret_place.unwrap().ptr,
234234
this.machine.layouts.isize,
235235
);
236-
let exit_code = this.read_scalar(&ret_place.into())?.to_machine_isize(this)?;
236+
let exit_code = this.read_machine_isize(&ret_place.into())?;
237237
// Need to call this ourselves since we are not going to return to the scheduler
238238
// loop, and we want the main thread TLS to not show up as memory leaks.
239239
this.terminate_active_thread()?;

src/tools/miri/src/shims/env.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
321321
this.assert_target_os_is_unix("getcwd");
322322

323323
let buf = this.read_pointer(buf_op)?;
324-
let size = this.read_scalar(size_op)?.to_machine_usize(&*this.tcx)?;
324+
let size = this.read_machine_usize(size_op)?;
325325

326326
if let IsolatedOp::Reject(reject_with) = this.machine.isolated_op {
327327
this.reject_in_isolation("`getcwd`", reject_with)?;

src/tools/miri/src/shims/foreign_items.rs

+16-16
Original file line numberDiff line numberDiff line change
@@ -485,14 +485,14 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
485485
// Standard C allocation
486486
"malloc" => {
487487
let [size] = this.check_shim(abi, Abi::C { unwind: false }, link_name, args)?;
488-
let size = this.read_scalar(size)?.to_machine_usize(this)?;
488+
let size = this.read_machine_usize(size)?;
489489
let res = this.malloc(size, /*zero_init:*/ false, MiriMemoryKind::C)?;
490490
this.write_pointer(res, dest)?;
491491
}
492492
"calloc" => {
493493
let [items, len] = this.check_shim(abi, Abi::C { unwind: false }, link_name, args)?;
494-
let items = this.read_scalar(items)?.to_machine_usize(this)?;
495-
let len = this.read_scalar(len)?.to_machine_usize(this)?;
494+
let items = this.read_machine_usize(items)?;
495+
let len = this.read_machine_usize(len)?;
496496
let size =
497497
items.checked_mul(len).ok_or_else(|| err_ub_format!("overflow during calloc size computation"))?;
498498
let res = this.malloc(size, /*zero_init:*/ true, MiriMemoryKind::C)?;
@@ -506,16 +506,16 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
506506
"realloc" => {
507507
let [old_ptr, new_size] = this.check_shim(abi, Abi::C { unwind: false }, link_name, args)?;
508508
let old_ptr = this.read_pointer(old_ptr)?;
509-
let new_size = this.read_scalar(new_size)?.to_machine_usize(this)?;
509+
let new_size = this.read_machine_usize(new_size)?;
510510
let res = this.realloc(old_ptr, new_size, MiriMemoryKind::C)?;
511511
this.write_pointer(res, dest)?;
512512
}
513513

514514
// Rust allocation
515515
"__rust_alloc" | "miri_alloc" => {
516516
let [size, align] = this.check_shim(abi, Abi::Rust, link_name, args)?;
517-
let size = this.read_scalar(size)?.to_machine_usize(this)?;
518-
let align = this.read_scalar(align)?.to_machine_usize(this)?;
517+
let size = this.read_machine_usize(size)?;
518+
let align = this.read_machine_usize(align)?;
519519

520520
let default = |this: &mut MiriInterpCx<'mir, 'tcx>| {
521521
Self::check_alloc_request(size, align)?;
@@ -546,8 +546,8 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
546546
}
547547
"__rust_alloc_zeroed" => {
548548
let [size, align] = this.check_shim(abi, Abi::Rust, link_name, args)?;
549-
let size = this.read_scalar(size)?.to_machine_usize(this)?;
550-
let align = this.read_scalar(align)?.to_machine_usize(this)?;
549+
let size = this.read_machine_usize(size)?;
550+
let align = this.read_machine_usize(align)?;
551551

552552
return this.emulate_allocator(Symbol::intern("__rg_alloc_zeroed"), |this| {
553553
Self::check_alloc_request(size, align)?;
@@ -566,8 +566,8 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
566566
"__rust_dealloc" | "miri_dealloc" => {
567567
let [ptr, old_size, align] = this.check_shim(abi, Abi::Rust, link_name, args)?;
568568
let ptr = this.read_pointer(ptr)?;
569-
let old_size = this.read_scalar(old_size)?.to_machine_usize(this)?;
570-
let align = this.read_scalar(align)?.to_machine_usize(this)?;
569+
let old_size = this.read_machine_usize(old_size)?;
570+
let align = this.read_machine_usize(align)?;
571571

572572
let default = |this: &mut MiriInterpCx<'mir, 'tcx>| {
573573
let memory_kind = match link_name.as_str() {
@@ -596,9 +596,9 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
596596
"__rust_realloc" => {
597597
let [ptr, old_size, align, new_size] = this.check_shim(abi, Abi::Rust, link_name, args)?;
598598
let ptr = this.read_pointer(ptr)?;
599-
let old_size = this.read_scalar(old_size)?.to_machine_usize(this)?;
600-
let align = this.read_scalar(align)?.to_machine_usize(this)?;
601-
let new_size = this.read_scalar(new_size)?.to_machine_usize(this)?;
599+
let old_size = this.read_machine_usize(old_size)?;
600+
let align = this.read_machine_usize(align)?;
601+
let new_size = this.read_machine_usize(new_size)?;
602602
// No need to check old_size; we anyway check that they match the allocation.
603603

604604
return this.emulate_allocator(Symbol::intern("__rg_realloc"), |this| {
@@ -621,7 +621,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
621621
let [left, right, n] = this.check_shim(abi, Abi::C { unwind: false }, link_name, args)?;
622622
let left = this.read_pointer(left)?;
623623
let right = this.read_pointer(right)?;
624-
let n = Size::from_bytes(this.read_scalar(n)?.to_machine_usize(this)?);
624+
let n = Size::from_bytes(this.read_machine_usize(n)?);
625625

626626
let result = {
627627
let left_bytes = this.read_bytes_ptr_strip_provenance(left, n)?;
@@ -641,7 +641,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
641641
let [ptr, val, num] = this.check_shim(abi, Abi::C { unwind: false }, link_name, args)?;
642642
let ptr = this.read_pointer(ptr)?;
643643
let val = this.read_scalar(val)?.to_i32()?;
644-
let num = this.read_scalar(num)?.to_machine_usize(this)?;
644+
let num = this.read_machine_usize(num)?;
645645
// The docs say val is "interpreted as unsigned char".
646646
#[allow(clippy::cast_sign_loss, clippy::cast_possible_truncation)]
647647
let val = val as u8;
@@ -664,7 +664,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
664664
let [ptr, val, num] = this.check_shim(abi, Abi::C { unwind: false }, link_name, args)?;
665665
let ptr = this.read_pointer(ptr)?;
666666
let val = this.read_scalar(val)?.to_i32()?;
667-
let num = this.read_scalar(num)?.to_machine_usize(this)?;
667+
let num = this.read_machine_usize(num)?;
668668
// The docs say val is "interpreted as unsigned char".
669669
#[allow(clippy::cast_sign_loss, clippy::cast_possible_truncation)]
670670
let val = val as u8;

src/tools/miri/src/shims/intrinsics/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
111111
let ty_layout = this.layout_of(ty)?;
112112
let val_byte = this.read_scalar(val_byte)?.to_u8()?;
113113
let ptr = this.read_pointer(ptr)?;
114-
let count = this.read_scalar(count)?.to_machine_usize(this)?;
114+
let count = this.read_machine_usize(count)?;
115115
// `checked_mul` enforces a too small bound (the correct one would probably be machine_isize_max),
116116
// but no actual allocation can be big enough for the difference to be noticeable.
117117
let byte_count = ty_layout.size.checked_mul(count, this).ok_or_else(|| {
@@ -124,7 +124,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
124124
let [ptr, mask] = check_arg_count(args)?;
125125

126126
let ptr = this.read_pointer(ptr)?;
127-
let mask = this.read_scalar(mask)?.to_machine_usize(this)?;
127+
let mask = this.read_machine_usize(mask)?;
128128

129129
let masked_addr = Size::from_bytes(ptr.addr().bytes() & mask);
130130

src/tools/miri/src/shims/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
8080
return Ok(false);
8181
}
8282

83-
let req_align = this.read_scalar(align_op)?.to_machine_usize(this)?;
83+
let req_align = this.read_machine_usize(align_op)?;
8484

8585
// Stop if the alignment is not a power of two.
8686
if !req_align.is_power_of_two() {

0 commit comments

Comments
 (0)