Skip to content

Commit c85d3f6

Browse files
committed
bootstrap and compiletest: Use size_of_val from the prelude instead of imported
Use `std::mem::size_of_val` from the prelude instead of importing or qualifying it. This function was added to all preludes in Rust 1.80.
1 parent ac951d3 commit c85d3f6

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

Diff for: src/bootstrap/src/bin/rustc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ fn format_rusage_data(child: Child) -> Option<String> {
349349
let mut kernel_filetime = Default::default();
350350
let mut kernel_time = Default::default();
351351
let mut memory_counters = PROCESS_MEMORY_COUNTERS::default();
352-
let memory_counters_size = std::mem::size_of_val(&memory_counters);
352+
let memory_counters_size = size_of_val(&memory_counters);
353353

354354
unsafe {
355355
GetProcessTimes(

Diff for: src/bootstrap/src/utils/job.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ pub unsafe fn setup(build: &mut crate::Build) {
4242
#[cfg(windows)]
4343
mod for_windows {
4444
use std::ffi::c_void;
45-
use std::{io, mem};
45+
use std::io;
4646

4747
use windows::Win32::Foundation::CloseHandle;
4848
use windows::Win32::System::Diagnostics::Debug::{
@@ -82,7 +82,7 @@ mod for_windows {
8282
job,
8383
JobObjectExtendedLimitInformation,
8484
&info as *const _ as *const c_void,
85-
mem::size_of_val(&info) as u32,
85+
size_of_val(&info) as u32,
8686
);
8787
assert!(r.is_ok(), "{}", io::Error::last_os_error());
8888

Diff for: src/tools/compiletest/src/raise_fd_limit.rs

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
#[cfg(target_vendor = "apple")]
88
#[allow(non_camel_case_types)]
99
pub unsafe fn raise_fd_limit() {
10-
use std::mem::size_of_val;
1110
use std::ptr::null_mut;
1211
use std::{cmp, io};
1312

0 commit comments

Comments
 (0)