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 8 pull requests #127216

Merged
merged 24 commits into from
Jul 1, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
bb00657
Stabilize `PanicInfo::message()` and `PanicMessage`
StackOverflowExcept1on Jun 20, 2024
1031d4d
Add nightly style guide section for precise_capturing
compiler-errors Jun 20, 2024
614e042
Migrate `volatile-intrinsics` to `rmake`
Rejyr Jun 23, 2024
56fe015
Migrate `weird-output-filenames` to `rmake`
Rejyr Jun 23, 2024
189232b
Migrate `wasm-override-linker` to `rmake`
Rejyr Jun 23, 2024
68b6bb2
Migrate `wasm-exceptions-nostd` to `rmake`
Rejyr Jun 23, 2024
0c1df37
Refactor `wasm-abi` to use `cmd`
Rejyr Jun 23, 2024
2ef2699
Refactor `compressed-debuginfo` to use `llvm_readobj`
Rejyr Jun 23, 2024
7f383d0
Stabilize `duration_abs_diff`
elomatreb Jun 29, 2024
583b5fc
Use full expr span for return suggestion on type error/ambiguity
compiler-errors Jun 29, 2024
b5b97dc
Improve `run-make-support` API for `assert*` functions
GuillaumeGomez Jul 1, 2024
fcfac05
Improve `target` method API in `run-make-support`
GuillaumeGomez Jul 1, 2024
fe6f3fa
improve the way bootstrap handles rustlib components
onur-ozkan Jun 30, 2024
97415ce
fail on component linking errors
onur-ozkan Jul 1, 2024
af31c33
linker: Refactor interface for passing arguments to linker
petrochenkov Jan 27, 2024
5f9a0d3
linker: Bail out of rpath logic early if the target doesn't support r…
petrochenkov Jul 1, 2024
61db24d
Rollup merge of #126732 - StackOverflowExcept1on:master, r=m-ou-se
GuillaumeGomez Jul 1, 2024
c4baa3f
Rollup merge of #126753 - compiler-errors:use-style-guide, r=joshtrip…
GuillaumeGomez Jul 1, 2024
6b2e644
Rollup merge of #126832 - petrochenkov:linkarg, r=jieyouxu
GuillaumeGomez Jul 1, 2024
61e7f05
Rollup merge of #126880 - Rejyr:migrate-rmake-vw, r=Kobzol
GuillaumeGomez Jul 1, 2024
f5810c4
Rollup merge of #127128 - elomatreb:elomatreb/stabilize-duration_abs_…
GuillaumeGomez Jul 1, 2024
61fe6b6
Rollup merge of #127129 - compiler-errors:full-expr-span, r=jieyouxu
GuillaumeGomez Jul 1, 2024
cb81d0d
Rollup merge of #127188 - onur-ozkan:rustc-src-fix, r=Kobzol
GuillaumeGomez Jul 1, 2024
a509b5a
Rollup merge of #127201 - GuillaumeGomez:improve-run-make-support, r=…
GuillaumeGomez Jul 1, 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
8 changes: 4 additions & 4 deletions src/tools/run-make-support/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,14 +185,14 @@ impl CompletedProcess {
/// Checks that `stdout` does not contain `unexpected`.
#[track_caller]
pub fn assert_stdout_not_contains<S: AsRef<str>>(&self, unexpected: S) -> &Self {
assert_not_contains(&self.stdout_utf8(), unexpected.as_ref());
assert_not_contains(&self.stdout_utf8(), unexpected);
self
}

/// Checks that `stdout` contains `expected`.
#[track_caller]
pub fn assert_stdout_contains<S: AsRef<str>>(&self, expected: S) -> &Self {
assert_contains(&self.stdout_utf8(), expected.as_ref());
assert_contains(&self.stdout_utf8(), expected);
self
}

Expand All @@ -206,14 +206,14 @@ impl CompletedProcess {
/// Checks that `stderr` contains `expected`.
#[track_caller]
pub fn assert_stderr_contains<S: AsRef<str>>(&self, expected: S) -> &Self {
assert_contains(&self.stderr_utf8(), expected.as_ref());
assert_contains(&self.stderr_utf8(), expected);
self
}

/// Checks that `stderr` does not contain `unexpected`.
#[track_caller]
pub fn assert_stderr_not_contains<S: AsRef<str>>(&self, unexpected: S) -> &Self {
assert_not_contains(&self.stdout_utf8(), unexpected.as_ref());
assert_not_contains(&self.stdout_utf8(), unexpected);
self
}

Expand Down
12 changes: 9 additions & 3 deletions src/tools/run-make-support/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,9 @@ pub fn read_dir<F: FnMut(&Path)>(dir: impl AsRef<Path>, mut callback: F) {

/// Check that `actual` is equal to `expected`. Panic otherwise.
#[track_caller]
pub fn assert_equals(actual: &str, expected: &str) {
pub fn assert_equals<S1: AsRef<str>, S2: AsRef<str>>(actual: S1, expected: S2) {
let actual = actual.as_ref();
let expected = expected.as_ref();
if actual != expected {
eprintln!("=== ACTUAL TEXT ===");
eprintln!("{}", actual);
Expand All @@ -421,7 +423,9 @@ pub fn assert_equals(actual: &str, expected: &str) {

/// Check that `haystack` contains `needle`. Panic otherwise.
#[track_caller]
pub fn assert_contains(haystack: &str, needle: &str) {
pub fn assert_contains<S1: AsRef<str>, S2: AsRef<str>>(haystack: S1, needle: S2) {
let haystack = haystack.as_ref();
let needle = needle.as_ref();
if !haystack.contains(needle) {
eprintln!("=== HAYSTACK ===");
eprintln!("{}", haystack);
Expand All @@ -433,7 +437,9 @@ pub fn assert_contains(haystack: &str, needle: &str) {

/// Check that `haystack` does not contain `needle`. Panic otherwise.
#[track_caller]
pub fn assert_not_contains(haystack: &str, needle: &str) {
pub fn assert_not_contains<S1: AsRef<str>, S2: AsRef<str>>(haystack: S1, needle: S2) {
let haystack = haystack.as_ref();
let needle = needle.as_ref();
if haystack.contains(needle) {
eprintln!("=== HAYSTACK ===");
eprintln!("{}", haystack);
Expand Down
3 changes: 2 additions & 1 deletion src/tools/run-make-support/src/rustc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,8 @@ impl Rustc {
}

/// Specify the target triple, or a path to a custom target json spec file.
pub fn target(&mut self, target: &str) -> &mut Self {
pub fn target<S: AsRef<str>>(&mut self, target: S) -> &mut Self {
let target = target.as_ref();
self.cmd.arg(format!("--target={target}"));
self
}
Expand Down
3 changes: 2 additions & 1 deletion src/tools/run-make-support/src/rustdoc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ impl Rustdoc {
}

/// Specify the target triple, or a path to a custom target json spec file.
pub fn target(&mut self, target: &str) -> &mut Self {
pub fn target<S: AsRef<str>>(&mut self, target: S) -> &mut Self {
let target = target.as_ref();
self.cmd.arg(format!("--target={target}"));
self
}
Expand Down
2 changes: 1 addition & 1 deletion tests/run-make/comment-section/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ fn main() {
.stdin("fn main() {}")
.emit("link,obj")
.arg("-Csave-temps")
.target(&target)
.target(target)
.run();

// Check linked output has a `.comment` section with the expected content.
Expand Down
4 changes: 2 additions & 2 deletions tests/run-make/compressed-debuginfo/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ fn check_compression(compression: &str, to_find: &str) {
llvm_readobj().arg("-t").arg("foo.o").run().assert_stdout_contains(to_find);
} else {
assert_contains(
&stderr,
&format!("unknown debuginfo compression algorithm {compression}"),
stderr,
format!("unknown debuginfo compression algorithm {compression}"),
);
}
});
Expand Down
2 changes: 1 addition & 1 deletion tests/run-make/inaccessible-temp-dir/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ fn main() {
// Run rustc with `-Z temps-dir` set to a directory *inside* the inaccessible one,
// so that it can't create `tmp`.
rustc()
.target(&target())
.target(target())
.input("program.rs")
.arg("-Ztemps-dir=inaccessible/tmp")
.run_fail()
Expand Down
2 changes: 1 addition & 1 deletion tests/run-make/static-pie/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ fn test(compiler: &str) {

rustc()
.input("test-aslr.rs")
.target(&target())
.target(target())
.linker(compiler)
.arg("-Clinker-flavor=gcc")
.arg("-Ctarget-feature=+crt-static")
Expand Down
Loading