Skip to content

Commit f7b4354

Browse files
committed
Auto merge of #138480 - jhpratt:rollup-y3b8wu5, r=jhpratt
Rollup of 16 pull requests Successful merges: - #136001 (Overhaul examples for PermissionsExt) - #136230 (Reword incorrect documentation about SocketAddr having varying layout) - #136892 (Sync Fuchsia target spec with clang Fuchsia driver) - #136911 (Add documentation URL to selected jobs) - #137870 ( Improve HashMap docs for const and static initializers) - #138179 (Add `src/tools/x` to the main workspace) - #138389 (use `expect` instead of `allow`) - #138396 (Enable metrics and verbose tests in PR CI) - #138398 (atomic intrinsics: clarify which types are supported and (if applicable) what happens with provenance) - #138432 (fix: remove the check of lld not supporting `@response-file)` - #138434 (Visit `PatField` when collecting lint levels) - #138441 (update error message) - #138442 (EUV: fix place of deref pattern's interior's scrutinee) - #138457 (Remove usage of legacy scheme paths on RedoxOS) - #138461 (Remove an outdated line from a test comment) - #138466 (Remove myself from libs review) Failed merges: - #138452 (Remove `RUN_CHECK_WITH_PARALLEL_QUERIES`) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 523c507 + dea8a15 commit f7b4354

File tree

49 files changed

+488
-212
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+488
-212
lines changed

.github/workflows/ci.yml

+15-2
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ jobs:
6868
timeout-minutes: 360
6969
env:
7070
CI_JOB_NAME: ${{ matrix.name }}
71+
CI_JOB_DOC_URL: ${{ matrix.doc_url }}
7172
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
7273
# commit of PR sha or commit sha. `GITHUB_SHA` is not accurate for PRs.
7374
HEAD_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
@@ -190,8 +191,20 @@ jobs:
190191
CARGO_INCREMENTAL=0 CARGO_TARGET_DIR=../../../build/citool cargo build
191192
192193
- name: run the build
193-
# Redirect stderr to stdout to avoid reordering the two streams in the GHA logs.
194-
run: src/ci/scripts/run-build-from-ci.sh 2>&1
194+
run: |
195+
set +e
196+
# Redirect stderr to stdout to avoid reordering the two streams in the GHA logs.
197+
src/ci/scripts/run-build-from-ci.sh 2>&1
198+
STATUS=$?
199+
set -e
200+
201+
if [[ "$STATUS" -ne 0 && -n "$CI_JOB_DOC_URL" ]]; then
202+
echo "****************************************************************************"
203+
echo "To find more information about this job, visit the following URL:"
204+
echo "$CI_JOB_DOC_URL"
205+
echo "****************************************************************************"
206+
fi
207+
exit ${STATUS}
195208
env:
196209
AWS_ACCESS_KEY_ID: ${{ env.CACHES_AWS_ACCESS_KEY_ID }}
197210
AWS_SECRET_ACCESS_KEY: ${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.CACHES_AWS_ACCESS_KEY_ID)] }}

Cargo.lock

+4
Original file line numberDiff line numberDiff line change
@@ -6438,6 +6438,10 @@ version = "0.5.5"
64386438
source = "registry+https://github.com/rust-lang/crates.io-index"
64396439
checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51"
64406440

6441+
[[package]]
6442+
name = "x"
6443+
version = "0.1.1"
6444+
64416445
[[package]]
64426446
name = "xattr"
64436447
version = "1.4.0"

Cargo.toml

+27-29
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,53 @@
11
[workspace]
22
resolver = "2"
33
members = [
4+
# tidy-alphabetical-start
45
"compiler/rustc",
56
"src/build_helper",
67
"src/etc/test-float-parse",
7-
"src/rustc-std-workspace/rustc-std-workspace-core",
88
"src/rustc-std-workspace/rustc-std-workspace-alloc",
9+
"src/rustc-std-workspace/rustc-std-workspace-core",
910
"src/rustc-std-workspace/rustc-std-workspace-std",
1011
"src/rustdoc-json-types",
12+
"src/tools/build-manifest",
13+
"src/tools/bump-stage0",
1114
"src/tools/cargotest",
1215
"src/tools/clippy",
1316
"src/tools/clippy/clippy_dev",
17+
"src/tools/collect-license-metadata",
1418
"src/tools/compiletest",
15-
"src/tools/run-make-support",
19+
"src/tools/coverage-dump",
20+
"src/tools/features-status-dump",
21+
"src/tools/generate-copyright",
22+
"src/tools/generate-windows-sys",
23+
"src/tools/html-checker",
24+
"src/tools/jsondocck",
25+
"src/tools/jsondoclint",
1626
"src/tools/linkchecker",
1727
"src/tools/lint-docs",
28+
"src/tools/lld-wrapper",
29+
"src/tools/llvm-bitcode-linker",
30+
"src/tools/miri",
31+
"src/tools/miri/cargo-miri",
1832
"src/tools/miropt-test-tools",
19-
"src/tools/unstable-book-gen",
20-
"src/tools/tidy",
21-
"src/tools/tier-check",
22-
"src/tools/build-manifest",
33+
"src/tools/opt-dist",
2334
"src/tools/remote-test-client",
2435
"src/tools/remote-test-server",
36+
"src/tools/replace-version-placeholder",
37+
"src/tools/run-make-support",
2538
"src/tools/rust-installer",
2639
"src/tools/rustdoc",
27-
"src/tools/rustfmt",
28-
"src/tools/miri",
29-
"src/tools/miri/cargo-miri",
40+
"src/tools/rustdoc-gui-test",
3041
"src/tools/rustdoc-themes",
31-
"src/tools/unicode-table-generator",
32-
"src/tools/jsondocck",
33-
"src/tools/jsondoclint",
34-
"src/tools/llvm-bitcode-linker",
35-
"src/tools/html-checker",
36-
"src/tools/bump-stage0",
37-
"src/tools/replace-version-placeholder",
38-
"src/tools/lld-wrapper",
39-
"src/tools/collect-license-metadata",
40-
"src/tools/generate-copyright",
42+
"src/tools/rustfmt",
4143
"src/tools/suggest-tests",
42-
"src/tools/generate-windows-sys",
43-
"src/tools/rustdoc-gui-test",
44-
"src/tools/opt-dist",
45-
"src/tools/coverage-dump",
44+
"src/tools/tidy",
45+
"src/tools/tier-check",
46+
"src/tools/unicode-table-generator",
47+
"src/tools/unstable-book-gen",
4648
"src/tools/wasm-component-ld",
47-
"src/tools/features-status-dump",
49+
"src/tools/x",
50+
# tidy-alphabetical-end
4851
]
4952

5053
exclude = [
@@ -55,11 +58,6 @@ exclude = [
5558
"tests/rustdoc-gui",
5659
# HACK(eddyb) This hardcodes the fact that our CI uses `/checkout/obj`.
5760
"obj",
58-
# The `x` binary is a thin wrapper that calls `x.py`, which initializes
59-
# submodules, before which workspace members cannot be invoked because
60-
# not all `Cargo.toml` files are available, so we exclude the `x` binary,
61-
# so it can be invoked before the current checkout is set up.
62-
"src/tools/x",
6361
]
6462

6563
[profile.release.package.rustc-rayon-core]

compiler/rustc_codegen_cranelift/src/intrinsics/mod.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1031,7 +1031,7 @@ fn codegen_regular_intrinsic_call<'tcx>(
10311031

10321032
let layout = src.layout();
10331033
match layout.ty.kind() {
1034-
ty::Uint(_) | ty::Int(_) | ty::RawPtr(..) => {}
1034+
ty::Int(_) => {}
10351035
_ => {
10361036
report_atomic_type_validation_error(fx, intrinsic, source_info.span, layout.ty);
10371037
return Ok(());
@@ -1052,7 +1052,7 @@ fn codegen_regular_intrinsic_call<'tcx>(
10521052

10531053
let layout = src.layout();
10541054
match layout.ty.kind() {
1055-
ty::Uint(_) | ty::Int(_) | ty::RawPtr(..) => {}
1055+
ty::Uint(_) => {}
10561056
_ => {
10571057
report_atomic_type_validation_error(fx, intrinsic, source_info.span, layout.ty);
10581058
return Ok(());
@@ -1073,7 +1073,7 @@ fn codegen_regular_intrinsic_call<'tcx>(
10731073

10741074
let layout = src.layout();
10751075
match layout.ty.kind() {
1076-
ty::Uint(_) | ty::Int(_) | ty::RawPtr(..) => {}
1076+
ty::Int(_) => {}
10771077
_ => {
10781078
report_atomic_type_validation_error(fx, intrinsic, source_info.span, layout.ty);
10791079
return Ok(());
@@ -1094,7 +1094,7 @@ fn codegen_regular_intrinsic_call<'tcx>(
10941094

10951095
let layout = src.layout();
10961096
match layout.ty.kind() {
1097-
ty::Uint(_) | ty::Int(_) | ty::RawPtr(..) => {}
1097+
ty::Uint(_) => {}
10981098
_ => {
10991099
report_atomic_type_validation_error(fx, intrinsic, source_info.span, layout.ty);
11001100
return Ok(());

compiler/rustc_codegen_ssa/src/back/command.rs

-7
Original file line numberDiff line numberDiff line change
@@ -143,13 +143,6 @@ impl Command {
143143
return false;
144144
}
145145

146-
// Right now LLD doesn't support the `@` syntax of passing an argument
147-
// through files, so regardless of the platform we try to go to the OS
148-
// on this one.
149-
if let Program::Lld(..) = self.program {
150-
return false;
151-
}
152-
153146
// Ok so on Windows to spawn a process is 32,768 characters in its
154147
// command line [1]. Unfortunately we don't actually have access to that
155148
// as it's calculated just before spawning. Instead we perform a

compiler/rustc_codegen_ssa/src/mir/intrinsic.rs

+34-4
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,40 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
433433
}
434434

435435
// These are all AtomicRMW ops
436+
"max" | "min" => {
437+
let atom_op = if instruction == "max" {
438+
AtomicRmwBinOp::AtomicMax
439+
} else {
440+
AtomicRmwBinOp::AtomicMin
441+
};
442+
443+
let ty = fn_args.type_at(0);
444+
if matches!(ty.kind(), ty::Int(_)) {
445+
let ptr = args[0].immediate();
446+
let val = args[1].immediate();
447+
bx.atomic_rmw(atom_op, ptr, val, parse_ordering(bx, ordering))
448+
} else {
449+
invalid_monomorphization(ty);
450+
return Ok(());
451+
}
452+
}
453+
"umax" | "umin" => {
454+
let atom_op = if instruction == "umax" {
455+
AtomicRmwBinOp::AtomicUMax
456+
} else {
457+
AtomicRmwBinOp::AtomicUMin
458+
};
459+
460+
let ty = fn_args.type_at(0);
461+
if matches!(ty.kind(), ty::Uint(_)) {
462+
let ptr = args[0].immediate();
463+
let val = args[1].immediate();
464+
bx.atomic_rmw(atom_op, ptr, val, parse_ordering(bx, ordering))
465+
} else {
466+
invalid_monomorphization(ty);
467+
return Ok(());
468+
}
469+
}
436470
op => {
437471
let atom_op = match op {
438472
"xchg" => AtomicRmwBinOp::AtomicXchg,
@@ -442,10 +476,6 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
442476
"nand" => AtomicRmwBinOp::AtomicNand,
443477
"or" => AtomicRmwBinOp::AtomicOr,
444478
"xor" => AtomicRmwBinOp::AtomicXor,
445-
"max" => AtomicRmwBinOp::AtomicMax,
446-
"min" => AtomicRmwBinOp::AtomicMin,
447-
"umax" => AtomicRmwBinOp::AtomicUMax,
448-
"umin" => AtomicRmwBinOp::AtomicUMin,
449479
_ => bx.sess().dcx().emit_fatal(errors::UnknownAtomicOperation),
450480
};
451481

compiler/rustc_hir_typeck/src/expr_use_visitor.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1840,7 +1840,8 @@ impl<'tcx, Cx: TypeInformationCtxt<'tcx>, D: Delegate<'tcx>> ExprUseVisitor<'tcx
18401840
let ty = self.pat_ty_adjusted(subpat)?;
18411841
let ty = Ty::new_ref(self.cx.tcx(), re_erased, ty, mutability);
18421842
// A deref pattern generates a temporary.
1843-
let place = self.cat_rvalue(pat.hir_id, ty);
1843+
let base = self.cat_rvalue(pat.hir_id, ty);
1844+
let place = self.cat_deref(pat.hir_id, base)?;
18441845
self.cat_pattern(place, subpat, op)?;
18451846
}
18461847

compiler/rustc_lint/src/levels.rs

+5
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,11 @@ impl<'tcx> Visitor<'tcx> for LintLevelsBuilder<'_, LintLevelQueryMap<'tcx>> {
299299
intravisit::walk_expr(self, e);
300300
}
301301

302+
fn visit_pat_field(&mut self, f: &'tcx hir::PatField<'tcx>) -> Self::Result {
303+
self.add_id(f.hir_id);
304+
intravisit::walk_pat_field(self, f);
305+
}
306+
302307
fn visit_expr_field(&mut self, f: &'tcx hir::ExprField<'tcx>) {
303308
self.add_id(f.hir_id);
304309
intravisit::walk_expr_field(self, f);

compiler/rustc_target/src/spec/base/fuchsia.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ pub(crate) fn opts() -> TargetOptions {
77
// now. When using clang as the linker it will supply these options for us,
88
// so we only list them for ld/lld.
99
//
10-
// https://github.com/llvm/llvm-project/blob/db9322b2066c55254e7691efeab863f43bfcc084/clang/lib/Driver/ToolChains/Fuchsia.cpp#L31
10+
// https://github.com/llvm/llvm-project/blob/0419db6b95e246fe9dc90b5795beb77c393eb2ce/clang/lib/Driver/ToolChains/Fuchsia.cpp#L32
1111
let pre_link_args = TargetOptions::link_args(
1212
LinkerFlavor::Gnu(Cc::No, Lld::No),
1313
&[
@@ -18,9 +18,13 @@ pub(crate) fn opts() -> TargetOptions {
1818
"-z",
1919
"now",
2020
"-z",
21+
"start-stop-visibility=hidden",
22+
"-z",
2123
"rodynamic",
2224
"-z",
2325
"separate-loadable-segments",
26+
"-z",
27+
"rel",
2428
"--pack-dyn-relocs=relr",
2529
],
2630
);
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,28 @@
1-
use crate::spec::{SanitizerSet, StackProbeType, Target, TargetMetadata, TargetOptions, base};
1+
use crate::spec::{
2+
Cc, LinkerFlavor, Lld, SanitizerSet, StackProbeType, Target, TargetMetadata, base,
3+
};
24

35
pub(crate) fn target() -> Target {
6+
let mut base = base::fuchsia::opts();
7+
base.cpu = "generic".into();
8+
base.features = "+v8a,+crc,+aes,+sha2,+neon".into();
9+
base.max_atomic_width = Some(128);
10+
base.stack_probes = StackProbeType::Inline;
11+
base.supported_sanitizers = SanitizerSet::ADDRESS
12+
| SanitizerSet::CFI
13+
| SanitizerSet::LEAK
14+
| SanitizerSet::SHADOWCALLSTACK;
15+
base.supports_xray = true;
16+
17+
base.add_pre_link_args(
18+
LinkerFlavor::Gnu(Cc::No, Lld::No),
19+
&[
20+
"--execute-only",
21+
// Enable the Cortex-A53 errata 843419 mitigation by default
22+
"--fix-cortex-a53-843419",
23+
],
24+
);
25+
426
Target {
527
llvm_target: "aarch64-unknown-fuchsia".into(),
628
metadata: TargetMetadata {
@@ -12,14 +34,6 @@ pub(crate) fn target() -> Target {
1234
pointer_width: 64,
1335
data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32".into(),
1436
arch: "aarch64".into(),
15-
options: TargetOptions {
16-
features: "+v8a".into(),
17-
max_atomic_width: Some(128),
18-
stack_probes: StackProbeType::Inline,
19-
supported_sanitizers: SanitizerSet::ADDRESS
20-
| SanitizerSet::CFI
21-
| SanitizerSet::SHADOWCALLSTACK,
22-
..base::fuchsia::opts()
23-
},
37+
options: base,
2438
}
2539
}
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
1-
use crate::spec::{CodeModel, SanitizerSet, Target, TargetMetadata, TargetOptions, base};
1+
use crate::spec::{CodeModel, SanitizerSet, StackProbeType, Target, TargetMetadata, base};
22

33
pub(crate) fn target() -> Target {
4+
let mut base = base::fuchsia::opts();
5+
base.code_model = Some(CodeModel::Medium);
6+
base.cpu = "generic-rv64".into();
7+
base.features = "+m,+a,+f,+d,+c".into();
8+
base.llvm_abiname = "lp64d".into();
9+
base.max_atomic_width = Some(64);
10+
base.stack_probes = StackProbeType::Inline;
11+
base.supported_sanitizers = SanitizerSet::SHADOWCALLSTACK;
12+
base.supports_xray = true;
13+
414
Target {
515
llvm_target: "riscv64-unknown-fuchsia".into(),
616
metadata: TargetMetadata {
@@ -12,14 +22,6 @@ pub(crate) fn target() -> Target {
1222
pointer_width: 64,
1323
data_layout: "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128".into(),
1424
arch: "riscv64".into(),
15-
options: TargetOptions {
16-
code_model: Some(CodeModel::Medium),
17-
cpu: "generic-rv64".into(),
18-
features: "+m,+a,+f,+d,+c".into(),
19-
llvm_abiname: "lp64d".into(),
20-
max_atomic_width: Some(64),
21-
supported_sanitizers: SanitizerSet::SHADOWCALLSTACK,
22-
..base::fuchsia::opts()
23-
},
25+
options: base,
2426
}
2527
}

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

+4-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ pub(crate) fn target() -> Target {
44
let mut base = base::fuchsia::opts();
55
base.cpu = "x86-64".into();
66
base.plt_by_default = false;
7-
base.max_atomic_width = Some(64);
7+
// See https://fuchsia.dev/fuchsia-src/contribute/governance/rfcs/0073_x86_64_platform_requirement,
8+
// which corresponds to x86-64-v2.
9+
base.features = "+cx16,+sahf,+popcnt,+sse3,+sse4.1,+sse4.2,+ssse3".into();
10+
base.max_atomic_width = Some(128);
811
base.stack_probes = StackProbeType::Inline;
912
base.supported_sanitizers = SanitizerSet::ADDRESS | SanitizerSet::CFI | SanitizerSet::LEAK;
1013
base.supports_xray = true;

0 commit comments

Comments
 (0)