Skip to content

Commit 7760cd0

Browse files
committed
Auto merge of #69293 - Dylan-DPC:rollup-imcbvgo, r=Dylan-DPC
Rollup of 5 pull requests Successful merges: - #68863 (ci: switch macOS builders to 10.15) - #69142 (Add shared script for linkchecking books.) - #69248 (Don't eliminate frame pointers on thumb targets) - #69280 (Remove special case for `simd_shuffle` arg promotion) - #69284 (Reword OpenOptions::{create, create_new} doc.) Failed merges: r? @ghost
2 parents 7d6b8c4 + a97f354 commit 7760cd0

18 files changed

+164
-73
lines changed

src/bootstrap/test.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1051,10 +1051,10 @@ impl Step for Compiletest {
10511051
cmd.arg("--docck-python").arg(builder.python());
10521052

10531053
if builder.config.build.ends_with("apple-darwin") {
1054-
// Force /usr/bin/python on macOS for LLDB tests because we're loading the
1054+
// Force /usr/bin/python3 on macOS for LLDB tests because we're loading the
10551055
// LLDB plugin's compiled module which only works with the system python
10561056
// (namely not Homebrew-installed python)
1057-
cmd.arg("--lldb-python").arg("/usr/bin/python");
1057+
cmd.arg("--lldb-python").arg("/usr/bin/python3");
10581058
} else {
10591059
cmd.arg("--lldb-python").arg(builder.python());
10601060
}

src/ci/azure-pipelines/auto.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
- job: macOS
6464
timeoutInMinutes: 600
6565
pool:
66-
vmImage: macos-10.13
66+
vmImage: macos-10.15
6767
steps:
6868
- template: steps/run.yml
6969
strategy:

src/ci/azure-pipelines/steps/run.yml

-4
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,6 @@ steps:
5151
displayName: Install clang
5252
condition: and(succeeded(), not(variables.SKIP_JOB))
5353

54-
- bash: src/ci/scripts/switch-xcode.sh
55-
displayName: Switch to Xcode 9.3
56-
condition: and(succeeded(), not(variables.SKIP_JOB))
57-
5854
- bash: src/ci/scripts/install-wix.sh
5955
displayName: Install wix
6056
condition: and(succeeded(), not(variables.SKIP_JOB))

src/ci/azure-pipelines/try.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
# - job: macOS
2626
# timeoutInMinutes: 600
2727
# pool:
28-
# vmImage: macos-10.13
28+
# vmImage: macos-10.15
2929
# steps:
3030
# - template: steps/run.yml
3131
# strategy:

src/ci/scripts/install-clang.sh

+1-3
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@ if isMacOS; then
1919
# native clang is configured to use the correct path, but our custom one
2020
# doesn't. This sets the SDKROOT environment variable to the SDK so that
2121
# our own clang can figure out the correct include path on its own.
22-
if ! [[ -d "/usr/include" ]]; then
23-
ciCommandSetEnv SDKROOT "$(xcrun --sdk macosx --show-sdk-path)"
24-
fi
22+
ciCommandSetEnv SDKROOT "$(xcrun --sdk macosx --show-sdk-path)"
2523

2624
# Configure `AR` specifically so rustbuild doesn't try to infer it as
2725
# `clang-ar` by accident.

src/ci/scripts/switch-xcode.sh

-13
This file was deleted.

src/librustc_mir/const_eval/eval_queries.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ fn eval_body_using_ecx<'mir, 'tcx>(
7272
Ok(ret)
7373
}
7474

75-
/// The `InterpCx` is only meant to be used to do field and index projections into constants for
76-
/// `simd_shuffle` and const patterns in match arms.
75+
/// The `InterpCx` is only meant to be used to do field and index projections into promoteds
76+
/// and const patterns in match arms.
7777
///
7878
/// The function containing the `match` that is currently being analyzed may have generic bounds
7979
/// that inform us about the generic bounds of the constant. E.g., using an associated constant

src/librustc_mir/transform/promote_consts.rs

+5-19
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ use rustc_span::{Span, DUMMY_SP};
2424
use syntax::ast::LitKind;
2525

2626
use rustc_index::vec::{Idx, IndexVec};
27-
use rustc_target::spec::abi::Abi;
2827

2928
use std::cell::Cell;
3029
use std::{cmp, iter, mem, usize};
@@ -106,11 +105,10 @@ pub enum Candidate {
106105
/// Promotion of the `x` in `[x; 32]`.
107106
Repeat(Location),
108107

109-
/// Currently applied to function calls where the callee has the unstable
110-
/// `#[rustc_args_required_const]` attribute as well as the SIMD shuffle
111-
/// intrinsic. The intrinsic requires the arguments are indeed constant and
112-
/// the attribute currently provides the semantic requirement that arguments
113-
/// must be constant.
108+
/// Function calls where the callee has the unstable
109+
/// `#[rustc_args_required_const]` attribute. The attribute requires that
110+
/// the arguments be constant, usually because they are encoded as an
111+
/// immediate operand in a platform intrinsic.
114112
Argument { bb: BasicBlock, index: usize },
115113
}
116114

@@ -218,17 +216,6 @@ impl<'tcx> Visitor<'tcx> for Collector<'_, 'tcx> {
218216

219217
if let TerminatorKind::Call { ref func, .. } = *kind {
220218
if let ty::FnDef(def_id, _) = func.ty(self.body, self.tcx).kind {
221-
let fn_sig = self.tcx.fn_sig(def_id);
222-
if let Abi::RustIntrinsic | Abi::PlatformIntrinsic = fn_sig.abi() {
223-
let name = self.tcx.item_name(def_id);
224-
// FIXME(eddyb) use `#[rustc_args_required_const(2)]` for shuffles.
225-
if name.as_str().starts_with("simd_shuffle") {
226-
self.candidates.push(Candidate::Argument { bb: location.block, index: 2 });
227-
228-
return; // Don't double count `simd_shuffle` candidates
229-
}
230-
}
231-
232219
if let Some(constant_args) = args_required_const(self.tcx, def_id) {
233220
for index in constant_args {
234221
self.candidates.push(Candidate::Argument { bb: location.block, index });
@@ -730,8 +717,7 @@ pub fn validate_candidates(
730717
.filter(|&candidate| {
731718
validator.explicit = candidate.forces_explicit_promotion();
732719

733-
// FIXME(eddyb) also emit the errors for shuffle indices
734-
// and `#[rustc_args_required_const]` arguments here.
720+
// FIXME(eddyb) also emit the errors for `#[rustc_args_required_const]` arguments here.
735721

736722
let is_promotable = validator.validate_candidate(candidate).is_ok();
737723
match candidate {

src/librustc_target/spec/thumb_base.rs

+3
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ pub fn opts() -> TargetOptions {
5050
// until we figure a way to add the pretty printers without requiring a volatile load cf.
5151
// rust-lang/rust#44993.
5252
emit_debug_gdb_scripts: false,
53+
// LLVM is eager to trash the link register when calling `noreturn` functions, which
54+
// breaks debugging. Preserve LR by default to prevent that from happening.
55+
eliminate_frame_pointer: false,
5356
..Default::default()
5457
}
5558
}

src/libstd/fs.rs

+4-8
Original file line numberDiff line numberDiff line change
@@ -844,10 +844,7 @@ impl OpenOptions {
844844
self
845845
}
846846

847-
/// Sets the option for creating a new file.
848-
///
849-
/// This option indicates whether a new file will be created if the file
850-
/// does not yet already exist.
847+
/// Sets the option to create a new file, or open it if it already exists.
851848
///
852849
/// In order for the file to be created, [`write`] or [`append`] access must
853850
/// be used.
@@ -868,11 +865,10 @@ impl OpenOptions {
868865
self
869866
}
870867

871-
/// Sets the option to always create a new file.
868+
/// Sets the option to create a new file, failing if it already exists.
872869
///
873-
/// This option indicates whether a new file will be created.
874-
/// No file is allowed to exist at the target location, also no (dangling)
875-
/// symlink.
870+
/// No file is allowed to exist at the target location, also no (dangling) symlink. In this
871+
/// way, if the call succeeds, the file returned is guaranteed to be new.
876872
///
877873
/// This option is useful because it is atomic. Otherwise between checking
878874
/// whether a file exists and creating a new one, the file may have been

src/test/incremental/issue-61530.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
#![feature(repr_simd, platform_intrinsics)]
1+
#![feature(repr_simd, platform_intrinsics, rustc_attrs)]
22

33
// revisions:rpass1 rpass2
44

55
#[repr(simd)]
66
struct I32x2(i32, i32);
77

88
extern "platform-intrinsic" {
9+
#[rustc_args_required_const(2)]
910
fn simd_shuffle2<T, U>(x: T, y: T, idx: [u32; 2]) -> U;
1011
}
1112

src/test/ui/issues/issue-38074.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
// run-pass
22
// ignore-emscripten FIXME(#45351)
33

4-
#![feature(platform_intrinsics, repr_simd)]
4+
#![feature(platform_intrinsics, repr_simd, rustc_attrs)]
55

66
extern "platform-intrinsic" {
7+
#[rustc_args_required_const(2)]
78
fn simd_shuffle2<T, U>(x: T, y: T, idx: [u32; 2]) -> U;
89
}
910

src/test/ui/simd-intrinsic/simd-intrinsic-generic-elements.rs

+4
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,13 @@ extern "platform-intrinsic" {
4242
fn simd_insert<T, E>(x: T, idx: u32, y: E) -> T;
4343
fn simd_extract<T, E>(x: T, idx: u32) -> E;
4444

45+
#[rustc_args_required_const(2)]
4546
fn simd_shuffle2<T, U>(x: T, y: T, idx: [u32; 2]) -> U;
47+
#[rustc_args_required_const(2)]
4648
fn simd_shuffle3<T, U>(x: T, y: T, idx: [u32; 3]) -> U;
49+
#[rustc_args_required_const(2)]
4750
fn simd_shuffle4<T, U>(x: T, y: T, idx: [u32; 4]) -> U;
51+
#[rustc_args_required_const(2)]
4852
fn simd_shuffle8<T, U>(x: T, y: T, idx: [u32; 8]) -> U;
4953
}
5054

src/test/ui/simd-intrinsic/simd-intrinsic-generic-elements.stderr

+15-15
Original file line numberDiff line numberDiff line change
@@ -1,89 +1,89 @@
11
error[E0511]: invalid monomorphization of `simd_insert` intrinsic: expected SIMD input type, found non-SIMD `i32`
2-
--> $DIR/simd-intrinsic-generic-elements.rs:55:9
2+
--> $DIR/simd-intrinsic-generic-elements.rs:59:9
33
|
44
LL | simd_insert(0, 0, 0);
55
| ^^^^^^^^^^^^^^^^^^^^
66

77
error[E0511]: invalid monomorphization of `simd_insert` intrinsic: expected inserted type `i32` (element of input `i32x4`), found `f64`
8-
--> $DIR/simd-intrinsic-generic-elements.rs:57:9
8+
--> $DIR/simd-intrinsic-generic-elements.rs:61:9
99
|
1010
LL | simd_insert(x, 0, 1.0);
1111
| ^^^^^^^^^^^^^^^^^^^^^^
1212

1313
error[E0511]: invalid monomorphization of `simd_extract` intrinsic: expected return type `i32` (element of input `i32x4`), found `f32`
14-
--> $DIR/simd-intrinsic-generic-elements.rs:59:9
14+
--> $DIR/simd-intrinsic-generic-elements.rs:63:9
1515
|
1616
LL | simd_extract::<_, f32>(x, 0);
1717
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1818

1919
error[E0511]: invalid monomorphization of `simd_shuffle2` intrinsic: expected SIMD input type, found non-SIMD `i32`
20-
--> $DIR/simd-intrinsic-generic-elements.rs:62:9
20+
--> $DIR/simd-intrinsic-generic-elements.rs:66:9
2121
|
2222
LL | simd_shuffle2::<i32, i32>(0, 0, [0; 2]);
2323
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2424

2525
error[E0511]: invalid monomorphization of `simd_shuffle3` intrinsic: expected SIMD input type, found non-SIMD `i32`
26-
--> $DIR/simd-intrinsic-generic-elements.rs:64:9
26+
--> $DIR/simd-intrinsic-generic-elements.rs:68:9
2727
|
2828
LL | simd_shuffle3::<i32, i32>(0, 0, [0; 3]);
2929
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3030

3131
error[E0511]: invalid monomorphization of `simd_shuffle4` intrinsic: expected SIMD input type, found non-SIMD `i32`
32-
--> $DIR/simd-intrinsic-generic-elements.rs:66:9
32+
--> $DIR/simd-intrinsic-generic-elements.rs:70:9
3333
|
3434
LL | simd_shuffle4::<i32, i32>(0, 0, [0; 4]);
3535
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3636

3737
error[E0511]: invalid monomorphization of `simd_shuffle8` intrinsic: expected SIMD input type, found non-SIMD `i32`
38-
--> $DIR/simd-intrinsic-generic-elements.rs:68:9
38+
--> $DIR/simd-intrinsic-generic-elements.rs:72:9
3939
|
4040
LL | simd_shuffle8::<i32, i32>(0, 0, [0; 8]);
4141
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4242

4343
error[E0511]: invalid monomorphization of `simd_shuffle2` intrinsic: expected return element type `i32` (element of input `i32x4`), found `f32x2` with element type `f32`
44-
--> $DIR/simd-intrinsic-generic-elements.rs:71:9
44+
--> $DIR/simd-intrinsic-generic-elements.rs:75:9
4545
|
4646
LL | simd_shuffle2::<_, f32x2>(x, x, [0; 2]);
4747
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4848

4949
error[E0511]: invalid monomorphization of `simd_shuffle3` intrinsic: expected return element type `i32` (element of input `i32x4`), found `f32x3` with element type `f32`
50-
--> $DIR/simd-intrinsic-generic-elements.rs:73:9
50+
--> $DIR/simd-intrinsic-generic-elements.rs:77:9
5151
|
5252
LL | simd_shuffle3::<_, f32x3>(x, x, [0; 3]);
5353
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5454

5555
error[E0511]: invalid monomorphization of `simd_shuffle4` intrinsic: expected return element type `i32` (element of input `i32x4`), found `f32x4` with element type `f32`
56-
--> $DIR/simd-intrinsic-generic-elements.rs:75:9
56+
--> $DIR/simd-intrinsic-generic-elements.rs:79:9
5757
|
5858
LL | simd_shuffle4::<_, f32x4>(x, x, [0; 4]);
5959
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6060

6161
error[E0511]: invalid monomorphization of `simd_shuffle8` intrinsic: expected return element type `i32` (element of input `i32x4`), found `f32x8` with element type `f32`
62-
--> $DIR/simd-intrinsic-generic-elements.rs:77:9
62+
--> $DIR/simd-intrinsic-generic-elements.rs:81:9
6363
|
6464
LL | simd_shuffle8::<_, f32x8>(x, x, [0; 8]);
6565
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6666

6767
error[E0511]: invalid monomorphization of `simd_shuffle2` intrinsic: expected return type of length 2, found `i32x8` with length 8
68-
--> $DIR/simd-intrinsic-generic-elements.rs:80:9
68+
--> $DIR/simd-intrinsic-generic-elements.rs:84:9
6969
|
7070
LL | simd_shuffle2::<_, i32x8>(x, x, [0; 2]);
7171
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7272

7373
error[E0511]: invalid monomorphization of `simd_shuffle3` intrinsic: expected return type of length 3, found `i32x4` with length 4
74-
--> $DIR/simd-intrinsic-generic-elements.rs:82:9
74+
--> $DIR/simd-intrinsic-generic-elements.rs:86:9
7575
|
7676
LL | simd_shuffle3::<_, i32x4>(x, x, [0; 3]);
7777
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7878

7979
error[E0511]: invalid monomorphization of `simd_shuffle4` intrinsic: expected return type of length 4, found `i32x3` with length 3
80-
--> $DIR/simd-intrinsic-generic-elements.rs:84:9
80+
--> $DIR/simd-intrinsic-generic-elements.rs:88:9
8181
|
8282
LL | simd_shuffle4::<_, i32x3>(x, x, [0; 4]);
8383
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8484

8585
error[E0511]: invalid monomorphization of `simd_shuffle8` intrinsic: expected return type of length 8, found `i32x2` with length 2
86-
--> $DIR/simd-intrinsic-generic-elements.rs:86:9
86+
--> $DIR/simd-intrinsic-generic-elements.rs:90:9
8787
|
8888
LL | simd_shuffle8::<_, i32x2>(x, x, [0; 8]);
8989
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/test/ui/simd-intrinsic/simd-intrinsic-inlining-issue67557-ice.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
//
44
// run-pass
55
// compile-flags: -Zmir-opt-level=3
6-
#![feature(platform_intrinsics, repr_simd)]
6+
#![feature(platform_intrinsics, repr_simd, rustc_attrs)]
77

88
extern "platform-intrinsic" {
9+
#[rustc_args_required_const(2)]
910
fn simd_shuffle2<T, U>(x: T, y: T, idx: [u32; 2]) -> U;
1011
}
1112

src/test/ui/simd-intrinsic/simd-intrinsic-inlining-issue67557.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
//
44
// run-pass
55
// compile-flags: -Zmir-opt-level=3
6-
#![feature(platform_intrinsics, repr_simd)]
6+
#![feature(platform_intrinsics, repr_simd, rustc_attrs)]
77

88
extern "platform-intrinsic" {
9+
#[rustc_args_required_const(2)]
910
fn simd_shuffle2<T, U>(x: T, y: T, idx: [u32; 2]) -> U;
1011
}
1112

src/test/ui/simd/simd-intrinsic-generic-elements.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// run-pass
22
// ignore-emscripten FIXME(#45351) hits an LLVM assert
33

4-
#![feature(repr_simd, platform_intrinsics)]
4+
#![feature(repr_simd, platform_intrinsics, rustc_attrs)]
55

66
#[repr(simd)]
77
#[derive(Copy, Clone, Debug, PartialEq)]
@@ -25,9 +25,13 @@ extern "platform-intrinsic" {
2525
fn simd_insert<T, E>(x: T, idx: u32, y: E) -> T;
2626
fn simd_extract<T, E>(x: T, idx: u32) -> E;
2727

28+
#[rustc_args_required_const(2)]
2829
fn simd_shuffle2<T, U>(x: T, y: T, idx: [u32; 2]) -> U;
30+
#[rustc_args_required_const(2)]
2931
fn simd_shuffle3<T, U>(x: T, y: T, idx: [u32; 3]) -> U;
32+
#[rustc_args_required_const(2)]
3033
fn simd_shuffle4<T, U>(x: T, y: T, idx: [u32; 4]) -> U;
34+
#[rustc_args_required_const(2)]
3135
fn simd_shuffle8<T, U>(x: T, y: T, idx: [u32; 8]) -> U;
3236
}
3337

0 commit comments

Comments
 (0)