Skip to content

Commit 518eb0d

Browse files
rustdoc-json: Rearrange deck chairs in ABI testing
We move the vectorcall ABI tests into their own file which is now only run on x86-64, while replacing them with rust-cold ABI tests so that aarch64 hosts continue to test an unstable ABI. A better solution might be cross-compiling or something but I really don't have time for that right now.
1 parent 643a9d2 commit 518eb0d

File tree

4 files changed

+38
-24
lines changed

4 files changed

+38
-24
lines changed

tests/rustdoc-json/fn_pointer/abi.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(abi_vectorcall)]
1+
#![feature(rust_cold_cc)]
22

33
//@ is "$.index[?(@.name=='AbiRust')].inner.type_alias.type.function_pointer.header.abi" \"Rust\"
44
pub type AbiRust = fn();
@@ -15,8 +15,5 @@ pub type AbiCUnwind = extern "C-unwind" fn();
1515
//@ is "$.index[?(@.name=='AbiSystemUnwind')].inner.type_alias.type.function_pointer.header.abi" '{"System": {"unwind": true}}'
1616
pub type AbiSystemUnwind = extern "system-unwind" fn();
1717

18-
//@ is "$.index[?(@.name=='AbiVecorcall')].inner.type_alias.type.function_pointer.header.abi.Other" '"\"vectorcall\""'
19-
pub type AbiVecorcall = extern "vectorcall" fn();
20-
21-
//@ is "$.index[?(@.name=='AbiVecorcallUnwind')].inner.type_alias.type.function_pointer.header.abi.Other" '"\"vectorcall-unwind\""'
22-
pub type AbiVecorcallUnwind = extern "vectorcall-unwind" fn();
18+
//@ is "$.index[?(@.name=='AbiRustCold')].inner.type_alias.type.function_pointer.header.abi.Other" '"\"rust-cold\""'
19+
pub type AbiRustCold = extern "rust-cold" fn();

tests/rustdoc-json/fns/abi.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(abi_vectorcall)]
1+
#![feature(rust_cold_cc)]
22

33
//@ is "$.index[?(@.name=='abi_rust')].inner.function.header.abi" \"Rust\"
44
pub fn abi_rust() {}
@@ -15,8 +15,5 @@ pub extern "C-unwind" fn abi_c_unwind() {}
1515
//@ is "$.index[?(@.name=='abi_system_unwind')].inner.function.header.abi" '{"System": {"unwind": true}}'
1616
pub extern "system-unwind" fn abi_system_unwind() {}
1717

18-
//@ is "$.index[?(@.name=='abi_vectorcall')].inner.function.header.abi.Other" '"\"vectorcall\""'
19-
pub extern "vectorcall" fn abi_vectorcall() {}
20-
21-
//@ is "$.index[?(@.name=='abi_vectorcall_unwind')].inner.function.header.abi.Other" '"\"vectorcall-unwind\""'
22-
pub extern "vectorcall-unwind" fn abi_vectorcall_unwind() {}
18+
//@ is "$.index[?(@.name=='abi_rust_cold')].inner.function.header.abi.Other" '"\"rust-cold\""'
19+
pub extern "rust-cold" fn abi_rust_cold() {}

tests/rustdoc-json/methods/abi.rs

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#![feature(abi_vectorcall)]
2-
1+
#![feature(rust_cold_cc)]
32
//@ has "$.index[?(@.name=='Foo')]"
43
pub struct Foo;
54

@@ -19,11 +18,8 @@ impl Foo {
1918
//@ is "$.index[?(@.name=='abi_system_unwind')].inner.function.header.abi" '{"System": {"unwind": true}}'
2019
pub extern "system-unwind" fn abi_system_unwind() {}
2120

22-
//@ is "$.index[?(@.name=='abi_vectorcall')].inner.function.header.abi.Other" '"\"vectorcall\""'
23-
pub extern "vectorcall" fn abi_vectorcall() {}
24-
25-
//@ is "$.index[?(@.name=='abi_vectorcall_unwind')].inner.function.header.abi.Other" '"\"vectorcall-unwind\""'
26-
pub extern "vectorcall-unwind" fn abi_vectorcall_unwind() {}
21+
//@ is "$.index[?(@.name=='abi_rust_cold')].inner.function.header.abi.Other" '"\"rust-cold\""'
22+
pub extern "rust-cold" fn abi_rust_cold() {}
2723
}
2824

2925
pub trait Bar {
@@ -42,9 +38,6 @@ pub trait Bar {
4238
//@ is "$.index[?(@.name=='trait_abi_system_unwind')].inner.function.header.abi" '{"System": {"unwind": true}}'
4339
extern "system-unwind" fn trait_abi_system_unwind() {}
4440

45-
//@ is "$.index[?(@.name=='trait_abi_vectorcall')].inner.function.header.abi.Other" '"\"vectorcall\""'
46-
extern "vectorcall" fn trait_abi_vectorcall() {}
47-
48-
//@ is "$.index[?(@.name=='trait_abi_vectorcall_unwind')].inner.function.header.abi.Other" '"\"vectorcall-unwind\""'
49-
extern "vectorcall-unwind" fn trait_abi_vectorcall_unwind() {}
41+
//@ is "$.index[?(@.name=='trait_abi_rust_cold')].inner.function.header.abi.Other" '"\"rust-cold\""'
42+
extern "rust-cold" fn trait_abi_rust_cold() {}
5043
}

tests/rustdoc-json/vectorcall.rs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#![feature(abi_vectorcall)]
2+
//@ only-x86_64
3+
4+
//@ is "$.index[?(@.name=='AbiVectorcall')].inner.type_alias.type.function_pointer.header.abi.Other" '"\"vectorcall\""'
5+
pub type AbiVectorcall = extern "vectorcall" fn();
6+
7+
//@ is "$.index[?(@.name=='AbiVectorcallUnwind')].inner.type_alias.type.function_pointer.header.abi.Other" '"\"vectorcall-unwind\""'
8+
pub type AbiVectorcallUnwind = extern "vectorcall-unwind" fn();
9+
10+
//@ has "$.index[?(@.name=='Foo')]"
11+
pub struct Foo;
12+
13+
impl Foo {
14+
//@ is "$.index[?(@.name=='abi_vectorcall')].inner.function.header.abi.Other" '"\"vectorcall\""'
15+
pub extern "vectorcall" fn abi_vectorcall() {}
16+
17+
//@ is "$.index[?(@.name=='abi_vectorcall_unwind')].inner.function.header.abi.Other" '"\"vectorcall-unwind\""'
18+
pub extern "vectorcall-unwind" fn abi_vectorcall_unwind() {}
19+
}
20+
21+
pub trait Bar {
22+
//@ is "$.index[?(@.name=='trait_abi_vectorcall')].inner.function.header.abi.Other" '"\"vectorcall\""'
23+
extern "vectorcall" fn trait_abi_vectorcall() {}
24+
25+
//@ is "$.index[?(@.name=='trait_abi_vectorcall_unwind')].inner.function.header.abi.Other" '"\"vectorcall-unwind\""'
26+
extern "vectorcall-unwind" fn trait_abi_vectorcall_unwind() {}
27+
}

0 commit comments

Comments
 (0)