diff options
| author | Taiki Endo <te316e89@gmail.com> | 2019-02-07 19:44:06 +0900 |
|---|---|---|
| committer | Taiki Endo <te316e89@gmail.com> | 2019-02-07 19:44:06 +0900 |
| commit | 1d05f81d19084be01a172205b091bbfe4dd4e5fa (patch) | |
| tree | d9a3c525583910f24ce93d522a0a1815b488671f /src/libcore | |
| parent | 626e74d5f64cdc820b6c6ac1a5a9a42096cd147a (diff) | |
| download | rust-1d05f81d19084be01a172205b091bbfe4dd4e5fa.tar.gz rust-1d05f81d19084be01a172205b091bbfe4dd4e5fa.zip | |
Add #[must_use] message to Fn* traits
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/ops/function.rs | 6 |
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")] |
