bootstrap and compiletest: Use size_of_val from the prelude instead o… · rust-lang/rust@1cacddc (original) (raw)
Navigation Menu
- Explore
- Pricing
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Appearance settings
Commit 1cacddc
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.
File tree
3 files changed
lines changed
3 files changed
lines changed
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -349,7 +349,7 @@ fn format_rusage_data(child: Child) -> Option { | ||
349 | 349 | let mut kernel_filetime = Default::default(); |
350 | 350 | let mut kernel_time = Default::default(); |
351 | 351 | 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); | |
353 | 353 | |
354 | 354 | unsafe { |
355 | 355 | GetProcessTimes( |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -82,7 +82,7 @@ mod for_windows { | ||
82 | 82 | job, |
83 | 83 | JobObjectExtendedLimitInformation, |
84 | 84 | &info as *const _ as *const c_void, |
85 | -mem::size_of_val(&info) as u32, | |
85 | +size_of_val(&info) as u32, | |
86 | 86 | ); |
87 | 87 | assert!(r.is_ok(), "{}", io::Error::last_os_error()); |
88 | 88 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -7,7 +7,6 @@ | ||
7 | 7 | #[cfg(target_vendor = "apple")] |
8 | 8 | #[allow(non_camel_case_types)] |
9 | 9 | pub unsafe fn raise_fd_limit() { |
10 | -use std::mem::size_of_val; | |
11 | 10 | use std::ptr::null_mut; |
12 | 11 | use std::{cmp, io}; |
13 | 12 |