Skip to content

Add a few inline directives in rustc_serialize. #142856

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions compiler/rustc_serialize/src/int_overflow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 2 additions & 0 deletions compiler/rustc_serialize/src/opaque.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
Loading