Repository navigation
Closed
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-api[DEPRECATED; DO NOT USE][DEPRECATED; DO NOT USE]disposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.This issue / PR is in PFCP or FCP with a disposition to merge it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.The final comment period is finished for this PR / Issue.
Milestone
Description
Feature gate: #![feature(fmt_from_fn)]
This is a tracking issue for core::fmt::from_fn, split off from [117729] Tracking issue for debug_closure_helpers.
Public API
// core::fmt
pub fn from_fn<F>(f: F) -> FromFn<F>
where
F: Fn(&mut Formatter<'_>) -> Result
{
FromFn(f)
}
pub struct FromFn<F>(F);
impl<F> fmt::Debug for FromFn<F>
where
F: Fn(&mut fmt::Formatter<'_>) -> fmt::Result;
impl<F> fmt::Display for FromFn<F>
where
F: Fn(&mut fmt::Formatter<'_>) -> fmt::Result;Steps / History
(Remember to update the S-tracking-* label when checking boxes.)
- Implementation: Closure-consuming helper functions for
fmt::Debughelpers #117730 - Update to
from_fnAPI: Replacestd::fmt:FormatterFnwithstd::fmt::from_fn#129017 - Final comment period (FCP)1
- Stabilization PR: Stabilize
fmt::from_fn#145915
Unresolved Questions
- None yet.
Footnotes
Reacted by Johannes Dahlström
Reacted by Cameron Steffen and Ludwig Stecher
Metadata
Metadata
Assignees
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-api[DEPRECATED; DO NOT USE][DEPRECATED; DO NOT USE]disposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.This issue / PR is in PFCP or FCP with a disposition to merge it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.The final comment period is finished for this PR / Issue.
Activity
jmillikin commentedon Sep 18, 2025
Proposed stabilization PR: #145915
Amanieu commentedon Sep 18, 2025
@rfcbot merge
rust-rfcbot commentedon Sep 18, 2025
Team member @Amanieu has proposed to merge this. The next step is review by the rest of the tagged team members:
No concerns currently listed.
Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!
See this document for info about what commands tagged team members can give me.
Amanieu commentedon Sep 18, 2025
I believe the motivation for adding the bounds on
Fdirectly on the struct no longer applies since this is now constructed usingfrom_fninstead of having apubfield.rust-rfcbot commentedon Oct 15, 2025
🔔 This is now entering its final comment period, as per the review above. 🔔
camsteffen commentedon Oct 24, 2025
Should it use FnMut?
Edit: no, Display takes &self.
rust-rfcbot commentedon Oct 25, 2025
The final comment period, with a disposition to merge, as per the review above, is now complete.
As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed.
This will be merged soon.
Rollup merge of rust-lang#145915 - coolreader18:stabilize-fmt_from_fn…
Rollup merge of rust-lang#145915 - coolreader18:stabilize-fmt_from_fn…
Rollup merge of rust-lang#145915 - coolreader18:stabilize-fmt_from_fn…
Unrolled build for #145915
Rollup merge of rust-lang#145915 - coolreader18:stabilize-fmt_from_fn…