about summary refs log tree commit diff
path: root/src/test/rustdoc/attributes.rs
blob: 54c5939f908d422eabe291add61f9ed2251d6774 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#![crate_name = "foo"]

// @has foo/fn.f.html '//*[@class="docblock attributes"]' '#[no_mangle]'
#[no_mangle]
pub extern "C" fn f() {}

// @has foo/fn.g.html '//*[@class="docblock attributes"]' '#[export_name = "bar"]'
#[export_name = "bar"]
pub extern "C" fn g() {}

// @matches foo/enum.Foo.html '//*[@class="docblock attributes top-attr"]' \
//      '(?m)\A#\[repr\(i64\)\]\n#\[must_use\]\Z'
#[repr(i64)]
#[must_use]
pub enum Foo {
    Bar,
}

// @has foo/struct.Repr.html '//*[@class="docblock attributes top-attr"]' '#[repr(C, align(8))]'
#[repr(C, align(8))]
pub struct Repr;