2018-09-10 22:06:49 +00:00
|
|
|
// Test that cfg_attr with multiple attributes actually emits both attributes.
|
|
|
|
// This is done by emitting two attributes that cause new warnings, and then
|
|
|
|
// triggering those warnings.
|
|
|
|
|
2019-07-02 21:30:28 +00:00
|
|
|
// build-pass (FIXME(62277): could be check-pass?)
|
2018-09-10 22:06:49 +00:00
|
|
|
|
|
|
|
#![warn(unused_must_use)]
|
|
|
|
|
|
|
|
#[cfg_attr(all(), deprecated, must_use)]
|
|
|
|
struct MustUseDeprecated {}
|
|
|
|
|
2020-07-25 17:49:46 +00:00
|
|
|
impl MustUseDeprecated { //~ warning: use of deprecated
|
|
|
|
fn new() -> MustUseDeprecated { //~ warning: use of deprecated
|
|
|
|
MustUseDeprecated {} //~ warning: use of deprecated
|
2018-09-10 22:06:49 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2020-07-25 17:49:46 +00:00
|
|
|
MustUseDeprecated::new(); //~ warning: use of deprecated
|
2019-10-24 00:00:00 +00:00
|
|
|
//~| warning: unused `MustUseDeprecated` that must be used
|
2018-09-10 22:06:49 +00:00
|
|
|
}
|