Rewrite and rename issue-35164 to rmake

This commit is contained in:
Oneirical 2024-07-11 15:52:04 -04:00
parent 83234a0f21
commit 61a6afe60c
6 changed files with 16 additions and 6 deletions

View File

@ -216,7 +216,7 @@ pub fn assert_stderr_contains<S: AsRef<str>>(&self, expected: S) -> &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);
assert_not_contains(&self.stderr_utf8(), unexpected);
self
}

View File

@ -17,7 +17,6 @@ run-make/foreign-double-unwind/Makefile
run-make/foreign-exceptions/Makefile
run-make/foreign-rust-exceptions/Makefile
run-make/incr-add-rust-src-component/Makefile
run-make/issue-35164/Makefile
run-make/issue-36710/Makefile
run-make/issue-69368/Makefile
run-make/issue-84395-lto-embed-bitcode/Makefile

View File

@ -1,4 +0,0 @@
include ../tools.mk
all:
$(RUSTC) main.rs --error-format json 2>&1 | $(CGREP) -e '"byte_start":23\b' '"byte_end":29\b'

View File

@ -0,0 +1,15 @@
// The byte positions in json format error logging used to have a small, difficult
// to predict offset. This was changed to be the top of the file every time in #42973,
// and this test checks that the measurements appearing in the standard error are correct.
// See https://github.com/rust-lang/rust/issues/35164
use run_make_support::rustc;
fn main() {
rustc()
.input("main.rs")
.error_format("json")
.run()
.assert_stderr_contains(r#""byte_start":23"#)
.assert_stderr_contains(r#""byte_end":29"#);
}