File: deprecated.rs

package info (click to toggle)
rust-cbindgen 0.27.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,616 kB
  • sloc: ansic: 15; makefile: 11
file content (74 lines) | stat: -rw-r--r-- 1,568 bytes parent folder | download | duplicates (3)
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#[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(i32)]
pub enum EnumWithDeprecatedVariants {
    C = 0,
    #[deprecated]
    D = 1,
    #[deprecated(note = "This is a note")]
    E = 2,
    #[deprecated(note = "This is a note", since = "1.0.0")]
    F = 3,
}

#[repr(u8)]
enum EnumWithDeprecatedStructVariants {
    Foo(i16),
    #[deprecated]
    Bar { x: u8, y: i16 },
    #[deprecated(note = "This is a note")]
    Baz { x: u8, y: u8 },
}

#[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: EnumWithDeprecatedVariants,
    d: DeprecatedStruct,
    e: DeprecatedStructWithNote,
    f: EnumWithDeprecatedStructVariants,
) -> void {
}