Auto merge of #126463 - matthiaskrgr:rollup-lnkfibf, r=matthiaskrgr

Rollup of 5 pull requests

Successful merges:

 - #124884 (place explicit lifetime bound after generic param)
 - #126343 (Remove some msys2 utils)
 - #126351 (std::unix::fs::link using direct linkat call for Solaris.)
 - #126368 (Remove some unnecessary crate dependencies.)
 - #126386 (Migrate `run-make/allow-non-lint-warnings-cmdline` to `rmake.rs`)

r? `@ghost`
`@rustbot` modify labels: rollup
This commit is contained in:
bors 2024-06-14 09:19:38 +00:00
commit 63491e1012
13 changed files with 181 additions and 42 deletions

View file

@ -6,7 +6,7 @@ use std::path::Path;
use std::process::{Command as StdCommand, ExitStatus, Output, Stdio};
use crate::drop_bomb::DropBomb;
use crate::{assert_not_contains, handle_failed_output};
use crate::{assert_contains, assert_not_contains, handle_failed_output};
/// This is a custom command wrapper that simplifies working with commands and makes it easier to
/// ensure that we check the exit status of executed processes.
@ -170,6 +170,12 @@ impl CompletedProcess {
self
}
#[track_caller]
pub fn assert_stdout_contains<S: AsRef<str>>(self, needle: S) -> Self {
assert_contains(&self.stdout_utf8(), needle.as_ref());
self
}
#[track_caller]
pub fn assert_stdout_not_contains<S: AsRef<str>>(&self, needle: S) -> &Self {
assert_not_contains(&self.stdout_utf8(), needle.as_ref());
@ -185,7 +191,7 @@ impl CompletedProcess {
#[track_caller]
pub fn assert_stderr_contains<S: AsRef<str>>(&self, needle: S) -> &Self {
assert!(self.stderr_utf8().contains(needle.as_ref()));
assert_contains(&self.stderr_utf8(), needle.as_ref());
self
}

View file

@ -332,6 +332,18 @@ pub fn read_dir<F: Fn(&Path)>(dir: impl AsRef<Path>, callback: F) {
}
}
/// Check that `haystack` contains `needle`. Panic otherwise.
#[track_caller]
pub fn assert_contains(haystack: &str, needle: &str) {
if !haystack.contains(needle) {
eprintln!("=== HAYSTACK ===");
eprintln!("{}", haystack);
eprintln!("=== NEEDLE ===");
eprintln!("{}", needle);
panic!("needle was not found in haystack");
}
}
/// Check that `haystack` does not contain `needle`. Panic otherwise.
#[track_caller]
pub fn assert_not_contains(haystack: &str, needle: &str) {

View file

@ -1,5 +1,4 @@
run-make/allocator-shim-circular-deps/Makefile
run-make/allow-non-lint-warnings-cmdline/Makefile
run-make/archive-duplicate-names/Makefile
run-make/atomic-lock-free/Makefile
run-make/branch-protection-check-IBT/Makefile