Skip to content

Commit d337cec

Browse files
committed
Auto merge of #84684 - jackh726:rollup-qxc5cos, r=jackh726
Rollup of 11 pull requests Successful merges: - #84484 (Don't rebuild rustdoc and clippy after checking bootstrap) - #84530 (`test tidy` should ignore alternative `build` dir patterns) - #84531 (Ignore commented out lines when finding features) - #84540 (Build sanitizers for x86_64-unknown-linux-musl) - #84555 (Set `backtrace-on-ice` by default for compiler and codegen profiles) - #84585 (Add `x.py check src/librustdoc` as an alias for `x.py check src/tools/rustdoc`) - #84636 (rustdoc: change aliases attribute to data-aliases) - #84646 (Add some regression tests related to #82494) - #84661 (Remove extra word in `rustc_mir` docs) - #84663 (Remove `DropGuard` in `sys::windows::process` and use `StaticMutex` instead) - #84668 (Update books) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents ada1024 + 5d2ac6f commit d337cec

File tree

22 files changed

+145
-43
lines changed

22 files changed

+145
-43
lines changed

compiler/rustc_mir/src/borrow_check/type_check/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ mod relate_tys;
9797

9898
/// Type checks the given `mir` in the context of the inference
9999
/// context `infcx`. Returns any region constraints that have yet to
100-
/// be proven. This result is includes liveness constraints that
100+
/// be proven. This result includes liveness constraints that
101101
/// ensure that regions appearing in the types of all local variables
102102
/// are live at all points where that local variable may later be
103103
/// used.

library/std/src/sys/windows/process.rs

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ use crate::sys::c;
1919
use crate::sys::cvt;
2020
use crate::sys::fs::{File, OpenOptions};
2121
use crate::sys::handle::Handle;
22-
use crate::sys::mutex::Mutex;
2322
use crate::sys::pipe::{self, AnonPipe};
2423
use crate::sys::stdio;
24+
use crate::sys_common::mutex::StaticMutex;
2525
use crate::sys_common::process::{CommandEnv, CommandEnvs};
2626
use crate::sys_common::AsInner;
2727

@@ -94,10 +94,6 @@ pub struct StdioPipes {
9494
pub stderr: Option<AnonPipe>,
9595
}
9696

97-
struct DropGuard<'a> {
98-
lock: &'a Mutex,
99-
}
100-
10197
impl Command {
10298
pub fn new(program: &OsStr) -> Command {
10399
Command {
@@ -209,8 +205,9 @@ impl Command {
209205
//
210206
// For more information, msdn also has an article about this race:
211207
// http://support.microsoft.com/kb/315939
212-
static CREATE_PROCESS_LOCK: Mutex = Mutex::new();
213-
let _guard = DropGuard::new(&CREATE_PROCESS_LOCK);
208+
static CREATE_PROCESS_LOCK: StaticMutex = StaticMutex::new();
209+
210+
let _guard = unsafe { CREATE_PROCESS_LOCK.lock() };
214211

215212
let mut pipes = StdioPipes { stdin: None, stdout: None, stderr: None };
216213
let null = Stdio::Null;
@@ -259,23 +256,6 @@ impl fmt::Debug for Command {
259256
}
260257
}
261258

262-
impl<'a> DropGuard<'a> {
263-
fn new(lock: &'a Mutex) -> DropGuard<'a> {
264-
unsafe {
265-
lock.lock();
266-
DropGuard { lock }
267-
}
268-
}
269-
}
270-
271-
impl<'a> Drop for DropGuard<'a> {
272-
fn drop(&mut self) {
273-
unsafe {
274-
self.lock.unlock();
275-
}
276-
}
277-
}
278-
279259
impl Stdio {
280260
fn to_handle(&self, stdio_id: c::DWORD, pipe: &mut Option<AnonPipe>) -> io::Result<Handle> {
281261
match *self {

rustfmt.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ merge_derives = false
77
# tidy only checks files which are not ignored, each entry follows gitignore style
88
ignore = [
99
"/build/",
10+
"/*-build/",
11+
"/build-*/",
1012
"/vendor/",
1113

1214
# tests for now are not formatted, as they are sometimes pretty-printing constrained

src/bootstrap/check.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ impl Step for CodegenBackend {
280280
}
281281

282282
macro_rules! tool_check_step {
283-
($name:ident, $path:expr, $source_type:expr) => {
283+
($name:ident, $path:literal, $($alias:literal, )* $source_type:path) => {
284284
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
285285
pub struct $name {
286286
pub target: TargetSelection,
@@ -292,7 +292,7 @@ macro_rules! tool_check_step {
292292
const DEFAULT: bool = true;
293293

294294
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
295-
run.path($path)
295+
run.paths(&[ $path, $($alias),* ])
296296
}
297297

298298
fn make_run(run: RunConfig<'_>) {
@@ -321,11 +321,9 @@ macro_rules! tool_check_step {
321321
}
322322

323323
// Enable internal lints for clippy and rustdoc
324-
// NOTE: this intentionally doesn't enable lints for any other tools,
325-
// see https://github.com/rust-lang/rust/pull/80573#issuecomment-754010776
326-
if $path == "src/tools/rustdoc" || $path == "src/tools/clippy" {
327-
cargo.rustflag("-Zunstable-options");
328-
}
324+
// NOTE: this doesn't enable lints for any other tools unless they explicitly add `#![warn(rustc::internal)]`
325+
// See https://github.com/rust-lang/rust/pull/80573#issuecomment-754010776
326+
cargo.rustflag("-Zunstable-options");
329327

330328
builder.info(&format!(
331329
"Checking stage{} {} artifacts ({} -> {})",
@@ -363,7 +361,7 @@ macro_rules! tool_check_step {
363361
};
364362
}
365363

366-
tool_check_step!(Rustdoc, "src/tools/rustdoc", SourceType::InTree);
364+
tool_check_step!(Rustdoc, "src/tools/rustdoc", "src/librustdoc", SourceType::InTree);
367365
// Clippy is a hybrid. It is an external tool, but uses a git subtree instead
368366
// of a submodule. Since the SourceType only drives the deny-warnings
369367
// behavior, treat it as in-tree so that any new warnings in clippy will be

src/bootstrap/defaults/config.codegen.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,5 @@ assertions = true
1111
debug-logging = true
1212
# This greatly increases the speed of rebuilds, especially when there are only minor changes. However, it makes the initial build slightly slower.
1313
incremental = true
14+
# Print backtrace on internal compiler errors during bootstrap
15+
backtrace-on-ice = true

src/bootstrap/defaults/config.compiler.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
debug-logging = true
77
# This greatly increases the speed of rebuilds, especially when there are only minor changes. However, it makes the initial build slightly slower.
88
incremental = true
9+
# Print backtrace on internal compiler errors during bootstrap
10+
backtrace-on-ice = true
911

1012
[llvm]
1113
# Will download LLVM from CI if available on your platform.

src/ci/docker/host-x86_64/dist-x86_64-musl/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ ENV HOSTS=x86_64-unknown-linux-musl
3838
ENV RUST_CONFIGURE_ARGS \
3939
--musl-root-x86_64=/usr/local/x86_64-linux-musl \
4040
--enable-extended \
41+
--enable-sanitizers \
4142
--enable-profiler \
4243
--enable-lld \
4344
--set target.x86_64-unknown-linux-musl.crt-static=false \

src/doc/book

Submodule book updated 1 file

0 commit comments

Comments
 (0)