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:
parent
8492ad2479
commit
35c449419c
2 changed files with 18 additions and 1 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue