about summary refs log tree commit diff
path: root/library/core/src/fmt/rt.rs
AgeCommit message (Collapse)AuthorLines
2025-06-18Allow storing `format_args!()` in `let`.Mara Bos-36/+2
This uses `super let` to allow let f = format_args!("Hello {}", world); println!("{f}"); to work.
2025-05-12update cfg(bootstrap)Pietro Albini-8/+0
2025-05-01Clean up "const" situation in format_args!().Mara Bos-21/+27
Rather than marking the Argument::new_display etc. functions as non-const, this marks the Arguments::new_v1 functions as non-const.
2025-05-01Move core::fmt::Arguments::new_v1* to rt.rs.Mara Bos-1/+44
2025-04-30Rollup merge of #139624 - m-ou-se:unconst-format-args, r=jhprattMatthias Krüger-1/+8
Don't allow flattened format_args in const. Fixes https://github.com/rust-lang/rust/issues/139136 Fixes https://github.com/rust-lang/rust/issues/139621 We allow `format_args!("a")` in const, but don't allow any format_args with arguments in const, such as `format_args!("{}", arg)`. However, we accidentally allow `format_args!("hello {}", "world")` in const, as it gets flattened to `format_args!("hello world")`. This also applies to panic in const. This wasn't supposed to happen. I added protection against this in the format args flattening code, ~~but I accidentally marked a function as const that shouldn't have been const~~ but this was removed in https://github.com/rust-lang/rust/pull/135139. This is a breaking change. The crater found no breakage, however. This breaks things like: ```rust const _: () = if false { panic!("a {}", "a") }; ``` and ```rust const F: std::fmt::Arguments<'static> = format_args!("a {}", "a"); ```
2025-04-15Add commentAlice Ryhl-0/+19
Co-authored-by: Ralf Jung <post@ralfj.de>
2025-04-15Use full path for core::mem::transmuteAlice Ryhl-1/+1
Suggested-by: Tamir Duberstein <tamird@gmail.com> Signed-off-by: Alice Ryhl <aliceryhl@google.com>
2025-04-12cfg(kcfi)Alice Ryhl-0/+7
2025-04-11Update library/core/src/fmt/rt.rsAlice Ryhl-1/+0
2025-04-10cfi: do not transmute function pointers in formatting codeAlice Ryhl-22/+23
2025-04-10Don't allow flattened format_args in const.Mara Bos-1/+8
2025-04-09update cfgsBoxy-27/+2
2025-03-30Simplify expansion for format_args!().Mara Bos-7/+1
Instead of calling new(), we can just use a struct expression directly. Before: Placeholder::new(…, …, …, …) After: Placeholder { position: …, flags: …, width: …, precision: …, }
2025-03-12Reduce FormattingOptions to 64 bits.Mara Bos-11/+10
2025-03-10Add #[track_caller] to from_usize.Mara Bos-0/+1
2025-03-10Remove unnecessary semicolon.Mara Bos-1/+1
2025-03-10Limit formatting width and precision to 16 bits.Mara Bos-3/+10
2025-01-05[generic_assert] Constify methods used by the formatting systemCaio-6/+6
2024-12-08Switch inline(always) in core/src/fmt/rt.rs to plain inlineBen Kimock-17/+17
2024-10-14`rt::Argument`: elide lifetimesLieselotte-13/+13
2024-08-31Fix `elided_named_lifetimes` in codePavel Grigorenko-10/+10
2024-08-28fmt-debug optionKornel-0/+4
Allows disabling `fmt::Debug` derive and debug formatting.
2024-06-27core: improve commentjoboet-2/+2
Co-authored-by: Ralf Jung <post@ralfj.de>
2024-06-26core: avoid `extern` types in formatting infrastructurejoboet-21/+25
2024-04-24chore: fix some typos in commentswhosehang-1/+1
Signed-off-by: whosehang <whosehang@outlook.com>
2024-04-12core: get rid of `USIZE_MARKER`joboet-43/+41
2023-10-04Disable CFI for core and std CFI violationsRamon de C Valle-0/+4
Works around #115199 by temporarily disabling CFI for core and std CFI violations to allow the user rebuild and use both core and std with CFI enabled using the Cargo build-std feature.
2023-05-09Limit lifetime of format_args!() with inlined args.Mara Bos-0/+15
2023-04-27pub -> pub(super).Mara Bos-1/+1
2023-04-24Restructure std::fmt::rt a bit.Mara Bos-6/+148
This moves more of the internal/lang items into the private rt module.
2023-04-20Add reason to #![unstable] tag.Mara Bos-1/+1
Co-authored-by: jyn <github@jyn.dev>
2023-04-20Get rid of core::fmt::FormatSpec.Mara Bos-6/+1
2023-04-20Rename fmt::rt::Argument to Placeholder.Mara Bos-3/+2
2023-04-20Turn core::fmt::rt::v1 into a private module.Mara Bos-0/+61