Auto merge of #83890 - Dylan-DPC:rollup-9fqy3fe, r=Dylan-DPC
Rollup of 5 pull requests Successful merges: - #83368 (Add `download-rustc = "if-unchanged"`) - #83705 (Give a better error when --theme is not a CSS file) - #83853 (Disallow the use of high byte registes as operands on x86_64) - #83877 (Remove unnecessary exceptions to the platform-specific code check) - #83878 (Fix racing file access in tidy) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
This commit is contained in:
commit
5a7a0ac51e
|
@ -68,7 +68,6 @@ fn frame_pointer_r11(
|
|||
_arch: InlineAsmArch,
|
||||
has_feature: impl FnMut(&str) -> bool,
|
||||
target: &Target,
|
||||
_allocating: bool,
|
||||
) -> Result<(), &'static str> {
|
||||
if !frame_pointer_is_r7(has_feature, target) {
|
||||
Err("the frame pointer (r11) cannot be used as an operand for inline asm")
|
||||
|
@ -81,7 +80,6 @@ fn frame_pointer_r7(
|
|||
_arch: InlineAsmArch,
|
||||
has_feature: impl FnMut(&str) -> bool,
|
||||
target: &Target,
|
||||
_allocating: bool,
|
||||
) -> Result<(), &'static str> {
|
||||
if frame_pointer_is_r7(has_feature, target) {
|
||||
Err("the frame pointer (r7) cannot be used as an operand for inline asm")
|
||||
|
|
|
@ -90,7 +90,7 @@ macro_rules! def_regs {
|
|||
match name {
|
||||
$(
|
||||
$($alias)|* | $reg_name => {
|
||||
$($filter(_arch, &mut _has_feature, _target, false)?;)?
|
||||
$($filter(_arch, &mut _has_feature, _target)?;)?
|
||||
Ok(Self::$reg)
|
||||
}
|
||||
)*
|
||||
|
@ -114,7 +114,7 @@ macro_rules! def_regs {
|
|||
#[allow(unused_imports)]
|
||||
use super::{InlineAsmReg, InlineAsmRegClass};
|
||||
$(
|
||||
if $($filter(_arch, &mut _has_feature, _target, true).is_ok() &&)? true {
|
||||
if $($filter(_arch, &mut _has_feature, _target).is_ok() &&)? true {
|
||||
if let Some(set) = _map.get_mut(&InlineAsmRegClass::$arch($arch_regclass::$class)) {
|
||||
set.insert(InlineAsmReg::$arch($arch_reg::$reg));
|
||||
}
|
||||
|
|
|
@ -52,7 +52,6 @@ fn not_e(
|
|||
_arch: InlineAsmArch,
|
||||
mut has_feature: impl FnMut(&str) -> bool,
|
||||
_target: &Target,
|
||||
_allocating: bool,
|
||||
) -> Result<(), &'static str> {
|
||||
if has_feature("e") {
|
||||
Err("register can't be used with the `e` target feature")
|
||||
|
|
|
@ -133,7 +133,6 @@ fn x86_64_only(
|
|||
arch: InlineAsmArch,
|
||||
_has_feature: impl FnMut(&str) -> bool,
|
||||
_target: &Target,
|
||||
_allocating: bool,
|
||||
) -> Result<(), &'static str> {
|
||||
match arch {
|
||||
InlineAsmArch::X86 => Err("register is only available on x86_64"),
|
||||
|
@ -146,13 +145,9 @@ fn high_byte(
|
|||
arch: InlineAsmArch,
|
||||
_has_feature: impl FnMut(&str) -> bool,
|
||||
_target: &Target,
|
||||
allocating: bool,
|
||||
) -> Result<(), &'static str> {
|
||||
match arch {
|
||||
InlineAsmArch::X86_64 if allocating => {
|
||||
// The error message isn't actually used...
|
||||
Err("high byte registers are not allocated by reg_byte")
|
||||
}
|
||||
InlineAsmArch::X86_64 => Err("high byte registers cannot be used as an operand on x86_64"),
|
||||
_ => Ok(()),
|
||||
}
|
||||
}
|
||||
|
|
|
@ -373,7 +373,9 @@ changelog-seen = 2
|
|||
# Whether to download the stage 1 and 2 compilers from CI.
|
||||
# This is mostly useful for tools; if you have changes to `compiler/` they will be ignored.
|
||||
#
|
||||
# FIXME: currently, this also uses the downloaded compiler for stage0, but that causes unnecessary rebuilds.
|
||||
# You can set this to "if-unchanged" to only download if `compiler/` has not been modified.
|
||||
#
|
||||
# FIXME(#82739): currently, this also uses the downloaded compiler for stage0, but that causes unnecessary rebuilds.
|
||||
#download-rustc = false
|
||||
|
||||
# Number of codegen units to use for each compiler invocation. A value of 0
|
||||
|
|
|
@ -644,8 +644,10 @@ class RustBuild(object):
|
|||
# If `download-rustc` is set, download the most recent commit with CI artifacts
|
||||
def maybe_download_ci_toolchain(self):
|
||||
# If `download-rustc` is not set, default to rebuilding.
|
||||
if self.get_toml("download-rustc", section="rust") != "true":
|
||||
download_rustc = self.get_toml("download-rustc", section="rust")
|
||||
if download_rustc is None or download_rustc == "false":
|
||||
return None
|
||||
assert download_rustc == "true" or download_rustc == "if-unchanged", download_rustc
|
||||
|
||||
# Handle running from a directory other than the top level
|
||||
rev_parse = ["git", "rev-parse", "--show-toplevel"]
|
||||
|
@ -660,6 +662,8 @@ class RustBuild(object):
|
|||
# Warn if there were changes to the compiler since the ancestor commit.
|
||||
status = subprocess.call(["git", "diff-index", "--quiet", commit, "--", compiler])
|
||||
if status != 0:
|
||||
if download_rustc == "if-unchanged":
|
||||
return None
|
||||
print("warning: `download-rustc` is enabled, but there are changes to compiler/")
|
||||
|
||||
if self.verbose:
|
||||
|
@ -1175,6 +1179,8 @@ def bootstrap(help_triggered):
|
|||
env["RUSTC_BOOTSTRAP"] = '1'
|
||||
if toml_path:
|
||||
env["BOOTSTRAP_CONFIG"] = toml_path
|
||||
if build.rustc_commit is not None:
|
||||
env["BOOTSTRAP_DOWNLOAD_RUSTC"] = '1'
|
||||
run(args, env=env, verbose=build.verbose)
|
||||
|
||||
|
||||
|
|
|
@ -510,7 +510,8 @@ struct Rust {
|
|||
new_symbol_mangling: Option<bool>,
|
||||
profile_generate: Option<String>,
|
||||
profile_use: Option<String>,
|
||||
download_rustc: Option<bool>,
|
||||
// ignored; this is set from an env var set by bootstrap.py
|
||||
download_rustc: Option<StringOrBool>,
|
||||
}
|
||||
|
||||
/// TOML representation of how each build target is configured.
|
||||
|
@ -852,7 +853,7 @@ impl Config {
|
|||
config.rust_codegen_units_std = rust.codegen_units_std.map(threads_from_config);
|
||||
config.rust_profile_use = flags.rust_profile_use.or(rust.profile_use);
|
||||
config.rust_profile_generate = flags.rust_profile_generate.or(rust.profile_generate);
|
||||
config.download_rustc = rust.download_rustc.unwrap_or(false);
|
||||
config.download_rustc = env::var("BOOTSTRAP_DOWNLOAD_RUSTC").as_deref() == Ok("1");
|
||||
} else {
|
||||
config.rust_profile_use = flags.rust_profile_use;
|
||||
config.rust_profile_generate = flags.rust_profile_generate;
|
||||
|
|
|
@ -501,7 +501,7 @@ Here is the list of currently supported register classes:
|
|||
| x86 | `reg` | `ax`, `bx`, `cx`, `dx`, `si`, `di`, `r[8-15]` (x86-64 only) | `r` |
|
||||
| x86 | `reg_abcd` | `ax`, `bx`, `cx`, `dx` | `Q` |
|
||||
| x86-32 | `reg_byte` | `al`, `bl`, `cl`, `dl`, `ah`, `bh`, `ch`, `dh` | `q` |
|
||||
| x86-64 | `reg_byte` | `al`, `bl`, `cl`, `dl`, `sil`, `dil`, `r[8-15]b`, `ah`\*, `bh`\*, `ch`\*, `dh`\* | `q` |
|
||||
| x86-64 | `reg_byte`\* | `al`, `bl`, `cl`, `dl`, `sil`, `dil`, `r[8-15]b` | `q` |
|
||||
| x86 | `xmm_reg` | `xmm[0-7]` (x86) `xmm[0-15]` (x86-64) | `x` |
|
||||
| x86 | `ymm_reg` | `ymm[0-7]` (x86) `ymm[0-15]` (x86-64) | `x` |
|
||||
| x86 | `zmm_reg` | `zmm[0-7]` (x86) `zmm[0-31]` (x86-64) | `v` |
|
||||
|
@ -532,7 +532,7 @@ Here is the list of currently supported register classes:
|
|||
|
||||
> **Note**: On x86 we treat `reg_byte` differently from `reg` because the compiler can allocate `al` and `ah` separately whereas `reg` reserves the whole register.
|
||||
>
|
||||
> Note #2: On x86-64 the high byte registers (e.g. `ah`) are only available when used as an explicit register. Specifying the `reg_byte` register class for an operand will always allocate a low byte register.
|
||||
> Note #2: On x86-64 the high byte registers (e.g. `ah`) are not available in the `reg_byte` register class.
|
||||
>
|
||||
> Note #3: NVPTX doesn't have a fixed register set, so named registers are not supported.
|
||||
>
|
||||
|
|
|
@ -484,7 +484,9 @@ impl Options {
|
|||
return Err(1);
|
||||
}
|
||||
if theme_file.extension() != Some(OsStr::new("css")) {
|
||||
diag.struct_err(&format!("invalid argument: \"{}\"", theme_s)).emit();
|
||||
diag.struct_err(&format!("invalid argument: \"{}\"", theme_s))
|
||||
.help("arguments to --theme must have a .css extension")
|
||||
.emit();
|
||||
return Err(1);
|
||||
}
|
||||
let (success, ret) = theme::test_theme_against(&theme_file, &paths, &diag);
|
||||
|
|
|
@ -748,10 +748,11 @@ check_reg!(eax_f64 f64 "eax" "mov");
|
|||
// CHECK: #NO_APP
|
||||
check_reg!(eax_ptr ptr "eax" "mov");
|
||||
|
||||
// CHECK-LABEL: ah_byte:
|
||||
// CHECK: #APP
|
||||
// CHECK: mov ah, ah
|
||||
// CHECK: #NO_APP
|
||||
// i686-LABEL: ah_byte:
|
||||
// i686: #APP
|
||||
// i686: mov ah, ah
|
||||
// i686: #NO_APP
|
||||
#[cfg(i686)]
|
||||
check_reg!(ah_byte i8 "ah" "mov");
|
||||
|
||||
// CHECK-LABEL: xmm0_i32:
|
||||
|
|
3
src/test/rustdoc-ui/invalid-theme-name.rs
Normal file
3
src/test/rustdoc-ui/invalid-theme-name.rs
Normal file
|
@ -0,0 +1,3 @@
|
|||
// compile-flags:--theme {{src-base}}/invalid-theme-name.rs
|
||||
// error-pattern: invalid argument
|
||||
// error-pattern: must have a .css extension
|
4
src/test/rustdoc-ui/invalid-theme-name.stderr
Normal file
4
src/test/rustdoc-ui/invalid-theme-name.stderr
Normal file
|
@ -0,0 +1,4 @@
|
|||
error: invalid argument: "$DIR/invalid-theme-name.rs"
|
||||
|
|
||||
= help: arguments to --theme must have a .css extension
|
||||
|
|
@ -37,6 +37,8 @@ fn main() {
|
|||
//~^ ERROR invalid register `mm0`: MMX registers are not currently supported as operands
|
||||
asm!("", in("k0") foo);
|
||||
//~^ ERROR invalid register `k0`: the k0 AVX mask register cannot be used as an operand
|
||||
asm!("", in("ah") foo);
|
||||
//~^ ERROR invalid register `ah`: high byte registers cannot be used as an operand
|
||||
|
||||
// Explicit register conflicts
|
||||
// (except in/lateout which don't conflict)
|
||||
|
|
|
@ -94,8 +94,14 @@ error: invalid register `k0`: the k0 AVX mask register cannot be used as an oper
|
|||
LL | asm!("", in("k0") foo);
|
||||
| ^^^^^^^^^^^^
|
||||
|
||||
error: invalid register `ah`: high byte registers cannot be used as an operand on x86_64
|
||||
--> $DIR/bad-reg.rs:40:18
|
||||
|
|
||||
LL | asm!("", in("ah") foo);
|
||||
| ^^^^^^^^^^^^
|
||||
|
||||
error: register `al` conflicts with register `ax`
|
||||
--> $DIR/bad-reg.rs:44:33
|
||||
--> $DIR/bad-reg.rs:46:33
|
||||
|
|
||||
LL | asm!("", in("eax") foo, in("al") bar);
|
||||
| ------------- ^^^^^^^^^^^^ register `al`
|
||||
|
@ -103,7 +109,7 @@ LL | asm!("", in("eax") foo, in("al") bar);
|
|||
| register `ax`
|
||||
|
||||
error: register `ax` conflicts with register `ax`
|
||||
--> $DIR/bad-reg.rs:46:33
|
||||
--> $DIR/bad-reg.rs:48:33
|
||||
|
|
||||
LL | asm!("", in("rax") foo, out("rax") bar);
|
||||
| ------------- ^^^^^^^^^^^^^^ register `ax`
|
||||
|
@ -111,13 +117,13 @@ LL | asm!("", in("rax") foo, out("rax") bar);
|
|||
| register `ax`
|
||||
|
|
||||
help: use `lateout` instead of `out` to avoid conflict
|
||||
--> $DIR/bad-reg.rs:46:18
|
||||
--> $DIR/bad-reg.rs:48:18
|
||||
|
|
||||
LL | asm!("", in("rax") foo, out("rax") bar);
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: register `ymm0` conflicts with register `xmm0`
|
||||
--> $DIR/bad-reg.rs:49:34
|
||||
--> $DIR/bad-reg.rs:51:34
|
||||
|
|
||||
LL | asm!("", in("xmm0") foo, in("ymm0") bar);
|
||||
| -------------- ^^^^^^^^^^^^^^ register `ymm0`
|
||||
|
@ -125,7 +131,7 @@ LL | asm!("", in("xmm0") foo, in("ymm0") bar);
|
|||
| register `xmm0`
|
||||
|
||||
error: register `ymm0` conflicts with register `xmm0`
|
||||
--> $DIR/bad-reg.rs:51:34
|
||||
--> $DIR/bad-reg.rs:53:34
|
||||
|
|
||||
LL | asm!("", in("xmm0") foo, out("ymm0") bar);
|
||||
| -------------- ^^^^^^^^^^^^^^^ register `ymm0`
|
||||
|
@ -133,10 +139,10 @@ LL | asm!("", in("xmm0") foo, out("ymm0") bar);
|
|||
| register `xmm0`
|
||||
|
|
||||
help: use `lateout` instead of `out` to avoid conflict
|
||||
--> $DIR/bad-reg.rs:51:18
|
||||
--> $DIR/bad-reg.rs:53:18
|
||||
|
|
||||
LL | asm!("", in("xmm0") foo, out("ymm0") bar);
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 18 previous errors
|
||||
error: aborting due to 19 previous errors
|
||||
|
||||
|
|
|
@ -1909,8 +1909,7 @@ impl<'test> TestCx<'test> {
|
|||
} else {
|
||||
Command::new(&self.config.rustdoc_path.clone().expect("no rustdoc built yet"))
|
||||
};
|
||||
// FIXME Why is -L here?
|
||||
rustc.arg(input_file); //.arg("-L").arg(&self.config.build_base);
|
||||
rustc.arg(input_file);
|
||||
|
||||
// Use a single thread for efficiency and a deterministic error message order
|
||||
rustc.arg("-Zthreads=1");
|
||||
|
|
|
@ -53,6 +53,7 @@ pub mod unstable_book;
|
|||
|
||||
fn filter_dirs(path: &Path) -> bool {
|
||||
let skip = [
|
||||
"tidy-test-file",
|
||||
"compiler/rustc_codegen_cranelift",
|
||||
"src/llvm-project",
|
||||
"library/backtrace",
|
||||
|
|
|
@ -40,35 +40,20 @@ const EXCEPTION_PATHS: &[&str] = &[
|
|||
"library/panic_abort",
|
||||
"library/panic_unwind",
|
||||
"library/unwind",
|
||||
// black_box implementation is LLVM-version specific and it uses
|
||||
// target_os to tell targets with different LLVM-versions apart
|
||||
// (e.g. `wasm32-unknown-emscripten` vs `wasm32-unknown-unknown`):
|
||||
"library/core/src/hint.rs",
|
||||
"library/std/src/sys/", // Platform-specific code for std lives here.
|
||||
// This has the trailing slash so that sys_common is not excepted.
|
||||
"library/std/src/os", // Platform-specific public interfaces
|
||||
"library/rtstartup", // Not sure what to do about this. magic stuff for mingw
|
||||
// temporary exceptions
|
||||
"library/std/src/lib.rs",
|
||||
"library/std/src/path.rs",
|
||||
"library/std/src/f32.rs",
|
||||
"library/std/src/f64.rs",
|
||||
// Integration test for platform-specific run-time feature detection:
|
||||
"library/std/tests/run-time-detect.rs",
|
||||
"library/std/src/net/test.rs",
|
||||
"library/std/src/net/addr",
|
||||
"library/std/src/net/udp",
|
||||
"library/std/src/sys_common/mod.rs",
|
||||
"library/std/src/sys_common/net.rs",
|
||||
"library/std/src/sys_common/backtrace.rs",
|
||||
"library/std/src/sys_common/remutex.rs",
|
||||
"library/std/src/sync/mutex.rs",
|
||||
"library/std/src/sync/rwlock.rs",
|
||||
// panic_unwind shims
|
||||
"library/std/src/panicking.rs",
|
||||
"library/term", // Not sure how to make this crate portable, but test crate needs it.
|
||||
"library/test", // Probably should defer to unstable `std::sys` APIs.
|
||||
"library/std/src/sync/mpsc", // some tests are only run on non-emscripten
|
||||
// std testing crates, okay for now at least
|
||||
"library/core/tests",
|
||||
"library/alloc/tests/lib.rs",
|
||||
|
@ -79,13 +64,6 @@ const EXCEPTION_PATHS: &[&str] = &[
|
|||
// we must use `#[cfg(windows)]` to conditionally compile the
|
||||
// correct `VaList` structure for windows.
|
||||
"library/core/src/ffi.rs",
|
||||
// non-std crates
|
||||
"src/test",
|
||||
"src/tools",
|
||||
"src/librustc",
|
||||
"src/librustdoc",
|
||||
"src/librustc_ast",
|
||||
"src/bootstrap",
|
||||
];
|
||||
|
||||
pub fn check(path: &Path, bad: &mut bool) {
|
||||
|
|
Loading…
Reference in a new issue