diff options
| author | Elias Holzmann <9659253+EliasHolzmann@users.noreply.github.com> | 2023-11-22 01:52:13 +0100 |
|---|---|---|
| committer | Elias Holzmann <9659253+EliasHolzmann@users.noreply.github.com> | 2024-12-05 21:48:01 +0100 |
| commit | f17d13285c04b71c804d83fdf2eb8e82f0c6096f (patch) | |
| tree | 67682086fee5418ce80fb1db91c7e49e8ab64ccc /library/std/src | |
| parent | 1d7984a132663296d0652a9059df46d2a393fcb5 (diff) | |
| download | rust-f17d13285c04b71c804d83fdf2eb8e82f0c6096f.tar.gz rust-f17d13285c04b71c804d83fdf2eb8e82f0c6096f.zip | |
Added struct `fmt::FormattingOptions`
This allows to build custom `std::Formatter`s at runtime. Also added some related enums and two related methods on `std::Formatter`.
Diffstat (limited to 'library/std/src')
| -rw-r--r-- | library/std/src/lib.rs | 1 | ||||
| -rw-r--r-- | library/std/src/panicking.rs | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/library/std/src/lib.rs b/library/std/src/lib.rs index 6be27b283b2..49a03220039 100644 --- a/library/std/src/lib.rs +++ b/library/std/src/lib.rs @@ -292,6 +292,7 @@ #![feature(dropck_eyepatch)] #![feature(f128)] #![feature(f16)] +#![feature(formatting_options)] #![feature(if_let_guard)] #![feature(intra_doc_pointers)] #![feature(lang_items)] diff --git a/library/std/src/panicking.rs b/library/std/src/panicking.rs index 97f800dddaa..dca5ccca0c4 100644 --- a/library/std/src/panicking.rs +++ b/library/std/src/panicking.rs @@ -623,7 +623,7 @@ pub fn begin_panic_handler(info: &core::panic::PanicInfo<'_>) -> ! { // Lazily, the first time this gets called, run the actual string formatting. self.string.get_or_insert_with(|| { let mut s = String::new(); - let mut fmt = fmt::Formatter::new(&mut s); + let mut fmt = fmt::Formatter::new(&mut s, fmt::FormattingOptions::new()); let _err = fmt::Display::fmt(&inner, &mut fmt); s }) |
