summary refs log tree commit diff
path: root/compiler/rustc_serialize
diff options
context:
space:
mode:
authorThalia Archibald <thalia@archibald.dev>2025-03-04 20:28:38 -0800
committerThalia Archibald <thalia@archibald.dev>2025-03-07 13:37:04 -0800
commit38fad984c616cf4d10f653fa50c85cdc01083373 (patch)
tree7f4adb9e03b34d02336020ce9123e6dd1e2bb12f /compiler/rustc_serialize
parentac951d379913c667a1fb73a0830e81d65d2007cf (diff)
downloadrust-38fad984c616cf4d10f653fa50c85cdc01083373.tar.gz
rust-38fad984c616cf4d10f653fa50c85cdc01083373.zip
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.

These functions were added to all preludes in Rust 1.80.
Diffstat (limited to 'compiler/rustc_serialize')
-rw-r--r--compiler/rustc_serialize/src/leb128.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_serialize/src/leb128.rs b/compiler/rustc_serialize/src/leb128.rs
index aa7c2858466..4a475805697 100644
--- a/compiler/rustc_serialize/src/leb128.rs
+++ b/compiler/rustc_serialize/src/leb128.rs
@@ -7,7 +7,7 @@ use crate::serialize::Decoder;
 /// Returns the length of the longest LEB128 encoding for `T`, assuming `T` is an integer type
 pub const fn max_leb128_len<T>() -> usize {
     // The longest LEB128 encoding for an integer uses 7 bits per byte.
-    (std::mem::size_of::<T>() * 8 + 6) / 7
+    (size_of::<T>() * 8 + 6) / 7
 }
 
 /// Returns the length of the longest LEB128 encoding of all supported integer types.