Skip to content

Commit 9b0d03f

Browse files
committed
Run
1 parent 8c48d03 commit 9b0d03f

35 files changed

+111
-0
lines changed

library/core/src/alloc/layout.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,7 @@ impl Error for LayoutError {}
482482
// (we need this for downstream impl of trait Error)
483483
#[stable(feature = "alloc_layout", since = "1.28.0")]
484484
impl fmt::Display for LayoutError {
485+
#[inline]
485486
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
486487
f.write_str("invalid parameters to Layout::from_size_align")
487488
}

library/core/src/alloc/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ impl Error for AllocError {}
4343
// (we need this for downstream impl of trait Error)
4444
#[unstable(feature = "allocator_api", issue = "32838")]
4545
impl fmt::Display for AllocError {
46+
#[inline]
4647
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
4748
f.write_str("memory allocation failed")
4849
}

library/core/src/any.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,7 @@ impl TypeId {
630630
#[must_use]
631631
#[stable(feature = "rust1", since = "1.0.0")]
632632
#[rustc_const_unstable(feature = "const_type_id", issue = "77125")]
633+
#[inline]
633634
pub const fn of<T: ?Sized + 'static>() -> TypeId {
634635
let t: u128 = intrinsics::type_id::<T>();
635636
TypeId { t }

library/core/src/array/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,7 @@ impl<'a, T, const N: usize> IntoIterator for &'a [T; N] {
321321
type Item = &'a T;
322322
type IntoIter = Iter<'a, T>;
323323

324+
#[inline]
324325
fn into_iter(self) -> Iter<'a, T> {
325326
self.iter()
326327
}

library/core/src/ascii/ascii_char.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -559,6 +559,7 @@ impl [AsciiChar] {
559559

560560
#[unstable(feature = "ascii_char", issue = "110998")]
561561
impl fmt::Display for AsciiChar {
562+
#[inline]
562563
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
563564
<str as fmt::Display>::fmt(self.as_str(), f)
564565
}

library/core/src/cell.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -722,6 +722,7 @@ impl Debug for BorrowError {
722722

723723
#[stable(feature = "try_borrow", since = "1.13.0")]
724724
impl Display for BorrowError {
725+
#[inline]
725726
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
726727
Display::fmt("already mutably borrowed", f)
727728
}
@@ -749,6 +750,7 @@ impl Debug for BorrowMutError {
749750

750751
#[stable(feature = "try_borrow", since = "1.13.0")]
751752
impl Display for BorrowMutError {
753+
#[inline]
752754
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
753755
Display::fmt("already borrowed", f)
754756
}

library/core/src/char/convert.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ pub struct CharTryFromError(());
264264

265265
#[stable(feature = "try_from", since = "1.34.0")]
266266
impl fmt::Display for CharTryFromError {
267+
#[inline]
267268
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
268269
"converted integer out of range for `char`".fmt(f)
269270
}

library/core/src/char/mod.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,11 +219,13 @@ impl fmt::Display for EscapeUnicode {
219219
pub struct EscapeDefault(escape::EscapeIterInner<10>);
220220

221221
impl EscapeDefault {
222+
#[inline]
222223
fn printable(chr: ascii::Char) -> Self {
223224
let data = [chr];
224225
Self(escape::EscapeIterInner::from_array(data))
225226
}
226227

228+
#[inline]
227229
fn backslash(chr: ascii::Char) -> Self {
228230
let data = [ascii::Char::ReverseSolidus, chr];
229231
Self(escape::EscapeIterInner::from_array(data))
@@ -308,6 +310,7 @@ impl EscapeDebug {
308310
Self(EscapeDebugInner::Char(chr))
309311
}
310312

313+
#[inline]
311314
fn backslash(chr: ascii::Char) -> Self {
312315
let data = [ascii::Char::ReverseSolidus, chr];
313316
let iter = escape::EscapeIterInner::from_array(data);
@@ -318,6 +321,7 @@ impl EscapeDebug {
318321
Self(EscapeDebugInner::Bytes(esc.0))
319322
}
320323

324+
#[inline]
321325
fn clear(&mut self) {
322326
let bytes = escape::EscapeIterInner::from_array([]);
323327
self.0 = EscapeDebugInner::Bytes(bytes);
@@ -386,6 +390,7 @@ pub struct ToLowercase(CaseMappingIter);
386390
#[stable(feature = "rust1", since = "1.0.0")]
387391
impl Iterator for ToLowercase {
388392
type Item = char;
393+
#[inline]
389394
fn next(&mut self) -> Option<char> {
390395
self.0.next()
391396
}
@@ -396,6 +401,7 @@ impl Iterator for ToLowercase {
396401

397402
#[stable(feature = "case_mapping_double_ended", since = "1.59.0")]
398403
impl DoubleEndedIterator for ToLowercase {
404+
#[inline]
399405
fn next_back(&mut self) -> Option<char> {
400406
self.0.next_back()
401407
}
@@ -420,6 +426,7 @@ pub struct ToUppercase(CaseMappingIter);
420426
#[stable(feature = "rust1", since = "1.0.0")]
421427
impl Iterator for ToUppercase {
422428
type Item = char;
429+
#[inline]
423430
fn next(&mut self) -> Option<char> {
424431
self.0.next()
425432
}
@@ -430,6 +437,7 @@ impl Iterator for ToUppercase {
430437

431438
#[stable(feature = "case_mapping_double_ended", since = "1.59.0")]
432439
impl DoubleEndedIterator for ToUppercase {
440+
#[inline]
433441
fn next_back(&mut self) -> Option<char> {
434442
self.0.next_back()
435443
}
@@ -534,13 +542,15 @@ impl fmt::Display for CaseMappingIter {
534542

535543
#[stable(feature = "char_struct_display", since = "1.16.0")]
536544
impl fmt::Display for ToLowercase {
545+
#[inline]
537546
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
538547
fmt::Display::fmt(&self.0, f)
539548
}
540549
}
541550

542551
#[stable(feature = "char_struct_display", since = "1.16.0")]
543552
impl fmt::Display for ToUppercase {
553+
#[inline]
544554
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
545555
fmt::Display::fmt(&self.0, f)
546556
}
@@ -553,6 +563,7 @@ pub struct TryFromCharError(pub(crate) ());
553563

554564
#[stable(feature = "u8_from_char", since = "1.59.0")]
555565
impl fmt::Display for TryFromCharError {
566+
#[inline]
556567
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
557568
"unicode code point out of range".fmt(fmt)
558569
}

library/core/src/escape.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,12 @@ impl<const N: usize> EscapeIterInner<N> {
8282
Self::new(data, 0..M as u8)
8383
}
8484

85+
#[inline]
8586
pub fn as_ascii(&self) -> &[ascii::Char] {
8687
&self.data[usize::from(self.alive.start)..usize::from(self.alive.end)]
8788
}
8889

90+
#[inline]
8991
pub fn as_str(&self) -> &str {
9092
self.as_ascii().as_str()
9193
}

library/core/src/ffi/c_str.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ pub struct FromBytesUntilNulError(());
158158

159159
#[stable(feature = "cstr_from_bytes_until_nul", since = "1.69.0")]
160160
impl fmt::Display for FromBytesUntilNulError {
161+
#[inline]
161162
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
162163
write!(f, "data provided does not contain a nul")
163164
}

library/core/src/fmt/builders.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ impl Default for PadAdapterState {
1818
}
1919

2020
impl<'buf, 'state> PadAdapter<'buf, 'state> {
21+
#[inline]
2122
fn wrap<'slot, 'fmt: 'buf + 'slot>(
2223
fmt: &'fmt mut fmt::Formatter<'_>,
2324
slot: &'slot mut Option<Self>,
@@ -91,6 +92,7 @@ pub struct DebugStruct<'a, 'b: 'a> {
9192
has_fields: bool,
9293
}
9394

95+
#[inline]
9496
pub(super) fn debug_struct_new<'a, 'b>(
9597
fmt: &'a mut fmt::Formatter<'b>,
9698
name: &str,
@@ -138,6 +140,7 @@ impl<'a, 'b: 'a> DebugStruct<'a, 'b> {
138140
/// This method is equivalent to [`DebugStruct::field`], but formats the
139141
/// value using a provided closure rather than by calling [`Debug::fmt`].
140142
#[unstable(feature = "debug_closure_helpers", issue = "117729")]
143+
#[inline]
141144
pub fn field_with<F>(&mut self, name: &str, value_fmt: F) -> &mut Self
142145
where
143146
F: FnOnce(&mut fmt::Formatter<'_>) -> fmt::Result,
@@ -293,6 +296,7 @@ pub struct DebugTuple<'a, 'b: 'a> {
293296
empty_name: bool,
294297
}
295298

299+
#[inline]
296300
pub(super) fn debug_tuple_new<'a, 'b>(
297301
fmt: &'a mut fmt::Formatter<'b>,
298302
name: &str,
@@ -326,6 +330,7 @@ impl<'a, 'b: 'a> DebugTuple<'a, 'b> {
326330
/// );
327331
/// ```
328332
#[stable(feature = "debug_builders", since = "1.2.0")]
333+
#[inline]
329334
pub fn field(&mut self, value: &dyn fmt::Debug) -> &mut Self {
330335
self.field_with(|f| value.fmt(f))
331336
}
@@ -409,6 +414,7 @@ struct DebugInner<'a, 'b: 'a> {
409414
}
410415

411416
impl<'a, 'b: 'a> DebugInner<'a, 'b> {
417+
#[inline]
412418
fn entry_with<F>(&mut self, entry_fmt: F)
413419
where
414420
F: FnOnce(&mut fmt::Formatter<'_>) -> fmt::Result,
@@ -471,6 +477,7 @@ pub struct DebugSet<'a, 'b: 'a> {
471477
inner: DebugInner<'a, 'b>,
472478
}
473479

480+
#[inline]
474481
pub(super) fn debug_set_new<'a, 'b>(fmt: &'a mut fmt::Formatter<'b>) -> DebugSet<'a, 'b> {
475482
let result = fmt.write_str("{");
476483
DebugSet { inner: DebugInner { fmt, result, has_fields: false } }
@@ -614,6 +621,7 @@ pub struct DebugList<'a, 'b: 'a> {
614621
inner: DebugInner<'a, 'b>,
615622
}
616623

624+
#[inline]
617625
pub(super) fn debug_list_new<'a, 'b>(fmt: &'a mut fmt::Formatter<'b>) -> DebugList<'a, 'b> {
618626
let result = fmt.write_str("[");
619627
DebugList { inner: DebugInner { fmt, result, has_fields: false } }
@@ -762,6 +770,7 @@ pub struct DebugMap<'a, 'b: 'a> {
762770
state: PadAdapterState,
763771
}
764772

773+
#[inline]
765774
pub(super) fn debug_map_new<'a, 'b>(fmt: &'a mut fmt::Formatter<'b>) -> DebugMap<'a, 'b> {
766775
let result = fmt.write_str("{");
767776
DebugMap { fmt, result, has_fields: false, has_key: false, state: Default::default() }
@@ -836,6 +845,7 @@ impl<'a, 'b: 'a> DebugMap<'a, 'b> {
836845
/// This method is equivalent to [`DebugMap::key`], but formats the
837846
/// key using a provided closure rather than by calling [`Debug::fmt`].
838847
#[unstable(feature = "debug_closure_helpers", issue = "117729")]
848+
#[inline]
839849
pub fn key_with<F>(&mut self, key_fmt: F) -> &mut Self
840850
where
841851
F: FnOnce(&mut fmt::Formatter<'_>) -> fmt::Result,
@@ -912,6 +922,7 @@ impl<'a, 'b: 'a> DebugMap<'a, 'b> {
912922
/// This method is equivalent to [`DebugMap::value`], but formats the
913923
/// value using a provided closure rather than by calling [`Debug::fmt`].
914924
#[unstable(feature = "debug_closure_helpers", issue = "117729")]
925+
#[inline]
915926
pub fn value_with<F>(&mut self, value_fmt: F) -> &mut Self
916927
where
917928
F: FnOnce(&mut fmt::Formatter<'_>) -> fmt::Result,

library/core/src/fmt/float.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,27 +198,31 @@ macro_rules! floating {
198198
($ty:ident) => {
199199
#[stable(feature = "rust1", since = "1.0.0")]
200200
impl Debug for $ty {
201+
#[inline]
201202
fn fmt(&self, fmt: &mut Formatter<'_>) -> Result {
202203
float_to_general_debug(fmt, self)
203204
}
204205
}
205206

206207
#[stable(feature = "rust1", since = "1.0.0")]
207208
impl Display for $ty {
209+
#[inline]
208210
fn fmt(&self, fmt: &mut Formatter<'_>) -> Result {
209211
float_to_decimal_display(fmt, self)
210212
}
211213
}
212214

213215
#[stable(feature = "rust1", since = "1.0.0")]
214216
impl LowerExp for $ty {
217+
#[inline]
215218
fn fmt(&self, fmt: &mut Formatter<'_>) -> Result {
216219
float_to_exponential_common(fmt, self, false)
217220
}
218221
}
219222

220223
#[stable(feature = "rust1", since = "1.0.0")]
221224
impl UpperExp for $ty {
225+
#[inline]
222226
fn fmt(&self, fmt: &mut Formatter<'_>) -> Result {
223227
float_to_exponential_common(fmt, self, true)
224228
}

0 commit comments

Comments
 (0)