Skip to content

Commit 6aa1d93

Browse files
committed
Auto merge of #72904 - shepmaster:reduce-abi-symbol-hash-churn, r=jonas-schievink,RalfJung
Order the Rust and C ABIs first to reduce test churn
2 parents 0262de5 + ae3586c commit 6aa1d93

File tree

7 files changed

+24
-16
lines changed

7 files changed

+24
-16
lines changed

src/librustc_target/spec/abi.rs

+12-4
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,15 @@ pub enum Abi {
1111
// N.B., this ordering MUST match the AbiDatas array below.
1212
// (This is ensured by the test indices_are_correct().)
1313

14+
// Multiplatform / generic ABIs
15+
//
16+
// These ABIs come first because every time we add a new ABI, we
17+
// have to re-bless all the hashing tests. These are used in many
18+
// places, so giving them stable values reduces test churn. The
19+
// specific values are meaningless.
20+
Rust = 0,
21+
C = 1,
22+
1423
// Single platform ABIs
1524
Cdecl,
1625
Stdcall,
@@ -27,8 +36,6 @@ pub enum Abi {
2736
EfiApi,
2837

2938
// Multiplatform / generic ABIs
30-
Rust,
31-
C,
3239
System,
3340
RustIntrinsic,
3441
RustCall,
@@ -49,6 +56,9 @@ pub struct AbiData {
4956

5057
#[allow(non_upper_case_globals)]
5158
const AbiDatas: &[AbiData] = &[
59+
// Cross-platform ABIs
60+
AbiData { abi: Abi::Rust, name: "Rust", generic: true },
61+
AbiData { abi: Abi::C, name: "C", generic: true },
5262
// Platform-specific ABIs
5363
AbiData { abi: Abi::Cdecl, name: "cdecl", generic: false },
5464
AbiData { abi: Abi::Stdcall, name: "stdcall", generic: false },
@@ -64,8 +74,6 @@ const AbiDatas: &[AbiData] = &[
6474
AbiData { abi: Abi::AmdGpuKernel, name: "amdgpu-kernel", generic: false },
6575
AbiData { abi: Abi::EfiApi, name: "efiapi", generic: false },
6676
// Cross-platform ABIs
67-
AbiData { abi: Abi::Rust, name: "Rust", generic: true },
68-
AbiData { abi: Abi::C, name: "C", generic: true },
6977
AbiData { abi: Abi::System, name: "system", generic: true },
7078
AbiData { abi: Abi::RustIntrinsic, name: "rust-intrinsic", generic: true },
7179
AbiData { abi: Abi::RustCall, name: "rust-call", generic: true },

src/test/ui/codemap_tests/unicode.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0703]: invalid ABI: found `路濫狼á́́`
44
LL | extern "路濫狼á́́" fn foo() {}
55
| ^^^^^^^^^ invalid ABI
66
|
7-
= help: valid ABIs: cdecl, stdcall, fastcall, vectorcall, thiscall, aapcs, win64, sysv64, ptx-kernel, msp430-interrupt, x86-interrupt, amdgpu-kernel, efiapi, Rust, C, system, rust-intrinsic, rust-call, platform-intrinsic, unadjusted
7+
= help: valid ABIs: Rust, C, cdecl, stdcall, fastcall, vectorcall, thiscall, aapcs, win64, sysv64, ptx-kernel, msp430-interrupt, x86-interrupt, amdgpu-kernel, efiapi, system, rust-intrinsic, rust-call, platform-intrinsic, unadjusted
88

99
error: aborting due to previous error
1010

src/test/ui/parser/issue-8537.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0703]: invalid ABI: found `invalid-ab_isize`
44
LL | "invalid-ab_isize"
55
| ^^^^^^^^^^^^^^^^^^ invalid ABI
66
|
7-
= help: valid ABIs: cdecl, stdcall, fastcall, vectorcall, thiscall, aapcs, win64, sysv64, ptx-kernel, msp430-interrupt, x86-interrupt, amdgpu-kernel, efiapi, Rust, C, system, rust-intrinsic, rust-call, platform-intrinsic, unadjusted
7+
= help: valid ABIs: Rust, C, cdecl, stdcall, fastcall, vectorcall, thiscall, aapcs, win64, sysv64, ptx-kernel, msp430-interrupt, x86-interrupt, amdgpu-kernel, efiapi, system, rust-intrinsic, rust-call, platform-intrinsic, unadjusted
88

99
error: aborting due to previous error
1010

src/test/ui/symbol-names/basic.legacy.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
error: symbol-name(_ZN5basic4main17h81759b0695851718E)
1+
error: symbol-name(_ZN5basic4main17h4272b3de5e868f5aE)
22
--> $DIR/basic.rs:8:1
33
|
44
LL | #[rustc_symbol_name]
55
| ^^^^^^^^^^^^^^^^^^^^
66

7-
error: demangling(basic::main::h81759b0695851718)
7+
error: demangling(basic::main::h4272b3de5e868f5a)
88
--> $DIR/basic.rs:8:1
99
|
1010
LL | #[rustc_symbol_name]

src/test/ui/symbol-names/impl1.legacy.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
error: symbol-name(_ZN5impl13foo3Foo3bar17h92cf46db76791039E)
1+
error: symbol-name(_ZN5impl13foo3Foo3bar17ha318160f105e638cE)
22
--> $DIR/impl1.rs:16:9
33
|
44
LL | #[rustc_symbol_name]
55
| ^^^^^^^^^^^^^^^^^^^^
66

7-
error: demangling(impl1::foo::Foo::bar::h92cf46db76791039)
7+
error: demangling(impl1::foo::Foo::bar::ha318160f105e638c)
88
--> $DIR/impl1.rs:16:9
99
|
1010
LL | #[rustc_symbol_name]
@@ -22,13 +22,13 @@ error: def-path(foo::Foo::bar)
2222
LL | #[rustc_def_path]
2323
| ^^^^^^^^^^^^^^^^^
2424

25-
error: symbol-name(_ZN5impl13bar33_$LT$impl$u20$impl1..foo..Foo$GT$3baz17h90c4a800b1aa0df0E)
25+
error: symbol-name(_ZN5impl13bar33_$LT$impl$u20$impl1..foo..Foo$GT$3baz17h6c2dbab6e66f9fa3E)
2626
--> $DIR/impl1.rs:34:9
2727
|
2828
LL | #[rustc_symbol_name]
2929
| ^^^^^^^^^^^^^^^^^^^^
3030

31-
error: demangling(impl1::bar::<impl impl1::foo::Foo>::baz::h90c4a800b1aa0df0)
31+
error: demangling(impl1::bar::<impl impl1::foo::Foo>::baz::h6c2dbab6e66f9fa3)
3232
--> $DIR/impl1.rs:34:9
3333
|
3434
LL | #[rustc_symbol_name]

src/test/ui/symbol-names/impl1.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
// revisions: legacy v0
44
//[legacy]compile-flags: -Z symbol-mangling-version=legacy
55
//[v0]compile-flags: -Z symbol-mangling-version=v0
6-
//[legacy]normalize-stderr-32bit: "h5ef5dfc14aeecbfc" -> "SYMBOL_HASH"
7-
//[legacy]normalize-stderr-64bit: "h9e54d216f70fcbc5" -> "SYMBOL_HASH"
6+
//[legacy]normalize-stderr-32bit: "hee444285569b39c2" -> "SYMBOL_HASH"
7+
//[legacy]normalize-stderr-64bit: "h310ea0259fc3d32d" -> "SYMBOL_HASH"
88

99
#![feature(optin_builtin_traits, rustc_attrs)]
1010
#![allow(dead_code)]

src/test/ui/symbol-names/issue-60925.legacy.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
error: symbol-name(_ZN11issue_609253foo37Foo$LT$issue_60925..llv$u6d$..Foo$GT$3foo17hc86312d25b60f6eeE)
1+
error: symbol-name(_ZN11issue_609253foo37Foo$LT$issue_60925..llv$u6d$..Foo$GT$3foo17h79d9aaa05f4b26d6E)
22
--> $DIR/issue-60925.rs:22:9
33
|
44
LL | #[rustc_symbol_name]
55
| ^^^^^^^^^^^^^^^^^^^^
66

7-
error: demangling(issue_60925::foo::Foo<issue_60925::llvm::Foo>::foo::hc86312d25b60f6ee)
7+
error: demangling(issue_60925::foo::Foo<issue_60925::llvm::Foo>::foo::h79d9aaa05f4b26d6)
88
--> $DIR/issue-60925.rs:22:9
99
|
1010
LL | #[rustc_symbol_name]

0 commit comments

Comments
 (0)