Skip to content

Commit 76e7a08

Browse files
committed
Auto merge of rust-lang#126104 - workingjubilee:rollup-t1ac2ld, r=workingjubilee
Rollup of 12 pull requests Successful merges: - rust-lang#125220 (Repair several `riscv64gc-unknown-linux-gnu` codegen tests) - rust-lang#126033 (CI: fix publishing of toolstate history) - rust-lang#126034 (Clarify our tier 1 Windows Server support) - rust-lang#126035 (Some minor query system cleanups) - rust-lang#126051 (Clarify an `x fmt` error.) - rust-lang#126059 (Raise `DEFAULT_MIN_STACK_SIZE` to at least 64KiB) - rust-lang#126064 (Migrate `run-make/manual-crate-name` to `rmake.rs`) - rust-lang#126072 (compiletest: Allow multiple `//@ run-flags:` headers) - rust-lang#126073 (Port `tests/run-make-fulldeps/obtain-borrowck` to ui-fulldeps) - rust-lang#126081 (Do not use relative paths to Rust source root in run-make tests) - rust-lang#126086 (use windows compatible executable name for libcxx-version) - rust-lang#126096 ([RFC-2011] Allow `core_intrinsics` when activated) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 98489f2 + efd8959 commit 76e7a08

File tree

36 files changed

+121
-91
lines changed

36 files changed

+121
-91
lines changed

.github/workflows/ci.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ concurrency:
3838
cancel-in-progress: true
3939
env:
4040
TOOLSTATE_REPO: "https://github.com/rust-lang-nursery/rust-toolstate"
41+
# This will be empty in PR jobs.
42+
TOOLSTATE_REPO_ACCESS_TOKEN: ${{ secrets.TOOLSTATE_REPO_ACCESS_TOKEN }}
4143
jobs:
4244
# The job matrix for `calculate_matrix` is defined in src/ci/github-actions/jobs.yml.
4345
# It calculates which jobs should be executed, based on the data of the ${{ github }} context.
@@ -242,6 +244,5 @@ jobs:
242244
shell: bash
243245
if: needs.calculate_matrix.outputs.run_type == 'auto'
244246
env:
245-
TOOLSTATE_REPO_ACCESS_TOKEN: ${{ secrets.TOOLSTATE_REPO_ACCESS_TOKEN }}
246247
TOOLSTATE_ISSUES_API_URL: https://api.github.com/repos/rust-lang/rust/issues
247248
TOOLSTATE_PUBLISH: 1

compiler/rustc_builtin_macros/src/assert/context.rs

-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ impl<'cx, 'a> Context<'cx, 'a> {
5757
/// Builds the whole `assert!` expression. For example, `let elem = 1; assert!(elem == 1);` expands to:
5858
///
5959
/// ```rust
60-
/// #![feature(generic_assert_internals)]
6160
/// let elem = 1;
6261
/// {
6362
/// #[allow(unused_imports)]

compiler/rustc_macros/src/query.rs

+19-2
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,17 @@ pub fn rustc_queries(input: TokenStream) -> TokenStream {
314314
let mut query_description_stream = quote! {};
315315
let mut query_cached_stream = quote! {};
316316
let mut feedable_queries = quote! {};
317+
let mut errors = quote! {};
318+
319+
macro_rules! assert {
320+
( $cond:expr, $span:expr, $( $tt:tt )+ ) => {
321+
if !$cond {
322+
errors.extend(
323+
Error::new($span, format!($($tt)+)).into_compile_error(),
324+
);
325+
}
326+
}
327+
}
317328

318329
for query in queries.0 {
319330
let Query { name, arg, modifiers, .. } = &query;
@@ -369,10 +380,15 @@ pub fn rustc_queries(input: TokenStream) -> TokenStream {
369380
[#attribute_stream] fn #name(#arg) #result,
370381
});
371382

372-
if modifiers.feedable.is_some() {
373-
assert!(modifiers.anon.is_none(), "Query {name} cannot be both `feedable` and `anon`.");
383+
if let Some(feedable) = &modifiers.feedable {
384+
assert!(
385+
modifiers.anon.is_none(),
386+
feedable.span(),
387+
"Query {name} cannot be both `feedable` and `anon`."
388+
);
374389
assert!(
375390
modifiers.eval_always.is_none(),
391+
feedable.span(),
376392
"Query {name} cannot be both `feedable` and `eval_always`."
377393
);
378394
feedable_queries.extend(quote! {
@@ -407,5 +423,6 @@ pub fn rustc_queries(input: TokenStream) -> TokenStream {
407423
use super::*;
408424
#query_cached_stream
409425
}
426+
#errors
410427
})
411428
}

compiler/rustc_query_system/src/dep_graph/graph.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ pub struct MarkFrame<'a> {
6464
parent: Option<&'a MarkFrame<'a>>,
6565
}
6666

67-
#[derive(PartialEq)]
6867
enum DepNodeColor {
6968
Red,
7069
Green(DepNodeIndex),
@@ -925,7 +924,7 @@ impl<D: Deps> DepGraph<D> {
925924
/// Returns true if the given node has been marked as red during the
926925
/// current compilation session. Used in various assertions
927926
pub fn is_red(&self, dep_node: &DepNode) -> bool {
928-
self.node_color(dep_node) == Some(DepNodeColor::Red)
927+
matches!(self.node_color(dep_node), Some(DepNodeColor::Red))
929928
}
930929

931930
/// Returns true if the given node has been marked as green during the

library/core/src/macros/mod.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -1569,7 +1569,12 @@ pub(crate) mod builtin {
15691569
#[rustc_builtin_macro]
15701570
#[macro_export]
15711571
#[rustc_diagnostic_item = "assert_macro"]
1572-
#[allow_internal_unstable(panic_internals, edition_panic, generic_assert_internals)]
1572+
#[allow_internal_unstable(
1573+
core_intrinsics,
1574+
panic_internals,
1575+
edition_panic,
1576+
generic_assert_internals
1577+
)]
15731578
macro_rules! assert {
15741579
($cond:expr $(,)?) => {{ /* compiler built-in */ }};
15751580
($cond:expr, $($arg:tt)+) => {{ /* compiler built-in */ }};

library/std/src/sys/pal/uefi/thread.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use crate::time::Duration;
77

88
pub struct Thread(!);
99

10-
pub const DEFAULT_MIN_STACK_SIZE: usize = 4096;
10+
pub const DEFAULT_MIN_STACK_SIZE: usize = 64 * 1024;
1111

1212
impl Thread {
1313
// unsafe: see thread::Builder::spawn_unchecked for safety requirements

library/std/src/sys/pal/unsupported/thread.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use crate::time::Duration;
66

77
pub struct Thread(!);
88

9-
pub const DEFAULT_MIN_STACK_SIZE: usize = 4096;
9+
pub const DEFAULT_MIN_STACK_SIZE: usize = 64 * 1024;
1010

1111
impl Thread {
1212
// unsafe: see thread::Builder::spawn_unchecked for safety requirements

library/std/src/sys/pal/wasi/thread.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ cfg_if::cfg_if! {
6666
}
6767
}
6868

69-
pub const DEFAULT_MIN_STACK_SIZE: usize = 4096;
69+
pub const DEFAULT_MIN_STACK_SIZE: usize = 64 * 1024;
7070

7171
impl Thread {
7272
// unsafe: see thread::Builder::spawn_unchecked for safety requirements

library/std/src/sys/pal/wasm/atomics/thread.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use crate::time::Duration;
66

77
pub struct Thread(!);
88

9-
pub const DEFAULT_MIN_STACK_SIZE: usize = 4096;
9+
pub const DEFAULT_MIN_STACK_SIZE: usize = 64 * 1024;
1010

1111
impl Thread {
1212
// unsafe: see thread::Builder::spawn_unchecked for safety requirements

src/bootstrap/src/core/build_steps/format.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,9 @@ fn print_paths(verb: &str, adjective: Option<&str>, paths: &[String]) {
118118

119119
pub fn format(build: &Builder<'_>, check: bool, all: bool, paths: &[PathBuf]) {
120120
if !paths.is_empty() {
121-
eprintln!("fmt error: path arguments are not accepted");
121+
eprintln!(
122+
"fmt error: path arguments are no longer accepted; use `--all` to format everything"
123+
);
122124
crate::exit!(1);
123125
};
124126
if build.config.dry_run() {

src/bootstrap/src/core/build_steps/tool.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -834,7 +834,7 @@ impl Step for LibcxxVersionTool {
834834
let compiler = builder.cxx(self.target).unwrap();
835835
let mut cmd = Command::new(compiler);
836836

837-
let executable = out_dir.join("libcxx-version");
837+
let executable = out_dir.join(exe("libcxx-version", self.target));
838838
cmd.arg("-o").arg(&executable).arg(builder.src.join("src/tools/libcxx-version/main.cpp"));
839839

840840
builder.run_cmd(&mut cmd);

src/ci/github-actions/jobs.yml

+1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ envs:
5858
CACHES_AWS_ACCESS_KEY_ID: AKIA46X5W6CZI5DHEBFL
5959
ARTIFACTS_AWS_ACCESS_KEY_ID: AKIA46X5W6CZN24CBO55
6060
AWS_REGION: us-west-1
61+
TOOLSTATE_PUBLISH: 1
6162

6263
try:
6364
<<: *production

src/ci/publish_toolstate.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ cd rust-toolstate
2424
FAILURE=1
2525
for RETRY_COUNT in 1 2 3 4 5; do
2626
# The purpose of this is to publish the new "current" toolstate in the toolstate repo.
27-
# This happens post-landing, on master.
28-
# (Publishing the per-commit test results happens pre-landing in src/bootstrap/toolstate.rs).
27+
# This happens at the end of auto builds.
28+
# (Publishing the per-commit test results happens in src/bootstrap/toolstate.rs).
2929
"$(ciCheckoutPath)/src/tools/publish_toolstate.py" "$GIT_COMMIT" \
3030
"$GIT_COMMIT_MSG" \
3131
"$MESSAGE_FILE" \

src/doc/rustc/src/platform-support.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ All tier 1 targets with host tools support the full standard library.
3333
target | notes
3434
-------|-------
3535
`aarch64-unknown-linux-gnu` | ARM64 Linux (kernel 4.1, glibc 2.17+)
36-
`i686-pc-windows-gnu` | 32-bit MinGW (Windows 10+) [^x86_32-floats-return-ABI]
37-
`i686-pc-windows-msvc` | 32-bit MSVC (Windows 10+) [^x86_32-floats-return-ABI]
36+
`i686-pc-windows-gnu` | 32-bit MinGW (Windows 10+, Windows Server 2016+) [^x86_32-floats-return-ABI]
37+
`i686-pc-windows-msvc` | 32-bit MSVC (Windows 10+, Windows Server 2016+) [^x86_32-floats-return-ABI]
3838
`i686-unknown-linux-gnu` | 32-bit Linux (kernel 3.2+, glibc 2.17+) [^x86_32-floats-return-ABI]
3939
[`x86_64-apple-darwin`](platform-support/apple-darwin.md) | 64-bit macOS (10.12+, Sierra+)
40-
`x86_64-pc-windows-gnu` | 64-bit MinGW (Windows 10+)
41-
`x86_64-pc-windows-msvc` | 64-bit MSVC (Windows 10+)
40+
`x86_64-pc-windows-gnu` | 64-bit MinGW (Windows 10+, Windows Server 2016+)
41+
`x86_64-pc-windows-msvc` | 64-bit MSVC (Windows 10+, Windows Server 2016+)
4242
`x86_64-unknown-linux-gnu` | 64-bit Linux (kernel 3.2+, glibc 2.17+)
4343

4444
[^x86_32-floats-return-ABI]: Due to limitations of the C ABI, floating-point support on `i686` targets is non-compliant: floating-point return values are passed via an x87 register, so NaN payload bits can be lost. See [issue #114479][x86-32-float-issue].

src/tools/compiletest/src/header.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ pub struct TestProps {
9494
// Extra flags to pass to the compiler
9595
pub compile_flags: Vec<String>,
9696
// Extra flags to pass when the compiled code is run (such as --bench)
97-
pub run_flags: Option<String>,
97+
pub run_flags: Vec<String>,
9898
// If present, the name of a file that this test should match when
9999
// pretty-printed
100100
pub pp_exact: Option<PathBuf>,
@@ -262,7 +262,7 @@ impl TestProps {
262262
error_patterns: vec![],
263263
regex_error_patterns: vec![],
264264
compile_flags: vec![],
265-
run_flags: None,
265+
run_flags: vec![],
266266
pp_exact: None,
267267
aux_builds: vec![],
268268
aux_bins: vec![],
@@ -399,7 +399,9 @@ impl TestProps {
399399

400400
config.parse_and_update_revisions(ln, &mut self.revisions);
401401

402-
config.set_name_value_directive(ln, RUN_FLAGS, &mut self.run_flags, |r| r);
402+
if let Some(flags) = config.parse_name_value_directive(ln, RUN_FLAGS) {
403+
self.run_flags.extend(split_flags(&flags));
404+
}
403405

404406
if self.pp_exact.is_none() {
405407
self.pp_exact = config.parse_pp_exact(ln, testfile);

src/tools/compiletest/src/runtest.rs

+7-4
Original file line numberDiff line numberDiff line change
@@ -2355,7 +2355,7 @@ impl<'test> TestCx<'test> {
23552355
args.push(exe_file.into_os_string());
23562356

23572357
// Add the arguments in the run_flags directive
2358-
args.extend(self.split_maybe_args(&self.props.run_flags));
2358+
args.extend(self.props.run_flags.iter().map(OsString::from));
23592359

23602360
let prog = args.remove(0);
23612361
ProcArgs { prog, args }
@@ -2469,6 +2469,7 @@ impl<'test> TestCx<'test> {
24692469
}
24702470
}
24712471

2472+
#[track_caller]
24722473
fn fatal(&self, err: &str) -> ! {
24732474
self.error(err);
24742475
error!("fatal error, panic: {:?}", err);
@@ -4173,10 +4174,12 @@ impl<'test> TestCx<'test> {
41734174
}
41744175

41754176
fn normalize_output(&self, output: &str, custom_rules: &[(String, String)]) -> String {
4176-
let rflags = self.props.run_flags.as_ref();
4177+
// Crude heuristic to detect when the output should have JSON-specific
4178+
// normalization steps applied.
4179+
let rflags = self.props.run_flags.join(" ");
41774180
let cflags = self.props.compile_flags.join(" ");
4178-
let json = rflags
4179-
.map_or(false, |s| s.contains("--format json") || s.contains("--format=json"))
4181+
let json = rflags.contains("--format json")
4182+
|| rflags.contains("--format=json")
41804183
|| cflags.contains("--error-format json")
41814184
|| cflags.contains("--error-format pretty-json")
41824185
|| cflags.contains("--error-format=json")

src/tools/run-make-support/src/lib.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,12 @@ pub fn python_command() -> Command {
8383

8484
pub fn htmldocck() -> Command {
8585
let mut python = python_command();
86-
python.arg(source_path().join("src/etc/htmldocck.py"));
86+
python.arg(source_root().join("src/etc/htmldocck.py"));
8787
python
8888
}
8989

90-
pub fn source_path() -> PathBuf {
90+
/// Path to the root rust-lang/rust source checkout.
91+
pub fn source_root() -> PathBuf {
9192
env_var("S").into()
9293
}
9394

src/tools/rustdoc-gui-test/src/main.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,7 @@ If you want to install the `browser-ui-test` dependency, run `npm install browse
123123
cargo.env("RUSTDOCFLAGS", test_props.compile_flags.join(" "));
124124
}
125125

126-
if let Some(flags) = &test_props.run_flags {
127-
cargo.arg(flags);
128-
}
126+
cargo.args(&test_props.run_flags);
129127
}
130128

131129
if try_run(&mut cargo, config.verbose).is_err() {

src/tools/tidy/src/allowed_run_make_makefiles.txt

-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@ run-make/lto-readonly-lib/Makefile
135135
run-make/lto-smoke-c/Makefile
136136
run-make/macos-deployment-target/Makefile
137137
run-make/macos-fat-archive/Makefile
138-
run-make/manual-crate-name/Makefile
139138
run-make/manual-link/Makefile
140139
run-make/many-crates-but-no-match/Makefile
141140
run-make/metadata-dep-info/Makefile

tests/codegen/riscv-abi/call-llvm-intrinsics.rs

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

2424
unsafe {
2525
// Ensure that we `call` LLVM intrinsics instead of trying to `invoke` them
26-
// CHECK: store float 4.000000e+00, float* %{{.}}, align 4
26+
// CHECK: store float 4.000000e+00, ptr %{{.}}, align 4
2727
// CHECK: call float @llvm.sqrt.f32(float %{{.}}
2828
sqrt(4.0);
2929
}

tests/codegen/riscv-abi/riscv64-lp64d-abi.rs

+17-8
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
1-
//
2-
//@ compile-flags: -C no-prepopulate-passes
3-
//@ only-riscv64
4-
//@ only-linux
1+
//@ compile-flags: -O -C no-prepopulate-passes --target riscv64gc-unknown-linux-gnu
2+
//@ needs-llvm-components: riscv
3+
4+
#![feature(no_core, lang_items)]
55
#![crate_type = "lib"]
6+
#![no_std]
7+
#![no_core]
8+
9+
#[lang = "sized"]
10+
trait Sized {}
11+
#[lang = "freeze"]
12+
trait Freeze {}
13+
#[lang = "copy"]
14+
trait Copy {}
615

7-
// CHECK: define void @f_fpr_tracking(double %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7, i8 zeroext %i)
16+
// CHECK: define void @f_fpr_tracking(double %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7, i8 noundef zeroext %i)
817
#[no_mangle]
918
pub extern "C" fn f_fpr_tracking(
1019
a: f64,
@@ -144,7 +153,7 @@ pub extern "C" fn f_ret_double_int64_s() -> DoubleInt64 {
144153
DoubleInt64 { f: 1., i: 2 }
145154
}
146155

147-
// CHECK: define void @f_double_int8_s_arg_insufficient_gprs(i32 signext %a, i32 signext %b, i32 signext %c, i32 signext %d, i32 signext %e, i32 signext %f, i32 signext %g, i32 signext %h, [2 x i64] %0)
156+
// CHECK: define void @f_double_int8_s_arg_insufficient_gprs(i32 noundef signext %a, i32 noundef signext %b, i32 noundef signext %c, i32 noundef signext %d, i32 noundef signext %e, i32 noundef signext %f, i32 noundef signext %g, i32 noundef signext %h, [2 x i64] %0)
148157
#[no_mangle]
149158
pub extern "C" fn f_double_int8_s_arg_insufficient_gprs(
150159
a: i32,
@@ -250,11 +259,11 @@ pub struct IntDoubleInt {
250259
c: i32,
251260
}
252261

253-
// CHECK: define void @f_int_double_int_s_arg(%IntDoubleInt* {{.*}}%a)
262+
// CHECK: define void @f_int_double_int_s_arg(ptr {{.*}} %a)
254263
#[no_mangle]
255264
pub extern "C" fn f_int_double_int_s_arg(a: IntDoubleInt) {}
256265

257-
// CHECK: define void @f_ret_int_double_int_s(%IntDoubleInt* {{.*}}sret
266+
// CHECK: define void @f_ret_int_double_int_s(ptr {{.*}} sret([24 x i8]) align 8 dereferenceable(24) %_0)
258267
#[no_mangle]
259268
pub extern "C" fn f_ret_int_double_int_s() -> IntDoubleInt {
260269
IntDoubleInt { a: 1, b: 2., c: 3 }

tests/codegen/riscv-abi/riscv64-lp64f-lp64d-abi.rs

+15-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
1-
//
2-
//@ compile-flags: -C no-prepopulate-passes
3-
//@ only-riscv64
4-
//@ only-linux
1+
//@ compile-flags: -O -C no-prepopulate-passes --target riscv64gc-unknown-linux-gnu
2+
//@ needs-llvm-components: riscv
3+
4+
#![feature(no_core, lang_items)]
55
#![crate_type = "lib"]
6+
#![no_std]
7+
#![no_core]
8+
9+
#[lang = "sized"]
10+
trait Sized {}
11+
#[lang = "freeze"]
12+
trait Freeze {}
13+
#[lang = "copy"]
14+
trait Copy {}
615

7-
// CHECK: define void @f_fpr_tracking(float %0, float %1, float %2, float %3, float %4, float %5, float %6, float %7, i8 zeroext %i)
16+
// CHECK: define void @f_fpr_tracking(float %0, float %1, float %2, float %3, float %4, float %5, float %6, float %7, i8 noundef zeroext %i)
817
#[no_mangle]
918
pub extern "C" fn f_fpr_tracking(
1019
a: f32,
@@ -128,7 +137,7 @@ pub extern "C" fn f_ret_float_int64_s() -> FloatInt64 {
128137
FloatInt64 { f: 1., i: 2 }
129138
}
130139

131-
// CHECK: define void @f_float_int8_s_arg_insufficient_gprs(i32 signext %a, i32 signext %b, i32 signext %c, i32 signext %d, i32 signext %e, i32 signext %f, i32 signext %g, i32 signext %h, i64 %0)
140+
// CHECK: define void @f_float_int8_s_arg_insufficient_gprs(i32 noundef signext %a, i32 noundef signext %b, i32 noundef signext %c, i32 noundef signext %d, i32 noundef signext %e, i32 noundef signext %f, i32 noundef signext %g, i32 noundef signext %h, i64 %0)
132141
#[no_mangle]
133142
pub extern "C" fn f_float_int8_s_arg_insufficient_gprs(
134143
a: i32,

0 commit comments

Comments
 (0)