Skip to content

Commit

Permalink
Rollup merge of rust-lang#72904 - shepmaster:reduce-abi-symbol-hash-c…
Browse files Browse the repository at this point in the history
…hurn, r=jonas-schievink

Order the Rust and C ABIs first to reduce test churn
  • Loading branch information
Dylan-DPC authored Jun 3, 2020
2 parents f14c1d4 + d7c248b commit 533fb81
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 16 deletions.
16 changes: 12 additions & 4 deletions src/librustc_target/spec/abi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@ pub enum Abi {
// N.B., this ordering MUST match the AbiDatas array below.
// (This is ensured by the test indices_are_correct().)

// Multiplatform / generic ABIs
//
// These ABIs come first because every time we add a new ABI, we
// have to re-bless all the hashing tests. These are used in many
// places, so giving them stable values reduces test churn. The
// specific values are meaningless.
Rust = 0,
C = 1,

// Single platform ABIs
Cdecl,
Stdcall,
Expand All @@ -27,8 +36,6 @@ pub enum Abi {
EfiApi,

// Multiplatform / generic ABIs
Rust,
C,
System,
RustIntrinsic,
RustCall,
Expand All @@ -49,6 +56,9 @@ pub struct AbiData {

#[allow(non_upper_case_globals)]
const AbiDatas: &[AbiData] = &[
// Cross-platform ABIs
AbiData { abi: Abi::Rust, name: "Rust", generic: true },
AbiData { abi: Abi::C, name: "C", generic: true },
// Platform-specific ABIs
AbiData { abi: Abi::Cdecl, name: "cdecl", generic: false },
AbiData { abi: Abi::Stdcall, name: "stdcall", generic: false },
Expand All @@ -64,8 +74,6 @@ const AbiDatas: &[AbiData] = &[
AbiData { abi: Abi::AmdGpuKernel, name: "amdgpu-kernel", generic: false },
AbiData { abi: Abi::EfiApi, name: "efiapi", generic: false },
// Cross-platform ABIs
AbiData { abi: Abi::Rust, name: "Rust", generic: true },
AbiData { abi: Abi::C, name: "C", generic: true },
AbiData { abi: Abi::System, name: "system", generic: true },
AbiData { abi: Abi::RustIntrinsic, name: "rust-intrinsic", generic: true },
AbiData { abi: Abi::RustCall, name: "rust-call", generic: true },
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/codemap_tests/unicode.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ error[E0703]: invalid ABI: found `路濫狼á́́`
LL | extern "路濫狼á́́" fn foo() {}
| ^^^^^^^^^ invalid ABI
|
= 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
= 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

error: aborting due to previous error

Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/parser/issue-8537.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ error[E0703]: invalid ABI: found `invalid-ab_isize`
LL | "invalid-ab_isize"
| ^^^^^^^^^^^^^^^^^^ invalid ABI
|
= 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
= 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

error: aborting due to previous error

Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/symbol-names/basic.legacy.stderr
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
error: symbol-name(_ZN5basic4main17h81759b0695851718E)
error: symbol-name(_ZN5basic4main17h4272b3de5e868f5aE)
--> $DIR/basic.rs:8:1
|
LL | #[rustc_symbol_name]
| ^^^^^^^^^^^^^^^^^^^^

error: demangling(basic::main::h81759b0695851718)
error: demangling(basic::main::h4272b3de5e868f5a)
--> $DIR/basic.rs:8:1
|
LL | #[rustc_symbol_name]
Expand Down
12 changes: 6 additions & 6 deletions src/test/ui/symbol-names/impl1.legacy.stderr
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
error: symbol-name(_ZN5impl13foo3Foo3bar17h92cf46db76791039E)
error: symbol-name(_ZN5impl13foo3Foo3bar17ha318160f105e638cE)
--> $DIR/impl1.rs:16:9
|
LL | #[rustc_symbol_name]
| ^^^^^^^^^^^^^^^^^^^^

error: demangling(impl1::foo::Foo::bar::h92cf46db76791039)
error: demangling(impl1::foo::Foo::bar::ha318160f105e638c)
--> $DIR/impl1.rs:16:9
|
LL | #[rustc_symbol_name]
Expand All @@ -22,13 +22,13 @@ error: def-path(foo::Foo::bar)
LL | #[rustc_def_path]
| ^^^^^^^^^^^^^^^^^

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

error: demangling(impl1::bar::<impl impl1::foo::Foo>::baz::h90c4a800b1aa0df0)
error: demangling(impl1::bar::<impl impl1::foo::Foo>::baz::h6c2dbab6e66f9fa3)
--> $DIR/impl1.rs:34:9
|
LL | #[rustc_symbol_name]
Expand All @@ -46,13 +46,13 @@ error: def-path(bar::<impl foo::Foo>::baz)
LL | #[rustc_def_path]
| ^^^^^^^^^^^^^^^^^

error: symbol-name(_ZN209_$LT$$u5b$$RF$dyn$u20$impl1..Foo$u2b$Assoc$u20$$u3d$$u20$extern$u20$$u22$C$u22$$u20$fn$LP$$RF$u8$C$$u20$...$RP$$u2b$impl1..AutoTrait$u3b$$u20$3$u5d$$u20$as$u20$impl1..main..$u7b$$u7b$closure$u7d$$u7d$..Bar$GT$6method17SYMBOL_HASHE)
error: symbol-name(_ZN209_$LT$$u5b$$RF$dyn$u20$impl1..Foo$u2b$Assoc$u20$$u3d$$u20$extern$u20$$u22$C$u22$$u20$fn$LP$$RF$u8$C$$u20$...$RP$$u2b$impl1..AutoTrait$u3b$$u20$3$u5d$$u20$as$u20$impl1..main..$u7b$$u7b$closure$u7d$$u7d$..Bar$GT$6method17h310ea0259fc3d32dE)
--> $DIR/impl1.rs:64:13
|
LL | #[rustc_symbol_name]
| ^^^^^^^^^^^^^^^^^^^^

error: demangling(<[&dyn impl1::Foo+Assoc = extern "C" fn(&u8, ::.)+impl1::AutoTrait; 3] as impl1::main::{{closure}}::Bar>::method::SYMBOL_HASH)
error: demangling(<[&dyn impl1::Foo+Assoc = extern "C" fn(&u8, ::.)+impl1::AutoTrait; 3] as impl1::main::{{closure}}::Bar>::method::h310ea0259fc3d32d)
--> $DIR/impl1.rs:64:13
|
LL | #[rustc_symbol_name]
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/symbol-names/issue-60925.legacy.stderr
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
error: symbol-name(_ZN11issue_609253foo37Foo$LT$issue_60925..llv$u6d$..Foo$GT$3foo17hc86312d25b60f6eeE)
error: symbol-name(_ZN11issue_609253foo37Foo$LT$issue_60925..llv$u6d$..Foo$GT$3foo17h79d9aaa05f4b26d6E)
--> $DIR/issue-60925.rs:22:9
|
LL | #[rustc_symbol_name]
| ^^^^^^^^^^^^^^^^^^^^

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

0 comments on commit 533fb81

Please sign in to comment.