summaryrefslogtreecommitdiffstats
path: root/tests/rust/deprecated.rs
blob: 3abf65a92b8176cf574c601b0bbb4a5c3c72678b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#[no_mangle]
#[deprecated]
pub extern "C" fn deprecated_without_note() {}

#[no_mangle]
#[deprecated = "This is a note"]
pub extern "C" fn deprecated_without_bracket() {}

#[no_mangle]
#[deprecated(note = "This is a note")]
pub extern "C" fn deprecated_with_note() {}

#[no_mangle]
#[deprecated(note = "This is a note", since = "1.0.0")]
pub extern "C" fn deprecated_with_note_and_since() {}

#[no_mangle]
#[deprecated(note = "This quote \" requires to be quoted, and this [\n] requires to be escaped")]
pub extern "C" fn deprecated_with_note_which_requires_to_be_escaped() {}

#[repr(i32)]
#[deprecated]
pub enum DeprecatedEnum {
    A = 0,
}

#[repr(i32)]
#[deprecated(note = "This is a note")]
pub enum DeprecatedEnumWithNote {
    B = 0,
}

#[repr(C)]
#[deprecated]
pub struct DeprecatedStruct {
    pub a: i32,
}

#[repr(C)]
#[deprecated(note = "This is a note")]
pub struct DeprecatedStructWithNote {
    pub a: i32,
}

#[no_mangle]
pub extern "C" fn dummy(
    a: DeprecatedEnum,
    b: DeprecatedEnumWithNote,
    c: DeprecatedStruct,
    d: DeprecatedStructWithNote,
) -> void {
}