diff options
| author | Zack M. Davis <code@zackmdavis.net> | 2017-08-22 17:27:00 -0700 |
|---|---|---|
| committer | Zack M. Davis <code@zackmdavis.net> | 2017-08-22 20:39:56 -0700 |
| commit | 35c449419cfbd2bc1abc81077c95ef43ed766f97 (patch) | |
| tree | f8f5facf0819d103607dd504896e9a5ea9d91cec /src/test/compile-fail | |
| parent | 8492ad2479379d2e07ccf2d3439ec29b19d164b8 (diff) | |
| download | rust-35c449419cfbd2bc1abc81077c95ef43ed766f97.tar.gz rust-35c449419cfbd2bc1abc81077c95ef43ed766f97.zip | |
fn_must_use soft feature-gate warning on methods too, not only functions
This continues to be in the matter of #43302.
Diffstat (limited to 'src/test/compile-fail')
| -rw-r--r-- | src/test/compile-fail/feature-gate-fn_must_use.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/test/compile-fail/feature-gate-fn_must_use.rs b/src/test/compile-fail/feature-gate-fn_must_use.rs index a222f366145..2dd6b904072 100644 --- a/src/test/compile-fail/feature-gate-fn_must_use.rs +++ b/src/test/compile-fail/feature-gate-fn_must_use.rs @@ -10,6 +10,13 @@ #![feature(rustc_attrs)] +struct MyStruct; + +impl MyStruct { + #[must_use] + fn need_to_use_method() -> bool { true } //~ WARN `#[must_use]` on methods is experimental +} + #[must_use] fn need_to_use_it() -> bool { true } //~ WARN `#[must_use]` on functions is experimental |
