summary refs log tree commit diff
path: root/tests/ui/unpretty/deprecated-attr.rs
blob: e2ab5efb5d873dd63b0c7efd73cc21e7e44ceb5d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
//@ compile-flags: -Zunpretty=hir
//@ check-pass
//@ edition: 2015

#[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;

pub fn f() {
    // Attribute is ignored here (with a warning), but still preserved in HIR
    #[deprecated] 0
}