Skip to content

Commit f9927ee

Browse files
Use eprint! instead of eprintln!
1 parent fff2484 commit f9927ee

File tree

4 files changed

+23
-33
lines changed

4 files changed

+23
-33
lines changed

src/librustdoc/doctest/runner.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ mod __doctest_mod {{
131131
.output()
132132
.expect(\"failed to run command\");
133133
if !out.status.success() {{
134-
eprintln!(\"{{}}\", String::from_utf8_lossy(&out.stderr));
134+
eprint!(\"{{}}\", String::from_utf8_lossy(&out.stderr));
135135
ExitCode::FAILURE
136136
}} else {{
137137
ExitCode::SUCCESS

tests/rustdoc-ui/edition-2024-doctest-error-output.rs renamed to tests/rustdoc-ui/doctest/edition-2024-error-output.rs

+2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
//@ edition: 2024
55
//@ compile-flags: --test
66
//@ normalize-stdout: "tests/rustdoc-ui/doctest" -> "$$DIR"
7+
//@ normalize-stdout: "panicked at .+rs:" -> "panicked at $$TMP:"
78
//@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"
9+
//@ rustc-env:RUST_BACKTRACE=0
810
//@ failure-status: 101
911

1012
//! ```rust
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+
running 1 test
3+
test $DIR/edition-2024-error-output.rs - (line 12) ... FAILED
4+
5+
failures:
6+
7+
---- $DIR/edition-2024-error-output.rs - (line 12) stdout ----
8+
9+
thread 'main' panicked at $TMP:6:1:
10+
assertion `left == right` failed
11+
left: 4
12+
right: 5
13+
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
14+
15+
16+
failures:
17+
$DIR/edition-2024-error-output.rs - (line 12)
18+
19+
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME
20+

tests/rustdoc-ui/edition-2024-doctest-error-output.stdout

-32
This file was deleted.

0 commit comments

Comments
 (0)