Skip to content

Commit 454b083

Browse files
authored
Rollup merge of #138040 - thaliaarchi:use-prelude-size-of.compiler, r=compiler-errors
compiler: Use `size_of` from the prelude instead of imported Use `std::mem::{size_of, size_of_val, align_of, align_of_val}` from the prelude instead of importing or qualifying them. Apply this change across the compiler. These functions were added to all preludes in Rust 1.80. r? ``@compiler-errors``
2 parents 24bf404 + 70b5888 commit 454b083

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/builder.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2439,9 +2439,5 @@ fn get_maybe_pointer_size(value: RValue<'_>) -> u32 {
24392439
#[cfg(not(feature = "master"))]
24402440
fn get_maybe_pointer_size(value: RValue<'_>) -> u32 {
24412441
let type_ = value.get_type();
2442-
if type_.get_pointee().is_some() {
2443-
std::mem::size_of::<*const ()>() as _
2444-
} else {
2445-
type_.get_size()
2446-
}
2442+
if type_.get_pointee().is_some() { size_of::<*const ()>() as _ } else { type_.get_size() }
24472443
}

0 commit comments

Comments
 (0)