Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 12 pull requests #126104

Merged
merged 24 commits into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
2fe41c6
Fix publishing of toolstate history
Kobzol Jun 5, 2024
cdccf52
Clarify our tier 1 Windows Server support
ChrisDenton Jun 5, 2024
ae4ae16
Repair several riscv64gc-unknown-linux-gnu codegen tests
Hoverbear May 16, 2024
3f892f8
Clarify an `x fmt` error.
nnethercote Jun 5, 2024
8781074
Raise `DEFAULT_MIN_STACK_SIZE` to at least 64KiB
workingjubilee Jun 6, 2024
7ad5ebc
Migrate `run-make/manual-crate-name` to `rmake.rs`
GuillaumeGomez Jun 6, 2024
c7ced1b
Make the panic info more useful
oli-obk Sep 6, 2023
dc91ad0
Port `tests/run-make-fulldeps/obtain-borrowck` to ui-fulldeps
Zalathar Jun 5, 2024
2692d44
compiletest: Allow multiple `//@ run-flags:` headers
Zalathar Jun 5, 2024
9c46479
use windows compatible executable name for libcxx-version
onur-ozkan Jun 6, 2024
6e1121b
Do not use relative paths to Rust source root in run-make tests
Kobzol Jun 6, 2024
a8084dc
[RFC-2011] Allow `core_intrinsics` when activated
c410-f3r Jun 6, 2024
aa4cffc
Rollup merge of #125220 - ferrocene:hoverbear/repair-riscv64-codegen-…
workingjubilee Jun 6, 2024
835ceea
Rollup merge of #126033 - Kobzol:fix-toolstate-history, r=ehuss
workingjubilee Jun 6, 2024
14d9a3e
Rollup merge of #126034 - ChrisDenton:winsupport, r=ehuss
workingjubilee Jun 6, 2024
a1baa7b
Rollup merge of #126035 - oli-obk:query_macro_errors, r=fmease
workingjubilee Jun 6, 2024
f739fef
Rollup merge of #126051 - nnethercote:clarify-x-fmt-error, r=Nilstrieb
workingjubilee Jun 6, 2024
68c57de
Rollup merge of #126059 - workingjubilee:stack-nothing-higher, r=Chri…
workingjubilee Jun 6, 2024
2c1e71b
Rollup merge of #126064 - GuillaumeGomez:migrate-run-make-manual-crat…
workingjubilee Jun 6, 2024
f4016e2
Rollup merge of #126072 - Zalathar:run-flags, r=jieyouxu
workingjubilee Jun 6, 2024
30bb51f
Rollup merge of #126073 - Zalathar:fulldeps-borrowck, r=jieyouxu
workingjubilee Jun 6, 2024
af229f5
Rollup merge of #126081 - Kobzol:run-make-relative-paths, r=jieyouxu
workingjubilee Jun 6, 2024
7e81738
Rollup merge of #126086 - onur-ozkan:use-exe, r=petrochenkov
workingjubilee Jun 6, 2024
efd8959
Rollup merge of #126096 - c410-f3r:tests-tests-tests, r=jhpratt
workingjubilee Jun 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading