Skip to content

Commit 06baec6

Browse files
authored
Unrolled build for #150300
Rollup merge of #150300 - EFanZh:patch-1, r=dtolnay,tgross35 Constify `fmt::from_fn` See <#117729 (comment)>.
2 parents 905b926 + df25df1 commit 06baec6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

library/core/src/fmt/builders.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1227,8 +1227,9 @@ impl<'a, 'b: 'a> DebugMap<'a, 'b> {
12271227
/// assert_eq!(format!("{:?}", wrapped), "'a'");
12281228
/// ```
12291229
#[stable(feature = "fmt_from_fn", since = "1.93.0")]
1230+
#[rustc_const_stable(feature = "const_fmt_from_fn", since = "CURRENT_RUSTC_VERSION")]
12301231
#[must_use = "returns a type implementing Debug and Display, which do not have any effects unless they are used"]
1231-
pub fn from_fn<F: Fn(&mut fmt::Formatter<'_>) -> fmt::Result>(f: F) -> FromFn<F> {
1232+
pub const fn from_fn<F: Fn(&mut fmt::Formatter<'_>) -> fmt::Result>(f: F) -> FromFn<F> {
12321233
FromFn(f)
12331234
}
12341235

0 commit comments

Comments
 (0)