about summary refs log tree commit diff
path: root/library/alloc/src/fmt.rs
diff options
context:
space:
mode:
Diffstat (limited to 'library/alloc/src/fmt.rs')
-rw-r--r--library/alloc/src/fmt.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/library/alloc/src/fmt.rs b/library/alloc/src/fmt.rs
index b9918752540..34f87bbf9e4 100644
--- a/library/alloc/src/fmt.rs
+++ b/library/alloc/src/fmt.rs
@@ -630,7 +630,9 @@ pub fn format(args: Arguments<'_>) -> string::String {
     fn format_inner(args: Arguments<'_>) -> string::String {
         let capacity = args.estimated_capacity();
         let mut output = string::String::with_capacity(capacity);
-        output.write_fmt(args).expect("a formatting trait implementation returned an error");
+        output
+            .write_fmt(args)
+            .expect("a formatting trait implementation returned an error when the underlying stream did not");
         output
     }