about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorTaiki Endo <te316e89@gmail.com>2019-02-07 19:44:06 +0900
committerTaiki Endo <te316e89@gmail.com>2019-02-07 19:44:06 +0900
commit1d05f81d19084be01a172205b091bbfe4dd4e5fa (patch)
treed9a3c525583910f24ce93d522a0a1815b488671f /src
parent626e74d5f64cdc820b6c6ac1a5a9a42096cd147a (diff)
downloadrust-1d05f81d19084be01a172205b091bbfe4dd4e5fa.tar.gz
rust-1d05f81d19084be01a172205b091bbfe4dd4e5fa.zip
Add #[must_use] message to Fn* traits
Diffstat (limited to 'src')
-rw-r--r--src/libcore/ops/function.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libcore/ops/function.rs b/src/libcore/ops/function.rs
index 3a1d765f7b8..c69f5fd9896 100644
--- a/src/libcore/ops/function.rs
+++ b/src/libcore/ops/function.rs
@@ -62,7 +62,7 @@
     label="expected an `Fn<{Args}>` closure, found `{Self}`",
 )]
 #[fundamental] // so that regex can rely that `&str: !FnMut`
-#[must_use]
+#[must_use = "closures are lazy and do nothing unless called"]
 pub trait Fn<Args> : FnMut<Args> {
     /// Performs the call operation.
     #[unstable(feature = "fn_traits", issue = "29625")]
@@ -141,7 +141,7 @@ pub trait Fn<Args> : FnMut<Args> {
     label="expected an `FnMut<{Args}>` closure, found `{Self}`",
 )]
 #[fundamental] // so that regex can rely that `&str: !FnMut`
-#[must_use]
+#[must_use = "closures are lazy and do nothing unless called"]
 pub trait FnMut<Args> : FnOnce<Args> {
     /// Performs the call operation.
     #[unstable(feature = "fn_traits", issue = "29625")]
@@ -220,7 +220,7 @@ pub trait FnMut<Args> : FnOnce<Args> {
     label="expected an `FnOnce<{Args}>` closure, found `{Self}`",
 )]
 #[fundamental] // so that regex can rely that `&str: !FnMut`
-#[must_use]
+#[must_use = "closures are lazy and do nothing unless called"]
 pub trait FnOnce<Args> {
     /// The returned type after the call operator is used.
     #[stable(feature = "fn_once_output", since = "1.12.0")]