diff --git a/library/alloc/src/string.rs b/library/alloc/src/string.rs index 05398ca68c8..d7d7b6bd157 100644 --- a/library/alloc/src/string.rs +++ b/library/alloc/src/string.rs @@ -2196,6 +2196,9 @@ pub trait ToString { /// since `fmt::Write for String` never returns an error itself. #[stable(feature = "rust1", since = "1.0.0")] impl ToString for T { + // A common guideline is to not inline generic functions. However, + // remove `#[inline]` from this method causes non-negligible regression. + // See as last attempt try to remove it. #[inline] default fn to_string(&self) -> String { use fmt::Write;