Rollup merge of #150300 - EFanZh:patch-1, r=dtolnay,tgross35
Constify `fmt::from_fn` See <https://github.com/rust-lang/rust/issues/117729#issuecomment-3683047620>.
This commit is contained in:
commit
f580ca88ee
1 changed files with 2 additions and 1 deletions
|
|
@ -1227,8 +1227,9 @@ impl<'a, 'b: 'a> DebugMap<'a, 'b> {
|
|||
/// assert_eq!(format!("{:?}", wrapped), "'a'");
|
||||
/// ```
|
||||
#[stable(feature = "fmt_from_fn", since = "1.93.0")]
|
||||
#[rustc_const_stable(feature = "const_fmt_from_fn", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[must_use = "returns a type implementing Debug and Display, which do not have any effects unless they are used"]
|
||||
pub fn from_fn<F: Fn(&mut fmt::Formatter<'_>) -> fmt::Result>(f: F) -> FromFn<F> {
|
||||
pub const fn from_fn<F: Fn(&mut fmt::Formatter<'_>) -> fmt::Result>(f: F) -> FromFn<F> {
|
||||
FromFn(f)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue