diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2025-06-22 17:35:35 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-22 17:35:35 +0200 |
| commit | 0f89e61c4dd4f274029673d2963465cbf73d58c2 (patch) | |
| tree | 0ed19cddd00e533a4b0e0c3c137316bf8d9ae070 /compiler | |
| parent | 194e58c75cd38475fdda7979975b0c69a0e20e3f (diff) | |
| parent | 8e9552a6b5f05b181e9b550880d252d5282f96fe (diff) | |
| download | rust-0f89e61c4dd4f274029673d2963465cbf73d58c2.tar.gz rust-0f89e61c4dd4f274029673d2963465cbf73d58c2.zip | |
Rollup merge of #142856 - cjgillot:inline-serialize, r=petrochenkov
Add a few inline directives in rustc_serialize. I see `debug_strict_add` and `debug_strict_sub` appearing in callgrind output. This bothers me. This PR should make them disappear.
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_serialize/src/int_overflow.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_serialize/src/opaque.rs | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/compiler/rustc_serialize/src/int_overflow.rs b/compiler/rustc_serialize/src/int_overflow.rs index f2aac2ef711..6782fbc33da 100644 --- a/compiler/rustc_serialize/src/int_overflow.rs +++ b/compiler/rustc_serialize/src/int_overflow.rs @@ -20,6 +20,7 @@ macro_rules! impl_debug_strict_add { ($( $ty:ty )*) => { $( impl DebugStrictAdd for $ty { + #[inline] fn debug_strict_add(self, other: Self) -> Self { if cfg!(debug_assertions) { self + other @@ -42,6 +43,7 @@ macro_rules! impl_debug_strict_sub { ($( $ty:ty )*) => { $( impl DebugStrictSub for $ty { + #[inline] fn debug_strict_sub(self, other: Self) -> Self { if cfg!(debug_assertions) { self - other diff --git a/compiler/rustc_serialize/src/opaque.rs b/compiler/rustc_serialize/src/opaque.rs index 00bad8e70cf..4242642c664 100644 --- a/compiler/rustc_serialize/src/opaque.rs +++ b/compiler/rustc_serialize/src/opaque.rs @@ -89,10 +89,12 @@ impl FileEncoder { self.buffered = 0; } + #[inline] pub fn file(&self) -> &File { &self.file } + #[inline] pub fn path(&self) -> &Path { &self.path } |
