2025-07-23 00:00:01 +00:00
|
|
|
//@ edition: 2024
|
2017-02-08 21:15:20 +00:00
|
|
|
#![crate_name = "foo"]
|
|
|
|
|
|
2025-07-23 00:00:01 +00:00
|
|
|
//@ has foo/fn.f.html '//pre[@class="rust item-decl"]' '#[unsafe(no_mangle)]'
|
|
|
|
|
#[unsafe(no_mangle)]
|
2017-02-08 21:15:20 +00:00
|
|
|
pub extern "C" fn f() {}
|
|
|
|
|
|
2025-07-23 00:00:01 +00:00
|
|
|
//@ has foo/fn.g.html '//pre[@class="rust item-decl"]' '#[unsafe(export_name = "bar")]'
|
|
|
|
|
#[unsafe(export_name = "bar")]
|
2017-02-08 21:15:20 +00:00
|
|
|
pub extern "C" fn g() {}
|
|
|
|
|
|
2025-07-23 00:00:01 +00:00
|
|
|
//@ has foo/fn.example.html '//pre[@class="rust item-decl"]' '#[unsafe(link_section = ".text")]'
|
|
|
|
|
#[unsafe(link_section = ".text")]
|
|
|
|
|
pub extern "C" fn example() {}
|
|
|
|
|
|
2024-06-21 14:03:08 +02:00
|
|
|
//@ has foo/struct.Repr.html '//pre[@class="rust item-decl"]' '#[repr(C, align(8))]'
|
2020-03-03 23:41:32 +00:00
|
|
|
#[repr(C, align(8))]
|
|
|
|
|
pub struct Repr;
|