Skip to content

Commit

Permalink
Auto merge of rust-lang#126104 - workingjubilee:rollup-t1ac2ld, r=wor…
Browse files Browse the repository at this point in the history
…kingjubilee

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
  • Loading branch information
bors committed Jun 6, 2024
2 parents 98489f2 + efd8959 commit 76e7a08
Show file tree
Hide file tree
Showing 36 changed files with 121 additions and 91 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ concurrency:
cancel-in-progress: true
env:
TOOLSTATE_REPO: "https://github.com/rust-lang-nursery/rust-toolstate"
# This will be empty in PR jobs.
TOOLSTATE_REPO_ACCESS_TOKEN: ${{ secrets.TOOLSTATE_REPO_ACCESS_TOKEN }}
jobs:
# The job matrix for `calculate_matrix` is defined in src/ci/github-actions/jobs.yml.
# It calculates which jobs should be executed, based on the data of the ${{ github }} context.
Expand Down Expand Up @@ -242,6 +244,5 @@ jobs:
shell: bash
if: needs.calculate_matrix.outputs.run_type == 'auto'
env:
TOOLSTATE_REPO_ACCESS_TOKEN: ${{ secrets.TOOLSTATE_REPO_ACCESS_TOKEN }}
TOOLSTATE_ISSUES_API_URL: https://api.github.com/repos/rust-lang/rust/issues
TOOLSTATE_PUBLISH: 1
1 change: 0 additions & 1 deletion compiler/rustc_builtin_macros/src/assert/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ impl<'cx, 'a> Context<'cx, 'a> {
/// Builds the whole `assert!` expression. For example, `let elem = 1; assert!(elem == 1);` expands to:
///
/// ```rust
/// #![feature(generic_assert_internals)]
/// let elem = 1;
/// {
/// #[allow(unused_imports)]
Expand Down
21 changes: 19 additions & 2 deletions compiler/rustc_macros/src/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,17 @@ pub fn rustc_queries(input: TokenStream) -> TokenStream {
let mut query_description_stream = quote! {};
let mut query_cached_stream = quote! {};
let mut feedable_queries = quote! {};
let mut errors = quote! {};

macro_rules! assert {
( $cond:expr, $span:expr, $( $tt:tt )+ ) => {
if !$cond {
errors.extend(
Error::new($span, format!($($tt)+)).into_compile_error(),
);
}
}
}

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

if modifiers.feedable.is_some() {
assert!(modifiers.anon.is_none(), "Query {name} cannot be both `feedable` and `anon`.");
if let Some(feedable) = &modifiers.feedable {
assert!(
modifiers.anon.is_none(),
feedable.span(),
"Query {name} cannot be both `feedable` and `anon`."
);
assert!(
modifiers.eval_always.is_none(),
feedable.span(),
"Query {name} cannot be both `feedable` and `eval_always`."
);
feedable_queries.extend(quote! {
Expand Down Expand Up @@ -407,5 +423,6 @@ pub fn rustc_queries(input: TokenStream) -> TokenStream {
use super::*;
#query_cached_stream
}
#errors
})
}
3 changes: 1 addition & 2 deletions compiler/rustc_query_system/src/dep_graph/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ pub struct MarkFrame<'a> {
parent: Option<&'a MarkFrame<'a>>,
}

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

/// Returns true if the given node has been marked as green during the
Expand Down
7 changes: 6 additions & 1 deletion library/core/src/macros/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1569,7 +1569,12 @@ pub(crate) mod builtin {
#[rustc_builtin_macro]
#[macro_export]
#[rustc_diagnostic_item = "assert_macro"]
#[allow_internal_unstable(panic_internals, edition_panic, generic_assert_internals)]
#[allow_internal_unstable(
core_intrinsics,
panic_internals,
edition_panic,
generic_assert_internals
)]
macro_rules! assert {
($cond:expr $(,)?) => {{ /* compiler built-in */ }};
($cond:expr, $($arg:tt)+) => {{ /* compiler built-in */ }};
Expand Down
2 changes: 1 addition & 1 deletion library/std/src/sys/pal/uefi/thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use crate::time::Duration;

pub struct Thread(!);

pub const DEFAULT_MIN_STACK_SIZE: usize = 4096;
pub const DEFAULT_MIN_STACK_SIZE: usize = 64 * 1024;

impl Thread {
// unsafe: see thread::Builder::spawn_unchecked for safety requirements
Expand Down
2 changes: 1 addition & 1 deletion library/std/src/sys/pal/unsupported/thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use crate::time::Duration;

pub struct Thread(!);

pub const DEFAULT_MIN_STACK_SIZE: usize = 4096;
pub const DEFAULT_MIN_STACK_SIZE: usize = 64 * 1024;

impl Thread {
// unsafe: see thread::Builder::spawn_unchecked for safety requirements
Expand Down
2 changes: 1 addition & 1 deletion library/std/src/sys/pal/wasi/thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ cfg_if::cfg_if! {
}
}

pub const DEFAULT_MIN_STACK_SIZE: usize = 4096;
pub const DEFAULT_MIN_STACK_SIZE: usize = 64 * 1024;

impl Thread {
// unsafe: see thread::Builder::spawn_unchecked for safety requirements
Expand Down
2 changes: 1 addition & 1 deletion library/std/src/sys/pal/wasm/atomics/thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use crate::time::Duration;

pub struct Thread(!);

pub const DEFAULT_MIN_STACK_SIZE: usize = 4096;
pub const DEFAULT_MIN_STACK_SIZE: usize = 64 * 1024;

impl Thread {
// unsafe: see thread::Builder::spawn_unchecked for safety requirements
Expand Down
4 changes: 3 additions & 1 deletion src/bootstrap/src/core/build_steps/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@ fn print_paths(verb: &str, adjective: Option<&str>, paths: &[String]) {

pub fn format(build: &Builder<'_>, check: bool, all: bool, paths: &[PathBuf]) {
if !paths.is_empty() {
eprintln!("fmt error: path arguments are not accepted");
eprintln!(
"fmt error: path arguments are no longer accepted; use `--all` to format everything"
);
crate::exit!(1);
};
if build.config.dry_run() {
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/src/core/build_steps/tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -834,7 +834,7 @@ impl Step for LibcxxVersionTool {
let compiler = builder.cxx(self.target).unwrap();
let mut cmd = Command::new(compiler);

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

builder.run_cmd(&mut cmd);
Expand Down
1 change: 1 addition & 0 deletions src/ci/github-actions/jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ envs:
CACHES_AWS_ACCESS_KEY_ID: AKIA46X5W6CZI5DHEBFL
ARTIFACTS_AWS_ACCESS_KEY_ID: AKIA46X5W6CZN24CBO55
AWS_REGION: us-west-1
TOOLSTATE_PUBLISH: 1

try:
<<: *production
Expand Down
4 changes: 2 additions & 2 deletions src/ci/publish_toolstate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ cd rust-toolstate
FAILURE=1
for RETRY_COUNT in 1 2 3 4 5; do
# The purpose of this is to publish the new "current" toolstate in the toolstate repo.
# This happens post-landing, on master.
# (Publishing the per-commit test results happens pre-landing in src/bootstrap/toolstate.rs).
# This happens at the end of auto builds.
# (Publishing the per-commit test results happens in src/bootstrap/toolstate.rs).
"$(ciCheckoutPath)/src/tools/publish_toolstate.py" "$GIT_COMMIT" \
"$GIT_COMMIT_MSG" \
"$MESSAGE_FILE" \
Expand Down
8 changes: 4 additions & 4 deletions src/doc/rustc/src/platform-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ All tier 1 targets with host tools support the full standard library.
target | notes
-------|-------
`aarch64-unknown-linux-gnu` | ARM64 Linux (kernel 4.1, glibc 2.17+)
`i686-pc-windows-gnu` | 32-bit MinGW (Windows 10+) [^x86_32-floats-return-ABI]
`i686-pc-windows-msvc` | 32-bit MSVC (Windows 10+) [^x86_32-floats-return-ABI]
`i686-pc-windows-gnu` | 32-bit MinGW (Windows 10+, Windows Server 2016+) [^x86_32-floats-return-ABI]
`i686-pc-windows-msvc` | 32-bit MSVC (Windows 10+, Windows Server 2016+) [^x86_32-floats-return-ABI]
`i686-unknown-linux-gnu` | 32-bit Linux (kernel 3.2+, glibc 2.17+) [^x86_32-floats-return-ABI]
[`x86_64-apple-darwin`](platform-support/apple-darwin.md) | 64-bit macOS (10.12+, Sierra+)
`x86_64-pc-windows-gnu` | 64-bit MinGW (Windows 10+)
`x86_64-pc-windows-msvc` | 64-bit MSVC (Windows 10+)
`x86_64-pc-windows-gnu` | 64-bit MinGW (Windows 10+, Windows Server 2016+)
`x86_64-pc-windows-msvc` | 64-bit MSVC (Windows 10+, Windows Server 2016+)
`x86_64-unknown-linux-gnu` | 64-bit Linux (kernel 3.2+, glibc 2.17+)

[^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].
Expand Down
8 changes: 5 additions & 3 deletions src/tools/compiletest/src/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ pub struct TestProps {
// Extra flags to pass to the compiler
pub compile_flags: Vec<String>,
// Extra flags to pass when the compiled code is run (such as --bench)
pub run_flags: Option<String>,
pub run_flags: Vec<String>,
// If present, the name of a file that this test should match when
// pretty-printed
pub pp_exact: Option<PathBuf>,
Expand Down Expand Up @@ -262,7 +262,7 @@ impl TestProps {
error_patterns: vec![],
regex_error_patterns: vec![],
compile_flags: vec![],
run_flags: None,
run_flags: vec![],
pp_exact: None,
aux_builds: vec![],
aux_bins: vec![],
Expand Down Expand Up @@ -399,7 +399,9 @@ impl TestProps {

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

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

if self.pp_exact.is_none() {
self.pp_exact = config.parse_pp_exact(ln, testfile);
Expand Down
11 changes: 7 additions & 4 deletions src/tools/compiletest/src/runtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2355,7 +2355,7 @@ impl<'test> TestCx<'test> {
args.push(exe_file.into_os_string());

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

let prog = args.remove(0);
ProcArgs { prog, args }
Expand Down Expand Up @@ -2469,6 +2469,7 @@ impl<'test> TestCx<'test> {
}
}

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

fn normalize_output(&self, output: &str, custom_rules: &[(String, String)]) -> String {
let rflags = self.props.run_flags.as_ref();
// Crude heuristic to detect when the output should have JSON-specific
// normalization steps applied.
let rflags = self.props.run_flags.join(" ");
let cflags = self.props.compile_flags.join(" ");
let json = rflags
.map_or(false, |s| s.contains("--format json") || s.contains("--format=json"))
let json = rflags.contains("--format json")
|| rflags.contains("--format=json")
|| cflags.contains("--error-format json")
|| cflags.contains("--error-format pretty-json")
|| cflags.contains("--error-format=json")
Expand Down
5 changes: 3 additions & 2 deletions src/tools/run-make-support/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,12 @@ pub fn python_command() -> Command {

pub fn htmldocck() -> Command {
let mut python = python_command();
python.arg(source_path().join("src/etc/htmldocck.py"));
python.arg(source_root().join("src/etc/htmldocck.py"));
python
}

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

Expand Down
4 changes: 1 addition & 3 deletions src/tools/rustdoc-gui-test/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,7 @@ If you want to install the `browser-ui-test` dependency, run `npm install browse
cargo.env("RUSTDOCFLAGS", test_props.compile_flags.join(" "));
}

if let Some(flags) = &test_props.run_flags {
cargo.arg(flags);
}
cargo.args(&test_props.run_flags);
}

if try_run(&mut cargo, config.verbose).is_err() {
Expand Down
1 change: 0 additions & 1 deletion src/tools/tidy/src/allowed_run_make_makefiles.txt
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ run-make/lto-readonly-lib/Makefile
run-make/lto-smoke-c/Makefile
run-make/macos-deployment-target/Makefile
run-make/macos-fat-archive/Makefile
run-make/manual-crate-name/Makefile
run-make/manual-link/Makefile
run-make/many-crates-but-no-match/Makefile
run-make/metadata-dep-info/Makefile
Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/riscv-abi/call-llvm-intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub fn do_call() {

unsafe {
// Ensure that we `call` LLVM intrinsics instead of trying to `invoke` them
// CHECK: store float 4.000000e+00, float* %{{.}}, align 4
// CHECK: store float 4.000000e+00, ptr %{{.}}, align 4
// CHECK: call float @llvm.sqrt.f32(float %{{.}}
sqrt(4.0);
}
Expand Down
25 changes: 17 additions & 8 deletions tests/codegen/riscv-abi/riscv64-lp64d-abi.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
//
//@ compile-flags: -C no-prepopulate-passes
//@ only-riscv64
//@ only-linux
//@ compile-flags: -O -C no-prepopulate-passes --target riscv64gc-unknown-linux-gnu
//@ needs-llvm-components: riscv

#![feature(no_core, lang_items)]
#![crate_type = "lib"]
#![no_std]
#![no_core]

#[lang = "sized"]
trait Sized {}
#[lang = "freeze"]
trait Freeze {}
#[lang = "copy"]
trait Copy {}

// 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)
// 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)
#[no_mangle]
pub extern "C" fn f_fpr_tracking(
a: f64,
Expand Down Expand Up @@ -144,7 +153,7 @@ pub extern "C" fn f_ret_double_int64_s() -> DoubleInt64 {
DoubleInt64 { f: 1., i: 2 }
}

// 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)
// 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)
#[no_mangle]
pub extern "C" fn f_double_int8_s_arg_insufficient_gprs(
a: i32,
Expand Down Expand Up @@ -250,11 +259,11 @@ pub struct IntDoubleInt {
c: i32,
}

// CHECK: define void @f_int_double_int_s_arg(%IntDoubleInt* {{.*}}%a)
// CHECK: define void @f_int_double_int_s_arg(ptr {{.*}} %a)
#[no_mangle]
pub extern "C" fn f_int_double_int_s_arg(a: IntDoubleInt) {}

// CHECK: define void @f_ret_int_double_int_s(%IntDoubleInt* {{.*}}sret
// CHECK: define void @f_ret_int_double_int_s(ptr {{.*}} sret([24 x i8]) align 8 dereferenceable(24) %_0)
#[no_mangle]
pub extern "C" fn f_ret_int_double_int_s() -> IntDoubleInt {
IntDoubleInt { a: 1, b: 2., c: 3 }
Expand Down
21 changes: 15 additions & 6 deletions tests/codegen/riscv-abi/riscv64-lp64f-lp64d-abi.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
//
//@ compile-flags: -C no-prepopulate-passes
//@ only-riscv64
//@ only-linux
//@ compile-flags: -O -C no-prepopulate-passes --target riscv64gc-unknown-linux-gnu
//@ needs-llvm-components: riscv

#![feature(no_core, lang_items)]
#![crate_type = "lib"]
#![no_std]
#![no_core]

#[lang = "sized"]
trait Sized {}
#[lang = "freeze"]
trait Freeze {}
#[lang = "copy"]
trait Copy {}

// 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)
// 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)
#[no_mangle]
pub extern "C" fn f_fpr_tracking(
a: f32,
Expand Down Expand Up @@ -128,7 +137,7 @@ pub extern "C" fn f_ret_float_int64_s() -> FloatInt64 {
FloatInt64 { f: 1., i: 2 }
}

// 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)
// 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)
#[no_mangle]
pub extern "C" fn f_float_int8_s_arg_insufficient_gprs(
a: i32,
Expand Down
Loading

0 comments on commit 76e7a08

Please sign in to comment.