Skip to content

Commit b123710

Browse files
committed
Auto merge of #143757 - cuviper:beta-next, r=cuviper
[beta] backports - Beta backport: null terminate UNICODE_STRINGs #143275 - Fix hang in --print=file-names in bootstrap #142928 - Reduce mismatched-lifetime-syntaxes suggestions to MaybeIncorrect #142980 - Update LLVM submodule #143126 - Do not unify borrowed locals in CopyProp. #143509 - Disable docs for `compiler-builtins` and `sysroot` #143660 - Update version placeholders in stdarch rust-lang/stdarch#1840 r? cuviper
2 parents b5e10d8 + 83c0a8c commit b123710

26 files changed

+885
-294
lines changed

compiler/rustc_lint/src/lints.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3261,7 +3261,7 @@ impl Subdiagnostic for MismatchedLifetimeSyntaxesSuggestion {
32613261
diag.multipart_suggestion_with_style(
32623262
fluent::lint_mismatched_lifetime_syntaxes_suggestion_implicit,
32633263
suggestions,
3264-
Applicability::MachineApplicable,
3264+
Applicability::MaybeIncorrect,
32653265
style(tool_only),
32663266
);
32673267
}
@@ -3276,7 +3276,7 @@ impl Subdiagnostic for MismatchedLifetimeSyntaxesSuggestion {
32763276
diag.multipart_suggestion_with_style(
32773277
fluent::lint_mismatched_lifetime_syntaxes_suggestion_mixed,
32783278
suggestions,
3279-
Applicability::MachineApplicable,
3279+
Applicability::MaybeIncorrect,
32803280
style(tool_only),
32813281
);
32823282
}
@@ -3291,7 +3291,7 @@ impl Subdiagnostic for MismatchedLifetimeSyntaxesSuggestion {
32913291
diag.multipart_suggestion_with_style(
32923292
msg,
32933293
suggestions,
3294-
Applicability::MachineApplicable,
3294+
Applicability::MaybeIncorrect,
32953295
style(tool_only),
32963296
);
32973297
}

compiler/rustc_mir_transform/src/ssa.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,8 +322,8 @@ fn compute_copy_classes(ssa: &mut SsaLocals, body: &Body<'_>) {
322322
// visited before `local`, and we just have to copy the representing local.
323323
let head = copies[rhs];
324324

325-
// Do not unify two borrowed locals.
326-
if borrowed_classes.contains(local) && borrowed_classes.contains(head) {
325+
// Do not unify borrowed locals.
326+
if borrowed_classes.contains(local) || borrowed_classes.contains(head) {
327327
continue;
328328
}
329329

library/compiler-builtins/compiler-builtins/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ links = "compiler-rt"
1919
bench = false
2020
doctest = false
2121
test = false
22+
# make sure this crate isn't included in public standard library docs
23+
doc = false
2224

2325
[dependencies]
2426
core = { path = "../../core", optional = true }

library/std/src/sys/fs/windows/remove_dir_all.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,16 @@ fn open_link_no_reparse(
9090
static ATTRIBUTES: Atomic<u32> = AtomicU32::new(c::OBJ_DONT_REPARSE);
9191

9292
let result = unsafe {
93+
// Workaround for #143078.
94+
// While the Windows OS itself handles zero length strings,
95+
// some security software that hooks system functions may expect it to
96+
// be null terminated. So as a workaround we ensure zero length strings
97+
// always point to a zero u16 even though it should never be read.
98+
static EMPTY_STR: [u16; 1] = [0];
9399
let mut path_str = c::UNICODE_STRING::from_ref(path);
100+
if path_str.Length == 0 {
101+
path_str.Buffer = EMPTY_STR.as_ptr().cast_mut();
102+
}
94103
let mut object = c::OBJECT_ATTRIBUTES {
95104
ObjectName: &mut path_str,
96105
RootDirectory: parent.as_raw_handle(),

library/std/src/sys/pal/windows/pipe.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use crate::io::{self, BorrowedCursor, IoSlice, IoSliceMut};
22
use crate::ops::Neg;
33
use crate::os::windows::prelude::*;
4-
use crate::sys::api::utf16;
4+
use crate::sys::api::wide_str;
55
use crate::sys::c;
66
use crate::sys::handle::Handle;
77
use crate::sys_common::{FromInner, IntoInner};
@@ -73,7 +73,8 @@ pub fn anon_pipe(ours_readable: bool, their_handle_inheritable: bool) -> io::Res
7373
// Open a handle to the pipe filesystem (`\??\PIPE\`).
7474
// This will be used when creating a new annon pipe.
7575
let pipe_fs = {
76-
let path = c::UNICODE_STRING::from_ref(utf16!(r"\??\PIPE\"));
76+
static PIPE_PATH: [u16; 10] = *wide_str!(r"\??\PIPE\");
77+
let path = c::UNICODE_STRING::from_ref(&PIPE_PATH[..PIPE_PATH.len() - 1]);
7778
object_attributes.ObjectName = &path;
7879
let mut pipe_fs = ptr::null_mut();
7980
let status = c::NtOpenFile(

library/sysroot/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ name = "sysroot"
55
version = "0.0.0"
66
edition = "2024"
77

8+
[lib]
9+
# make sure this crate isn't included in public standard library docs
10+
doc = false
11+
812
# this is a dummy crate to ensure that all required crates appear in the sysroot
913
[dependencies]
1014
proc_macro = { path = "../proc_macro", public = true }

src/bootstrap/src/core/build_steps/doc.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -734,10 +734,6 @@ fn doc_std(
734734
}
735735

736736
for krate in requested_crates {
737-
if krate == "sysroot" {
738-
// The sysroot crate is an implementation detail, don't include it in public docs.
739-
continue;
740-
}
741737
cargo.arg("-p").arg(krate);
742738
}
743739

src/bootstrap/src/core/builder/cargo.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -683,6 +683,7 @@ impl Builder<'_> {
683683
.arg("--print=file-names")
684684
.arg("--crate-type=proc-macro")
685685
.arg("-")
686+
.stdin(std::process::Stdio::null())
686687
.run_capture(self)
687688
.stderr();
688689

src/bootstrap/src/utils/exec.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,11 @@ impl<'a> BootstrapCommand {
119119
self
120120
}
121121

122+
pub fn stdin(&mut self, stdin: std::process::Stdio) -> &mut Self {
123+
self.command.stdin(stdin);
124+
self
125+
}
126+
122127
#[must_use]
123128
pub fn delay_failure(self) -> Self {
124129
Self { failure_behavior: BehaviorOnFailure::DelayFail, ..self }

0 commit comments

Comments
 (0)