Skip to content

Commit 3e826bb

Browse files
committed
Auto merge of rust-lang#82359 - JohnTitor:rollup-6puemik, r=JohnTitor
Rollup of 11 pull requests Successful merges: - rust-lang#81300 (BTree: share panicky test code & test panic during clear, clone) - rust-lang#81706 (Document BinaryHeap unsafe functions) - rust-lang#81833 (parallelize x.py test tidy) - rust-lang#81966 (Add new `rustc` target for Arm64 machines that can target the iphonesimulator) - rust-lang#82154 (Update RELEASES.md 1.50 to include methods stabilized in rust-lang#79342) - rust-lang#82177 (Do not delete bootstrap.exe on Windows during clean) - rust-lang#82181 (Add check for ES5 in CI) - rust-lang#82229 (Add [A-diagnostics] bug report template) - rust-lang#82233 (try-back-block-type test: Use TryFromSliceError for From test) - rust-lang#82302 (Remove unsafe impl Send for CompletedTest & TestResult) - rust-lang#82349 (test: Print test name only once on timeout) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents ef14688 + d7fb4de commit 3e826bb

File tree

24 files changed

+708
-311
lines changed

24 files changed

+708
-311
lines changed

.github/ISSUE_TEMPLATE/diagnostics.md

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
name: Diagnostic issue
3+
about: Create a bug report or feature request for a change to `rustc`'s error output
4+
labels: A-diagnostics, T-compiler
5+
---
6+
<!--
7+
Thank you for filing a bug report! 🐛 Please provide a short summary of the bug,
8+
along with any information you feel relevant to replicating the bug.
9+
10+
If you cannot produce a minimal reproduction case (something that would work in
11+
isolation), please provide the steps or even link to a repository that causes
12+
the problematic output to occur.
13+
-->
14+
15+
Given the following code: <!-- Please provide a link to play.rust-lang.org -->
16+
17+
```rust
18+
<code>
19+
```
20+
21+
The current output is:
22+
23+
```
24+
<rustc output>
25+
```
26+
27+
<!-- The following is not always necessary. -->
28+
Ideally the output should look like:
29+
30+
```
31+
<proposed output>
32+
```
33+
34+
<!--
35+
If the problem is not self-explanatory, please provide a rationale for the
36+
change.
37+
-->
38+
39+
<!--
40+
If dramatically different output is caused by small changes, consider also
41+
adding them here.
42+
43+
If you're using the stable version of the compiler, you should also check if the
44+
bug also exists in the beta or nightly versions. The output might also be
45+
different depending on the Edition.
46+
-->

RELEASES.md

+34
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,23 @@ The following previously stable methods are now `const`.
4343

4444
- [`IpAddr::is_ipv4`]
4545
- [`IpAddr::is_ipv6`]
46+
- [`IpAddr::is_unspecified`]
47+
- [`IpAddr::is_loopback`]
48+
- [`IpAddr::is_multicast`]
49+
- [`Ipv4Addr::octets`]
50+
- [`Ipv4Addr::is_loopback`]
51+
- [`Ipv4Addr::is_private`]
52+
- [`Ipv4Addr::is_link_local`]
53+
- [`Ipv4Addr::is_multicast`]
54+
- [`Ipv4Addr::is_broadcast`]
55+
- [`Ipv4Addr::is_documentation`]
56+
- [`Ipv4Addr::to_ipv6_compatible`]
57+
- [`Ipv4Addr::to_ipv6_mapped`]
58+
- [`Ipv6Addr::segments`]
59+
- [`Ipv6Addr::is_unspecified`]
60+
- [`Ipv6Addr::is_loopback`]
61+
- [`Ipv6Addr::is_multicast`]
62+
- [`Ipv6Addr::to_ipv4`]
4663
- [`Layout::size`]
4764
- [`Layout::align`]
4865
- [`Layout::from_size_align`]
@@ -104,6 +121,23 @@ Compatibility Notes
104121
[cargo/8725]: https://github.com/rust-lang/cargo/pull/8725
105122
[`IpAddr::is_ipv4`]: https://doc.rust-lang.org/stable/std/net/enum.IpAddr.html#method.is_ipv4
106123
[`IpAddr::is_ipv6`]: https://doc.rust-lang.org/stable/std/net/enum.IpAddr.html#method.is_ipv6
124+
[`IpAddr::is_unspecified`]: https://doc.rust-lang.org/stable/std/net/enum.IpAddr.html#method.is_unspecified
125+
[`IpAddr::is_loopback`]: https://doc.rust-lang.org/stable/std/net/enum.IpAddr.html#method.is_loopback
126+
[`IpAddr::is_multicast`]: https://doc.rust-lang.org/stable/std/net/enum.IpAddr.html#method.is_multicast
127+
[`Ipv4Addr::octets`]: https://doc.rust-lang.org/stable/std/net/struct.Ipv4Addr.html#method.octets
128+
[`Ipv4Addr::is_loopback`]: https://doc.rust-lang.org/stable/std/net/struct.Ipv4Addr.html#method.is_loopback
129+
[`Ipv4Addr::is_private`]: https://doc.rust-lang.org/stable/std/net/struct.Ipv4Addr.html#method.is_private
130+
[`Ipv4Addr::is_link_local`]: https://doc.rust-lang.org/stable/std/net/struct.Ipv4Addr.html#method.is_link_local
131+
[`Ipv4Addr::is_multicast`]: https://doc.rust-lang.org/stable/std/net/struct.Ipv4Addr.html#method.is_multicast
132+
[`Ipv4Addr::is_broadcast`]: https://doc.rust-lang.org/stable/std/net/struct.Ipv4Addr.html#method.is_broadcast
133+
[`Ipv4Addr::is_documentation`]: https://doc.rust-lang.org/stable/std/net/struct.Ipv4Addr.html#method.is_documentation
134+
[`Ipv4Addr::to_ipv6_compatible`]: https://doc.rust-lang.org/stable/std/net/struct.Ipv4Addr.html#method.to_ipv6_compatible
135+
[`Ipv4Addr::to_ipv6_mapped`]: https://doc.rust-lang.org/stable/std/net/struct.Ipv4Addr.html#method.to_ipv6_mapped
136+
[`Ipv6Addr::segments`]: https://doc.rust-lang.org/stable/std/net/struct.Ipv6Addr.html#method.segments
137+
[`Ipv6Addr::is_unspecified`]: https://doc.rust-lang.org/stable/std/net/struct.Ipv6Addr.html#method.is_unspecified
138+
[`Ipv6Addr::is_loopback`]: https://doc.rust-lang.org/stable/std/net/struct.Ipv6Addr.html#method.is_loopback
139+
[`Ipv6Addr::is_multicast`]: https://doc.rust-lang.org/stable/std/net/struct.Ipv6Addr.html#method.is_multicast
140+
[`Ipv6Addr::to_ipv4`]: https://doc.rust-lang.org/stable/std/net/struct.Ipv6Addr.html#method.to_ipv4
107141
[`Layout::align`]: https://doc.rust-lang.org/stable/std/alloc/struct.Layout.html#method.align
108142
[`Layout::from_size_align`]: https://doc.rust-lang.org/stable/std/alloc/struct.Layout.html#method.from_size_align
109143
[`Layout::size`]: https://doc.rust-lang.org/stable/std/alloc/struct.Layout.html#method.size

compiler/rustc_codegen_ssa/src/back/link.rs

+1
Original file line numberDiff line numberDiff line change
@@ -2193,6 +2193,7 @@ fn add_apple_sdk(cmd: &mut dyn Linker, sess: &Session, flavor: LinkerFlavor) {
21932193
("x86_64", "tvos") => "appletvsimulator",
21942194
("arm", "ios") => "iphoneos",
21952195
("aarch64", "ios") if llvm_target.contains("macabi") => "macosx",
2196+
("aarch64", "ios") if llvm_target.contains("sim") => "iphonesimulator",
21962197
("aarch64", "ios") => "iphoneos",
21972198
("x86", "ios") => "iphonesimulator",
21982199
("x86_64", "ios") if llvm_target.contains("macabi") => "macosx",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
use super::apple_sdk_base::{opts, Arch};
2+
use crate::spec::{Target, TargetOptions};
3+
4+
pub fn target() -> Target {
5+
let base = opts("ios", Arch::Arm64_sim);
6+
7+
// Clang automatically chooses a more specific target based on
8+
// IPHONEOS_DEPLOYMENT_TARGET.
9+
// This is required for the simulator target to pick the right
10+
// MACH-O commands, so we do too.
11+
let arch = "arm64";
12+
let llvm_target = super::apple_base::ios_sim_llvm_target(arch);
13+
14+
Target {
15+
llvm_target: llvm_target,
16+
pointer_width: 64,
17+
data_layout: "e-m:o-i64:64-i128:128-n32:64-S128".to_string(),
18+
arch: "aarch64".to_string(),
19+
options: TargetOptions {
20+
features: "+neon,+fp-armv8,+apple-a7".to_string(),
21+
eliminate_frame_pointer: false,
22+
max_atomic_width: Some(128),
23+
unsupported_abis: super::arm_base::unsupported_abis(),
24+
forces_embed_bitcode: true,
25+
// Taken from a clang build on Xcode 11.4.1.
26+
// These arguments are not actually invoked - they just have
27+
// to look right to pass App Store validation.
28+
bitcode_llvm_cmdline: "-triple\0\
29+
arm64-apple-ios14.0-simulator\0\
30+
-emit-obj\0\
31+
-disable-llvm-passes\0\
32+
-target-abi\0\
33+
darwinpcs\0\
34+
-Os\0"
35+
.to_string(),
36+
..base
37+
},
38+
}
39+
}

compiler/rustc_target/src/spec/apple_base.rs

+16-5
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,16 @@ pub fn opts(os: &str) -> TargetOptions {
5454
}
5555
}
5656

57-
fn macos_deployment_target() -> (u32, u32) {
58-
let deployment_target = env::var("MACOSX_DEPLOYMENT_TARGET").ok();
59-
let version = deployment_target
57+
fn deployment_target(var_name: &str) -> Option<(u32, u32)> {
58+
let deployment_target = env::var(var_name).ok();
59+
deployment_target
6060
.as_ref()
6161
.and_then(|s| s.split_once('.'))
62-
.and_then(|(a, b)| a.parse::<u32>().and_then(|a| b.parse::<u32>().map(|b| (a, b))).ok());
62+
.and_then(|(a, b)| a.parse::<u32>().and_then(|a| b.parse::<u32>().map(|b| (a, b))).ok())
63+
}
6364

64-
version.unwrap_or((10, 7))
65+
fn macos_deployment_target() -> (u32, u32) {
66+
deployment_target("MACOSX_DEPLOYMENT_TARGET").unwrap_or((10, 7))
6567
}
6668

6769
pub fn macos_llvm_target(arch: &str) -> String {
@@ -84,3 +86,12 @@ pub fn macos_link_env_remove() -> Vec<String> {
8486
env_remove.push("IPHONEOS_DEPLOYMENT_TARGET".to_string());
8587
env_remove
8688
}
89+
90+
fn ios_deployment_target() -> (u32, u32) {
91+
deployment_target("IPHONEOS_DEPLOYMENT_TARGET").unwrap_or((7, 0))
92+
}
93+
94+
pub fn ios_sim_llvm_target(arch: &str) -> String {
95+
let (major, minor) = ios_deployment_target();
96+
format!("{}-apple-ios{}.{}.0-simulator", arch, major, minor)
97+
}

compiler/rustc_target/src/spec/apple_sdk_base.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ pub enum Arch {
1111
X86_64,
1212
X86_64_macabi,
1313
Arm64_macabi,
14+
Arm64_sim,
1415
}
1516

1617
fn target_cpu(arch: Arch) -> String {
@@ -22,13 +23,16 @@ fn target_cpu(arch: Arch) -> String {
2223
X86_64 => "core2",
2324
X86_64_macabi => "core2",
2425
Arm64_macabi => "apple-a12",
26+
Arm64_sim => "apple-a12",
2527
}
2628
.to_string()
2729
}
2830

2931
fn link_env_remove(arch: Arch) -> Vec<String> {
3032
match arch {
31-
Armv7 | Armv7s | Arm64 | I386 | X86_64 => vec!["MACOSX_DEPLOYMENT_TARGET".to_string()],
33+
Armv7 | Armv7s | Arm64 | I386 | X86_64 | Arm64_sim => {
34+
vec!["MACOSX_DEPLOYMENT_TARGET".to_string()]
35+
}
3236
X86_64_macabi | Arm64_macabi => vec!["IPHONEOS_DEPLOYMENT_TARGET".to_string()],
3337
}
3438
}

compiler/rustc_target/src/spec/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -727,6 +727,7 @@ supported_targets! {
727727
("armv7s-apple-ios", armv7s_apple_ios),
728728
("x86_64-apple-ios-macabi", x86_64_apple_ios_macabi),
729729
("aarch64-apple-ios-macabi", aarch64_apple_ios_macabi),
730+
("aarch64-apple-ios-sim", aarch64_apple_ios_sim),
730731
("aarch64-apple-tvos", aarch64_apple_tvos),
731732
("x86_64-apple-tvos", x86_64_apple_tvos),
732733

0 commit comments

Comments
 (0)