Skip to content

Commit b9a3952

Browse files
authored
Rollup merge of rust-lang#122157 - dpaoliello:targetdesc, r=Nilstrieb
Add the new description field to Target::to_json, and add descriptions for some MSVC targets The original PR to add a `description` field to `Target` (<rust-lang#121905>) didn't add the field to `Target::to_json`, which meant that the `check_consistency` testwould fail if you tried to set a description as it wouldn't survive round-tripping via JSON: https://github.com/rust-lang/rust/actions/runs/8180997936/job/22370052535#step:27:4967 This change adds the field to `Target::to_json`, and sets some descriptions to verify that it works correctly.
2 parents e76bd62 + d6b597b commit b9a3952

7 files changed

+7
-6
lines changed

compiler/rustc_target/src/spec/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -3253,6 +3253,7 @@ impl ToJson for Target {
32533253
}
32543254

32553255
target_val!(llvm_target);
3256+
target_val!(description);
32563257
d.insert("target-pointer-width".to_string(), self.pointer_width.to_string().to_json());
32573258
target_val!(arch);
32583259
target_val!(data_layout);

compiler/rustc_target/src/spec/targets/aarch64_pc_windows_msvc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ pub fn target() -> Target {
77

88
Target {
99
llvm_target: "aarch64-pc-windows-msvc".into(),
10-
description: None,
10+
description: Some("ARM64 Windows MSVC".into()),
1111
pointer_width: 64,
1212
data_layout: "e-m:w-p:64:64-i32:32-i64:64-i128:128-n32:64-S128".into(),
1313
arch: "aarch64".into(),

compiler/rustc_target/src/spec/targets/i686_pc_windows_msvc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ pub fn target() -> Target {
2323

2424
Target {
2525
llvm_target: "i686-pc-windows-msvc".into(),
26-
description: None,
26+
description: Some("32-bit MSVC (Windows 7+)".into()),
2727
pointer_width: 32,
2828
data_layout: "e-m:x-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
2929
i64:64-i128:128-f80:128-n8:16:32-a:0:32-S32"

compiler/rustc_target/src/spec/targets/i686_win7_windows_msvc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ pub fn target() -> Target {
2323

2424
Target {
2525
llvm_target: "i686-pc-windows-msvc".into(),
26-
description: None,
26+
description: Some("32-bit Windows 7 support".into()),
2727
pointer_width: 32,
2828
data_layout: "e-m:x-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
2929
i64:64-i128:128-f80:128-n8:16:32-a:0:32-S32"

compiler/rustc_target/src/spec/targets/thumbv7a_pc_windows_msvc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub fn target() -> Target {
1313

1414
Target {
1515
llvm_target: "thumbv7a-pc-windows-msvc".into(),
16-
description: None,
16+
description: Some("ARM32 Windows MSVC".into()),
1717
pointer_width: 32,
1818
data_layout: "e-m:w-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
1919
arch: "arm".into(),

compiler/rustc_target/src/spec/targets/x86_64_pc_windows_msvc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pub fn target() -> Target {
1010

1111
Target {
1212
llvm_target: "x86_64-pc-windows-msvc".into(),
13-
description: None,
13+
description: Some("64-bit MSVC (Windows 7+)".into()),
1414
pointer_width: 64,
1515
data_layout:
1616
"e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),

compiler/rustc_target/src/spec/targets/x86_64_win7_windows_msvc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ pub fn target() -> Target {
99

1010
Target {
1111
llvm_target: "x86_64-win7-windows-msvc".into(),
12-
description: None,
12+
description: Some("64-bit Windows 7 support".into()),
1313
pointer_width: 64,
1414
data_layout:
1515
"e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),

0 commit comments

Comments
 (0)