File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -630,7 +630,9 @@ pub fn format(args: Arguments<'_>) -> string::String {
630630 fn format_inner ( args : Arguments < ' _ > ) -> string:: String {
631631 let capacity = args. estimated_capacity ( ) ;
632632 let mut output = string:: String :: with_capacity ( capacity) ;
633- output. write_fmt ( args) . expect ( "a formatting trait implementation returned an error" ) ;
633+ output
634+ . write_fmt ( args)
635+ . expect ( "a formatting trait implementation returned an error when the underlying stream did not" ) ;
634636 output
635637 }
636638
Original file line number Diff line number Diff line change @@ -1839,7 +1839,11 @@ pub trait Write {
18391839 if output. error . is_err ( ) {
18401840 output. error
18411841 } else {
1842- Err ( error:: const_io_error!( ErrorKind :: Uncategorized , "formatter error" ) )
1842+ // This shouldn't happen: the underlying stream did not error, but somehow
1843+ // the formatter still errored?
1844+ panic ! (
1845+ "a formatting trait implementation returned an error when the underlying stream did not"
1846+ ) ;
18431847 }
18441848 }
18451849 }
You can’t perform that action at this time.
0 commit comments