Skip to content

Commit f249fdd

Browse files
committedOct 26, 2024
Add AST unpretty test for unsafe attribute
1 parent 80d0d92 commit f249fdd

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed
 

‎tests/ui/unpretty/unsafe-attr.rs

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
//@ compile-flags: -Zunpretty=normal
2+
//@ check-pass
3+
4+
#[no_mangle]
5+
extern "C" fn foo() {}
6+
7+
#[unsafe(no_mangle)]
8+
extern "C" fn bar() {}
9+
10+
#[cfg_attr(FALSE, unsafe(no_mangle))]
11+
extern "C" fn zoo() {}

‎tests/ui/unpretty/unsafe-attr.stdout

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
//@ compile-flags: -Zunpretty=normal
2+
//@ check-pass
3+
4+
#[no_mangle]
5+
extern "C" fn foo() {}
6+
7+
#[no_mangle]
8+
extern "C" fn bar() {}
9+
10+
#[cfg_attr(FALSE, unsafe(no_mangle))]
11+
extern "C" fn zoo() {}

0 commit comments

Comments
 (0)