File tree 2 files changed +8
-2
lines changed
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 {
630
630
fn format_inner ( args : Arguments < ' _ > ) -> string:: String {
631
631
let capacity = args. estimated_capacity ( ) ;
632
632
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" ) ;
634
636
output
635
637
}
636
638
Original file line number Diff line number Diff line change @@ -1839,7 +1839,11 @@ pub trait Write {
1839
1839
if output. error . is_err ( ) {
1840
1840
output. error
1841
1841
} 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
+ ) ;
1843
1847
}
1844
1848
}
1845
1849
}
You can’t perform that action at this time.
0 commit comments