Auto merge of #131517 - aDotInTheVoid:rdj-safe-extern-test, r=GuillaumeGomez
rustdoc-json: Add tests for unsafe/safe extern blocks (RFC 3484) Closes https://github.com/rust-lang/rust/issues/126786, turns out this all Just Works (TM) Tracking issue: #123743 r? `@GuillaumeGomez`
This commit is contained in:
commit
0321e73d1c
1 changed files with 17 additions and 0 deletions
17
tests/rustdoc-json/fns/extern_safe.rs
Normal file
17
tests/rustdoc-json/fns/extern_safe.rs
Normal file
|
@ -0,0 +1,17 @@
|
|||
extern "C" {
|
||||
//@ is "$.index[*][?(@.name=='f1')].inner.function.header.is_unsafe" true
|
||||
pub fn f1();
|
||||
|
||||
// items in unadorned `extern` blocks cannot have safety qualifiers
|
||||
}
|
||||
|
||||
unsafe extern "C" {
|
||||
//@ is "$.index[*][?(@.name=='f4')].inner.function.header.is_unsafe" true
|
||||
pub fn f4();
|
||||
|
||||
//@ is "$.index[*][?(@.name=='f5')].inner.function.header.is_unsafe" true
|
||||
pub unsafe fn f5();
|
||||
|
||||
//@ is "$.index[*][?(@.name=='f6')].inner.function.header.is_unsafe" false
|
||||
pub safe fn f6();
|
||||
}
|
Loading…
Add table
Reference in a new issue