Add AST unpretty test for unsafe attribute
This commit is contained in:
parent
80d0d927d5
commit
f249fdd962
2 changed files with 22 additions and 0 deletions
11
tests/ui/unpretty/unsafe-attr.rs
Normal file
11
tests/ui/unpretty/unsafe-attr.rs
Normal file
|
@ -0,0 +1,11 @@
|
|||
//@ compile-flags: -Zunpretty=normal
|
||||
//@ check-pass
|
||||
|
||||
#[no_mangle]
|
||||
extern "C" fn foo() {}
|
||||
|
||||
#[unsafe(no_mangle)]
|
||||
extern "C" fn bar() {}
|
||||
|
||||
#[cfg_attr(FALSE, unsafe(no_mangle))]
|
||||
extern "C" fn zoo() {}
|
11
tests/ui/unpretty/unsafe-attr.stdout
Normal file
11
tests/ui/unpretty/unsafe-attr.stdout
Normal file
|
@ -0,0 +1,11 @@
|
|||
//@ compile-flags: -Zunpretty=normal
|
||||
//@ check-pass
|
||||
|
||||
#[no_mangle]
|
||||
extern "C" fn foo() {}
|
||||
|
||||
#[no_mangle]
|
||||
extern "C" fn bar() {}
|
||||
|
||||
#[cfg_attr(FALSE, unsafe(no_mangle))]
|
||||
extern "C" fn zoo() {}
|
Loading…
Add table
Reference in a new issue