2025-07-12 17:34:43 +02:00
|
|
|
#[attr = MacroUse {arguments: UseAll}]
|
2025-03-04 22:03:28 +00:00
|
|
|
extern crate std;
|
2025-07-28 17:24:28 +03:00
|
|
|
#[prelude_import]
|
|
|
|
|
use ::std::prelude::rust_2015::*;
|
2025-03-04 22:03:28 +00:00
|
|
|
//@ compile-flags: -Zunpretty=hir
|
|
|
|
|
//@ check-pass
|
2025-04-16 10:45:03 +02:00
|
|
|
//@ edition: 2015
|
2025-03-04 22:03:28 +00:00
|
|
|
|
2025-03-05 15:20:16 +00:00
|
|
|
#[attr = Deprecation {deprecation: Deprecation {since: Unspecified}}]
|
2025-03-04 22:03:28 +00:00
|
|
|
struct PlainDeprecated;
|
|
|
|
|
|
2025-07-05 22:21:28 +02:00
|
|
|
#[attr = Deprecation {deprecation: Deprecation {since: Unspecified,
|
|
|
|
|
note: "here's why this is deprecated"}}]
|
2025-03-04 22:03:28 +00:00
|
|
|
struct DirectNote;
|
|
|
|
|
|
2025-07-05 22:21:28 +02:00
|
|
|
#[attr = Deprecation {deprecation: Deprecation {since: Unspecified,
|
|
|
|
|
note: "here's why this is deprecated"}}]
|
2025-03-04 22:03:28 +00:00
|
|
|
struct ExplicitNote;
|
|
|
|
|
|
2025-03-05 15:20:16 +00:00
|
|
|
#[attr = Deprecation {deprecation: Deprecation {since: NonStandard("1.2.3"),
|
|
|
|
|
note: "here's why this is deprecated"}}]
|
2025-03-04 22:03:28 +00:00
|
|
|
struct SinceAndNote;
|
|
|
|
|
|
2025-03-05 15:20:16 +00:00
|
|
|
#[attr = Deprecation {deprecation: Deprecation {since: NonStandard("1.2.3"),
|
|
|
|
|
note: "here's why this is deprecated"}}]
|
2025-03-04 22:03:28 +00:00
|
|
|
struct FlippedOrder;
|
2025-06-19 16:20:15 -07:00
|
|
|
|
|
|
|
|
fn f() {
|
|
|
|
|
|
|
|
|
|
// Attribute is ignored here (with a warning), but still preserved in HIR
|
2025-07-05 22:21:28 +02:00
|
|
|
#[attr = Deprecation {deprecation: Deprecation {since: Unspecified}}]
|
2025-06-19 16:20:15 -07:00
|
|
|
0
|
|
|
|
|
}
|