Skip to content

Commit 6b016d7

Browse files
committed
Mark std::fmt::from_fn as #[must_use]
1 parent f2c4ccd commit 6b016d7

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

library/core/src/fmt/builders.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1228,6 +1228,7 @@ impl<'a, 'b: 'a> DebugMap<'a, 'b> {
12281228
/// assert_eq!(format!("{:?}", wrapped), "'a'");
12291229
/// ```
12301230
#[unstable(feature = "debug_closure_helpers", issue = "117729")]
1231+
#[must_use = "returns a type implementing Debug and Display, which do not have any effects unless they are used"]
12311232
pub fn from_fn<F: Fn(&mut fmt::Formatter<'_>) -> fmt::Result>(f: F) -> FromFn<F> {
12321233
FromFn(f)
12331234
}

0 commit comments

Comments
 (0)