Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit630c3ad

Browse files
Add regression test forunsafe_extern_blocks
1 parentbb9a3ef commit630c3ad

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// Test to ensure the feature is working as expected.
2+
3+
#![feature(unsafe_extern_blocks)]
4+
#![crate_name ="foo"]
5+
6+
// @has 'foo/index.html'
7+
8+
// First we check that both the static and the function have a "sup" element
9+
// to tell they're unsafe.
10+
11+
// @count - '//ul[@class="item-table"]//sup[@title="unsafe static"]' 1
12+
// @has - '//ul[@class="item-table"]//sup[@title="unsafe static"]' '⚠'
13+
// @count - '//ul[@class="item-table"]//sup[@title="unsafe function"]' 1
14+
// @has - '//ul[@class="item-table"]//sup[@title="unsafe function"]' '⚠'
15+
16+
unsafeextern{
17+
// @has 'foo/static.FOO.html'
18+
// @has - '//pre[@class="rust item-decl"]' 'pub static FOO: i32'
19+
pub safestaticFOO:i32;
20+
// @has 'foo/static.BAR.html'
21+
// @has - '//pre[@class="rust item-decl"]' 'pub unsafe static BAR: i32'
22+
pubstaticBAR:i32;
23+
24+
// @has 'foo/fn.foo.html'
25+
// @has - '//pre[@class="rust item-decl"]' 'pub extern "C" fn foo()'
26+
pub safefnfoo();
27+
// @has 'foo/fn.bar.html'
28+
// @has - '//pre[@class="rust item-decl"]' 'pub unsafe extern "C" fn bar()'
29+
pubfnbar();
30+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp