Skip to content

Switch inline(always) in core/src/fmt/rt.rs to plain inline #134047

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
Dec 13, 2024
Merged
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
34 changes: 17 additions & 17 deletions library/core/src/fmt/rt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub struct Placeholder {
}

impl Placeholder {
#[inline(always)]
#[inline]
pub const fn new(
position: usize,
fill: char,
Expand Down Expand Up @@ -95,7 +95,7 @@ pub struct Argument<'a> {

#[rustc_diagnostic_item = "ArgumentMethods"]
impl Argument<'_> {
#[inline(always)]
#[inline]
fn new<'a, T>(x: &'a T, f: fn(&T, &mut Formatter<'_>) -> Result) -> Argument<'a> {
Argument {
// INVARIANT: this creates an `ArgumentType<'a>` from a `&'a T` and
Expand All @@ -109,47 +109,47 @@ impl Argument<'_> {
}
}

#[inline(always)]
#[inline]
pub fn new_display<T: Display>(x: &T) -> Argument<'_> {
Self::new(x, Display::fmt)
}
#[inline(always)]
#[inline]
pub fn new_debug<T: Debug>(x: &T) -> Argument<'_> {
Self::new(x, Debug::fmt)
}
#[inline(always)]
#[inline]
pub fn new_debug_noop<T: Debug>(x: &T) -> Argument<'_> {
Self::new(x, |_, _| Ok(()))
}
#[inline(always)]
#[inline]
pub fn new_octal<T: Octal>(x: &T) -> Argument<'_> {
Self::new(x, Octal::fmt)
}
#[inline(always)]
#[inline]
pub fn new_lower_hex<T: LowerHex>(x: &T) -> Argument<'_> {
Self::new(x, LowerHex::fmt)
}
#[inline(always)]
#[inline]
pub fn new_upper_hex<T: UpperHex>(x: &T) -> Argument<'_> {
Self::new(x, UpperHex::fmt)
}
#[inline(always)]
#[inline]
pub fn new_pointer<T: Pointer>(x: &T) -> Argument<'_> {
Self::new(x, Pointer::fmt)
}
#[inline(always)]
#[inline]
pub fn new_binary<T: Binary>(x: &T) -> Argument<'_> {
Self::new(x, Binary::fmt)
}
#[inline(always)]
#[inline]
pub fn new_lower_exp<T: LowerExp>(x: &T) -> Argument<'_> {
Self::new(x, LowerExp::fmt)
}
#[inline(always)]
#[inline]
pub fn new_upper_exp<T: UpperExp>(x: &T) -> Argument<'_> {
Self::new(x, UpperExp::fmt)
}
#[inline(always)]
#[inline]
pub fn from_usize(x: &usize) -> Argument<'_> {
Argument { ty: ArgumentType::Count(*x) }
}
Expand All @@ -164,7 +164,7 @@ impl Argument<'_> {
// it here is an explicit CFI violation.
#[allow(inline_no_sanitize)]
#[no_sanitize(cfi, kcfi)]
#[inline(always)]
#[inline]
pub(super) unsafe fn fmt(&self, f: &mut Formatter<'_>) -> Result {
match self.ty {
// SAFETY:
Expand All @@ -180,7 +180,7 @@ impl Argument<'_> {
}
}

#[inline(always)]
#[inline]
pub(super) fn as_usize(&self) -> Option<usize> {
match self.ty {
ArgumentType::Count(count) => Some(count),
Expand All @@ -198,7 +198,7 @@ impl Argument<'_> {
/// let f = format_args!("{}", "a");
/// println!("{f}");
/// ```
#[inline(always)]
#[inline]
pub fn none() -> [Self; 0] {
[]
}
Expand All @@ -215,7 +215,7 @@ pub struct UnsafeArg {
impl UnsafeArg {
/// See documentation where `UnsafeArg` is required to know when it is safe to
/// create and use `UnsafeArg`.
#[inline(always)]
#[inline]
pub unsafe fn new() -> Self {
Self { _private: () }
}
Expand Down
Loading