Skip to content

Commit bc3e891

Browse files
authored
Rollup merge of rust-lang#134759 - Zalathar:normalize, r=jieyouxu
compiletest: Remove the `-test` suffix from normalize directives This suffix was an artifact of using the same condition-checking engine as the `ignore-*` and `only-*` directives, but in practice we have only 2 tests that legitimately use a condition, and both of them only care about 32-bit vs 64-bit. This PR detaches `normalize-*` directives from the condition checker, and replaces it with a much simpler system of four explicit `NormalizeKind` values. It then takes advantage of that simplicity to get rid of the `-test` suffix. --- Addresses one of the points of rust-lang#126372. The new name-checking code is a bit quaint, but I think it's a definite improvement over the status quo. --- The corresponding dev-guide update is rust-lang/rustc-dev-guide#2172. r? jieyouxu
2 parents 7bbbfc6 + 835fbcb commit bc3e891

File tree

246 files changed

+508
-485
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

246 files changed

+508
-485
lines changed

src/tools/compiletest/src/directive-list.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,10 @@ const KNOWN_DIRECTIVE_NAMES: &[&str] = &[
160160
"needs-xray",
161161
"no-auto-check-cfg",
162162
"no-prefer-dynamic",
163+
"normalize-stderr",
163164
"normalize-stderr-32bit",
164165
"normalize-stderr-64bit",
165-
"normalize-stderr-test",
166-
"normalize-stdout-test",
166+
"normalize-stdout",
167167
"only-16bit",
168168
"only-32bit",
169169
"only-64bit",

src/tools/compiletest/src/header.rs

+47-14
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ use tracing::*;
1212
use crate::common::{Config, Debugger, FailMode, Mode, PassMode};
1313
use crate::debuggers::{extract_cdb_version, extract_gdb_version};
1414
use crate::header::auxiliary::{AuxProps, parse_and_update_aux};
15-
use crate::header::cfg::{MatchOutcome, parse_cfg_name_directive};
1615
use crate::header::needs::CachedNeedsConditions;
1716
use crate::util::static_regex;
1817

@@ -472,11 +471,24 @@ impl TestProps {
472471

473472
config.set_name_directive(ln, IGNORE_PASS, &mut self.ignore_pass);
474473

475-
if let Some(rule) = config.parse_custom_normalization(ln, "normalize-stdout") {
476-
self.normalize_stdout.push(rule);
477-
}
478-
if let Some(rule) = config.parse_custom_normalization(ln, "normalize-stderr") {
479-
self.normalize_stderr.push(rule);
474+
if let Some(NormalizeRule { kind, regex, replacement }) =
475+
config.parse_custom_normalization(ln)
476+
{
477+
let rule_tuple = (regex, replacement);
478+
match kind {
479+
NormalizeKind::Stdout => self.normalize_stdout.push(rule_tuple),
480+
NormalizeKind::Stderr => self.normalize_stderr.push(rule_tuple),
481+
NormalizeKind::Stderr32bit => {
482+
if config.target_cfg().pointer_width == 32 {
483+
self.normalize_stderr.push(rule_tuple);
484+
}
485+
}
486+
NormalizeKind::Stderr64bit => {
487+
if config.target_cfg().pointer_width == 64 {
488+
self.normalize_stderr.push(rule_tuple);
489+
}
490+
}
491+
}
480492
}
481493

482494
if let Some(code) = config
@@ -966,20 +978,28 @@ impl Config {
966978
}
967979
}
968980

969-
fn parse_custom_normalization(&self, line: &str, prefix: &str) -> Option<(String, String)> {
970-
let parsed = parse_cfg_name_directive(self, line, prefix);
971-
if parsed.outcome != MatchOutcome::Match {
972-
return None;
973-
}
974-
let name = parsed.name.expect("successful match always has a name");
981+
fn parse_custom_normalization(&self, line: &str) -> Option<NormalizeRule> {
982+
// FIXME(Zalathar): Integrate name/value splitting into `DirectiveLine`
983+
// instead of doing it here.
984+
let (directive_name, _value) = line.split_once(':')?;
985+
986+
let kind = match directive_name {
987+
"normalize-stdout" => NormalizeKind::Stdout,
988+
"normalize-stderr" => NormalizeKind::Stderr,
989+
"normalize-stderr-32bit" => NormalizeKind::Stderr32bit,
990+
"normalize-stderr-64bit" => NormalizeKind::Stderr64bit,
991+
_ => return None,
992+
};
975993

994+
// FIXME(Zalathar): The normalize rule parser should only care about
995+
// the value part, not the "line" (which isn't even the whole line).
976996
let Some((regex, replacement)) = parse_normalize_rule(line) else {
977997
panic!(
978998
"couldn't parse custom normalization rule: `{line}`\n\
979-
help: expected syntax is: `{prefix}-{name}: \"REGEX\" -> \"REPLACEMENT\"`"
999+
help: expected syntax is: `{directive_name}: \"REGEX\" -> \"REPLACEMENT\"`"
9801000
);
9811001
};
982-
Some((regex, replacement))
1002+
Some(NormalizeRule { kind, regex, replacement })
9831003
}
9841004

9851005
fn parse_name_directive(&self, line: &str, directive: &str) -> bool {
@@ -1105,6 +1125,19 @@ fn expand_variables(mut value: String, config: &Config) -> String {
11051125
value
11061126
}
11071127

1128+
struct NormalizeRule {
1129+
kind: NormalizeKind,
1130+
regex: String,
1131+
replacement: String,
1132+
}
1133+
1134+
enum NormalizeKind {
1135+
Stdout,
1136+
Stderr,
1137+
Stderr32bit,
1138+
Stderr64bit,
1139+
}
1140+
11081141
/// Parses the regex and replacement values of a `//@ normalize-*` header,
11091142
/// in the format:
11101143
/// ```text

src/tools/compiletest/src/header/cfg.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ pub(super) fn handle_only(config: &Config, line: &str) -> IgnoreDecision {
4040
}
4141

4242
/// Parses a name-value directive which contains config-specific information, e.g., `ignore-x86`
43-
/// or `normalize-stderr-32bit`.
44-
pub(super) fn parse_cfg_name_directive<'a>(
43+
/// or `only-windows`.
44+
fn parse_cfg_name_directive<'a>(
4545
config: &Config,
4646
line: &'a str,
4747
prefix: &str,

src/tools/tidy/src/style.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,7 @@ const ANNOTATIONS_TO_IGNORE: &[&str] = &[
6969
"// gdb",
7070
"// lldb",
7171
"// cdb",
72-
"// normalize-stderr-test",
73-
"//@ normalize-stderr-test",
72+
"//@ normalize-stderr",
7473
];
7574

7675
fn generate_problems<'a>(
@@ -198,8 +197,8 @@ fn should_ignore(line: &str) -> bool {
198197

199198
// For `ui_test`-style UI test directives, also ignore
200199
// - `//@[rev] compile-flags`
201-
// - `//@[rev] normalize-stderr-test`
202-
|| static_regex!("\\s*//@(\\[.*\\]) (compile-flags|normalize-stderr-test|error-pattern).*")
200+
// - `//@[rev] normalize-stderr`
201+
|| static_regex!("\\s*//@(\\[.*\\]) (compile-flags|normalize-stderr|error-pattern).*")
203202
.is_match(line)
204203
// Matching for rustdoc tests commands.
205204
// It allows to prevent them emitting warnings like `line longer than 100 chars`.

tests/rustdoc-ui/2024-doctests-checks.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
//@ check-pass
22
//@ edition: 2024
33
//@ compile-flags: --test --test-args=--test-threads=1
4-
//@ normalize-stdout-test: "tests/rustdoc-ui" -> "$$DIR"
5-
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
6-
//@ normalize-stdout-test: ".rs:\d+:\d+" -> ".rs:$$LINE:$$COL"
4+
//@ normalize-stdout: "tests/rustdoc-ui" -> "$$DIR"
5+
//@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"
6+
//@ normalize-stdout: ".rs:\d+:\d+" -> ".rs:$$LINE:$$COL"
77

88
/// ```
99
/// let x = 12;

tests/rustdoc-ui/2024-doctests-crate-attribute.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
//@ check-pass
22
//@ edition: 2024
33
//@ compile-flags: --test --test-args=--test-threads=1
4-
//@ normalize-stdout-test: "tests/rustdoc-ui" -> "$$DIR"
5-
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
6-
//@ normalize-stdout-test: ".rs:\d+:\d+" -> ".rs:$$LINE:$$COL"
4+
//@ normalize-stdout: "tests/rustdoc-ui" -> "$$DIR"
5+
//@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"
6+
//@ normalize-stdout: ".rs:\d+:\d+" -> ".rs:$$LINE:$$COL"
77

88
/// This doctest is used to ensure that if a crate attribute is present,
99
/// it will not be part of the merged doctests.

tests/rustdoc-ui/argfile/commandline-argfile-missing-windows.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
// line arguments and is only run on windows.
66
//
77
//@ only-windows
8-
//@ normalize-stderr-test: "os error \d+" -> "os error $$ERR"
9-
//@ normalize-stderr-test: "commandline-argfile-missing.args:[^(]*" -> "commandline-argfile-missing.args: $$FILE_MISSING "
8+
//@ normalize-stderr: "os error \d+" -> "os error $$ERR"
9+
//@ normalize-stderr: "commandline-argfile-missing.args:[^(]*" -> "commandline-argfile-missing.args: $$FILE_MISSING "
1010
//@ compile-flags: --cfg cmdline_set @{{src-base}}\argfile\commandline-argfile-missing.args
1111

1212
#[cfg(not(cmdline_set))]

tests/rustdoc-ui/argfile/commandline-argfile-missing.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
// windows.
77
//
88
//@ ignore-windows
9-
//@ normalize-stderr-test: "os error \d+" -> "os error $$ERR"
10-
//@ normalize-stderr-test: "commandline-argfile-missing.args:[^(]*" -> "commandline-argfile-missing.args: $$FILE_MISSING "
9+
//@ normalize-stderr: "os error \d+" -> "os error $$ERR"
10+
//@ normalize-stderr: "commandline-argfile-missing.args:[^(]*" -> "commandline-argfile-missing.args: $$FILE_MISSING "
1111
//@ compile-flags: --cfg cmdline_set @{{src-base}}/argfile/commandline-argfile-missing.args
1212

1313
#[cfg(not(cmdline_set))]

tests/rustdoc-ui/argfile/commandline-argfile-multiple-windows.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
// line arguments and is only run on windows.
66
//
77
//@ only-windows
8-
//@ normalize-stderr-test: "os error \d+" -> "os error $$ERR"
9-
//@ normalize-stderr-test: "commandline-argfile-missing.args:[^(]*" -> "commandline-argfile-missing.args: $$FILE_MISSING "
10-
//@ normalize-stderr-test: "commandline-argfile-missing2.args:[^(]*" -> "commandline-argfile-missing2.args: $$FILE_MISSING "
8+
//@ normalize-stderr: "os error \d+" -> "os error $$ERR"
9+
//@ normalize-stderr: "commandline-argfile-missing.args:[^(]*" -> "commandline-argfile-missing.args: $$FILE_MISSING "
10+
//@ normalize-stderr: "commandline-argfile-missing2.args:[^(]*" -> "commandline-argfile-missing2.args: $$FILE_MISSING "
1111
//@ compile-flags: --cfg cmdline_set @{{src-base}}\argfile\commandline-argfile-missing.args @{{src-base}}\argfile\commandline-argfile-badutf8.args @{{src-base}}\argfile\commandline-argfile-missing2.args
1212

1313
#[cfg(not(cmdline_set))]

tests/rustdoc-ui/argfile/commandline-argfile-multiple.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
// windows.
77
//
88
//@ ignore-windows
9-
//@ normalize-stderr-test: "os error \d+" -> "os error $$ERR"
10-
//@ normalize-stderr-test: "commandline-argfile-missing.args:[^(]*" -> "commandline-argfile-missing.args: $$FILE_MISSING "
11-
//@ normalize-stderr-test: "commandline-argfile-missing2.args:[^(]*" -> "commandline-argfile-missing2.args: $$FILE_MISSING "
9+
//@ normalize-stderr: "os error \d+" -> "os error $$ERR"
10+
//@ normalize-stderr: "commandline-argfile-missing.args:[^(]*" -> "commandline-argfile-missing.args: $$FILE_MISSING "
11+
//@ normalize-stderr: "commandline-argfile-missing2.args:[^(]*" -> "commandline-argfile-missing2.args: $$FILE_MISSING "
1212
//@ compile-flags: --cfg cmdline_set @{{src-base}}/argfile/commandline-argfile-missing.args @{{src-base}}/argfile/commandline-argfile-badutf8.args @{{src-base}}/argfile/commandline-argfile-missing2.args
1313

1414
#[cfg(not(cmdline_set))]

tests/rustdoc-ui/disambiguator-endswith-named-suffix.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@ check-pass
2-
//@ normalize-stderr-test: "nightly|beta|1\.[0-9][0-9]\.[0-9]" -> "$$CHANNEL"
2+
//@ normalize-stderr: "nightly|beta|1\.[0-9][0-9]\.[0-9]" -> "$$CHANNEL"
33

44
//! [struct@m!()] //~ WARN: unmatched disambiguator `struct` and suffix `!()`
55
//! [struct@m!{}]

tests/rustdoc-ui/doctest/block-doc-comment.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//@ check-pass
22
//@ compile-flags:--test
3-
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
3+
//@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"
44

55
// This test ensures that no code block is detected in the doc comments.
66

tests/rustdoc-ui/doctest/cfg-test.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//@ check-pass
22
//@ compile-flags:--test --test-args --test-threads=1
3-
//@ normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
4-
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
3+
//@ normalize-stdout: "tests/rustdoc-ui/doctest" -> "$$DIR"
4+
//@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"
55

66
// Crates like core have doctests gated on `cfg(not(test))` so we need to make
77
// sure `cfg(test)` is not active when running `rustdoc --test`.

tests/rustdoc-ui/doctest/check-cfg-test.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
//@ check-pass
22
//@ compile-flags: --test --nocapture --check-cfg=cfg(feature,values("test")) -Z unstable-options
3-
//@ normalize-stderr-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
4-
//@ normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
5-
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
3+
//@ normalize-stderr: "tests/rustdoc-ui/doctest" -> "$$DIR"
4+
//@ normalize-stdout: "tests/rustdoc-ui/doctest" -> "$$DIR"
5+
//@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"
66

77
/// The doctest will produce a warning because feature invalid is unexpected
88
/// ```

tests/rustdoc-ui/doctest/comment-in-attr-134221-2.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
//@ compile-flags:--test --test-args --test-threads=1
22
//@ failure-status: 101
3-
//@ normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
4-
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
5-
//@ normalize-stdout-test: ".rs:\d+:\d+" -> ".rs:$$LINE:$$COL"
3+
//@ normalize-stdout: "tests/rustdoc-ui/doctest" -> "$$DIR"
4+
//@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"
5+
//@ normalize-stdout: ".rs:\d+:\d+" -> ".rs:$$LINE:$$COL"
66

77
//! ```
88
#![doc = "#![all\

tests/rustdoc-ui/doctest/comment-in-attr-134221.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
//@ compile-flags:--test --test-args --test-threads=1
66
//@ failure-status: 101
7-
//@ normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
8-
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
9-
//@ normalize-stdout-test: ".rs:\d+:\d+" -> ".rs:$$LINE:$$COL"
7+
//@ normalize-stdout: "tests/rustdoc-ui/doctest" -> "$$DIR"
8+
//@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"
9+
//@ normalize-stdout: ".rs:\d+:\d+" -> ".rs:$$LINE:$$COL"
1010

1111
/*!
1212
```rust

tests/rustdoc-ui/doctest/dead-code-2024.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
//@ edition: 2024
44
//@ compile-flags:--test
5-
//@ normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
6-
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
5+
//@ normalize-stdout: "tests/rustdoc-ui/doctest" -> "$$DIR"
6+
//@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"
77
//@ failure-status: 101
88

99
#![doc(test(attr(allow(unused_variables), deny(warnings))))]

tests/rustdoc-ui/doctest/dead-code.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// This test ensures that the doctest will not use `#[allow(unused)]`.
22

33
//@ compile-flags:--test
4-
//@ normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
5-
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
4+
//@ normalize-stdout: "tests/rustdoc-ui/doctest" -> "$$DIR"
5+
//@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"
66
//@ failure-status: 101
77

88
#![doc(test(attr(allow(unused_variables), deny(warnings))))]

tests/rustdoc-ui/doctest/display-output.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
//@ check-pass
44
//@ edition:2018
55
//@ compile-flags:--test --test-args=--show-output
6-
//@ normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
7-
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
6+
//@ normalize-stdout: "tests/rustdoc-ui/doctest" -> "$$DIR"
7+
//@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"
88

99
/// ```
1010
/// #![warn(unused)]

tests/rustdoc-ui/doctest/doc-comment-multi-line-attr.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Regression test for #97440: Multiline inner attribute triggers ICE during doctest
22
//@ compile-flags:--test
3-
//@ normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
4-
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
3+
//@ normalize-stdout: "tests/rustdoc-ui/doctest" -> "$$DIR"
4+
//@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"
55
//@ check-pass
66

77
//! ```rust

tests/rustdoc-ui/doctest/doc-comment-multi-line-cfg-attr.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//@ compile-flags:--test
2-
//@ normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
3-
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
2+
//@ normalize-stdout: "tests/rustdoc-ui/doctest" -> "$$DIR"
3+
//@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"
44
//@ check-pass
55

66
/// ```

tests/rustdoc-ui/doctest/doc-test-doctest-feature.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//@ check-pass
22
//@ compile-flags:--test
3-
//@ normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
4-
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
3+
//@ normalize-stdout: "tests/rustdoc-ui/doctest" -> "$$DIR"
4+
//@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"
55

66
// Make sure `cfg(doctest)` is set when finding doctests but not inside
77
// the doctests.

tests/rustdoc-ui/doctest/doc-test-rustdoc-feature.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//@ check-pass
22
//@ compile-flags:--test
3-
//@ normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
4-
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
3+
//@ normalize-stdout: "tests/rustdoc-ui/doctest" -> "$$DIR"
4+
//@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"
55

66
#![feature(doc_cfg)]
77

tests/rustdoc-ui/doctest/doctest-multiline-crate-attribute.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//@ compile-flags:--test --test-args=--test-threads=1
2-
//@ normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
3-
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
2+
//@ normalize-stdout: "tests/rustdoc-ui/doctest" -> "$$DIR"
3+
//@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"
44
//@ check-pass
55

66
/// ```

tests/rustdoc-ui/doctest/doctest-output-include-fail.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//@ edition:2024
22
//@ compile-flags:--test --test-args=--test-threads=1
3-
//@ normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
4-
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
3+
//@ normalize-stdout: "tests/rustdoc-ui/doctest" -> "$$DIR"
4+
//@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"
55
//@ failure-status: 101
66

77
// https://github.com/rust-lang/rust/issues/130470

tests/rustdoc-ui/doctest/doctest-output.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
//@[edition2024]edition:2015
66
//@[edition2024]aux-build:extern_macros.rs
77
//@[edition2024]compile-flags:--test --test-args=--test-threads=1
8-
//@ normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
9-
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
8+
//@ normalize-stdout: "tests/rustdoc-ui/doctest" -> "$$DIR"
9+
//@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"
1010
//@ check-pass
1111

1212
//! ```

tests/rustdoc-ui/doctest/failed-doctest-compile-fail.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// adapted to use that, and that normalize line can go away
33

44
//@ compile-flags:--test
5-
//@ normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
6-
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
5+
//@ normalize-stdout: "tests/rustdoc-ui/doctest" -> "$$DIR"
6+
//@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"
77
//@ failure-status: 101
88

99
/// ```compile_fail

tests/rustdoc-ui/doctest/failed-doctest-extra-semicolon-on-item.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// adapted to use that, and that normalize line can go away
33

44
//@ compile-flags:--test
5-
//@ normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
6-
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
5+
//@ normalize-stdout: "tests/rustdoc-ui/doctest" -> "$$DIR"
6+
//@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"
77
//@ failure-status: 101
88

99
/// <https://github.com/rust-lang/rust/issues/91014>

0 commit comments

Comments
 (0)