From 35c449419cfbd2bc1abc81077c95ef43ed766f97 Mon Sep 17 00:00:00 2001 From: "Zack M. Davis" Date: Tue, 22 Aug 2017 17:27:00 -0700 Subject: fn_must_use soft feature-gate warning on methods too, not only functions This continues to be in the matter of #43302. --- src/test/compile-fail/feature-gate-fn_must_use.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/test') 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 -- cgit 1.4.1-3-g733a5