Skip to content

Commit ed6028a

Browse files
yotamofekgitbot
authored and
gitbot
committed
Mark std::fmt::from_fn as #[must_use]
1 parent 96c3429 commit ed6028a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

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)