From 6b016d7e592798610f6313891cbc3ba81906f894 Mon Sep 17 00:00:00 2001 From: Yotam Ofek Date: Mon, 3 Feb 2025 19:18:07 +0000 Subject: [PATCH] Mark `std::fmt::from_fn` as `#[must_use]` --- library/core/src/fmt/builders.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/library/core/src/fmt/builders.rs b/library/core/src/fmt/builders.rs index 1862be0e86c5d..665b05b12ec07 100644 --- a/library/core/src/fmt/builders.rs +++ b/library/core/src/fmt/builders.rs @@ -1228,6 +1228,7 @@ impl<'a, 'b: 'a> DebugMap<'a, 'b> { /// assert_eq!(format!("{:?}", wrapped), "'a'"); /// ``` #[unstable(feature = "debug_closure_helpers", issue = "117729")] +#[must_use = "returns a type implementing Debug and Display, which do not have any effects unless they are used"] pub fn from_fn) -> fmt::Result>(f: F) -> FromFn { FromFn(f) }