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
|
|
|
|
|
|
|
|
#[deprecated]
|
|
|
|
|
pub struct PlainDeprecated;
|
|
|
|
|
|
|
|
|
|
#[deprecated = "here's why this is deprecated"]
|
|
|
|
|
pub struct DirectNote;
|
|
|
|
|
|
|
|
|
|
#[deprecated(note = "here's why this is deprecated")]
|
|
|
|
|
pub struct ExplicitNote;
|
|
|
|
|
|
|
|
|
|
#[deprecated(since = "1.2.3", note = "here's why this is deprecated")]
|
|
|
|
|
pub struct SinceAndNote;
|
|
|
|
|
|
|
|
|
|
#[deprecated(note = "here's why this is deprecated", since = "1.2.3")]
|
|
|
|
|
pub struct FlippedOrder;
|
2025-06-19 16:20:15 -07:00
|
|
|
|
|
|
|
|
pub fn f() {
|
|
|
|
|
// Attribute is ignored here (with a warning), but still preserved in HIR
|
|
|
|
|
#[deprecated] 0
|
|
|
|
|
}
|