2018-09-10 15:06:49 -07: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-03 06:30:28 +09:00
|
|
|
// build-pass (FIXME(62277): could be check-pass?)
|
2018-09-10 15:06:49 -07:00
|
|
|
|
|
|
|
#![warn(unused_must_use)]
|
|
|
|
|
|
|
|
#[cfg_attr(all(), deprecated, must_use)]
|
|
|
|
struct MustUseDeprecated {}
|
|
|
|
|
2020-07-25 13:49:46 -04:00
|
|
|
impl MustUseDeprecated { //~ warning: use of deprecated
|
|
|
|
fn new() -> MustUseDeprecated { //~ warning: use of deprecated
|
|
|
|
MustUseDeprecated {} //~ warning: use of deprecated
|
2018-09-10 15:06:49 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2020-07-25 13:49:46 -04: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 15:06:49 -07:00
|
|
|
}
|