fn_must_use soft feature-gate warning on methods too, not only functions

This continues to be in the matter of #43302.
This commit is contained in:
Zack M. Davis 2017-08-22 17:27:00 -07:00
parent 8492ad2479
commit 35c449419c
2 changed files with 18 additions and 1 deletions

View file

@ -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