Skip to content

Commit fdf7ea6

Browse files
committed
Auto merge of #126777 - Zalathar:normalize-colon, r=lcnr
Require a colon in `//@ normalize-*:` test headers The previous parser for `//@ normalize-*` headers (before #126370) was so lax that it did not require `:` after the header name. As a result, the test suite contained a mix of with-colon and without-colon normalize headers, both numbering in the hundreds. This PR updates the without-colon headers to add a colon (matching the style used by other headers), and then updates the parser to make the colon mandatory. (Because the normalization parser only runs *after* the header system identifies a normalize header, this will detect and issue an error for relevant headers that lack the colon.) Addresses one of the points of #126372.
2 parents 9b00430 + b677359 commit fdf7ea6

File tree

134 files changed

+235
-245
lines changed

Some content is hidden

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

134 files changed

+235
-245
lines changed

Diff for: src/tools/compiletest/src/header.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1121,13 +1121,11 @@ fn expand_variables(mut value: String, config: &Config) -> String {
11211121
/// normalize-*: "REGEX" -> "REPLACEMENT"
11221122
/// ```
11231123
fn parse_normalize_rule(header: &str) -> Option<(String, String)> {
1124-
// FIXME(#126370): A colon after the header name should be mandatory, but
1125-
// currently is not, and there are many tests that lack the colon.
11261124
// FIXME: Support escaped double-quotes in strings.
11271125
let captures = static_regex!(
11281126
r#"(?x) # (verbose mode regex)
11291127
^
1130-
[^:\s]+:?\s* # (header name followed by optional colon)
1128+
[^:\s]+:\s* # (header name followed by colon)
11311129
"(?<regex>[^"]*)" # "REGEX"
11321130
\s+->\s+ # ->
11331131
"(?<replacement>[^"]*)" # "REPLACEMENT"

Diff for: src/tools/compiletest/src/header/tests.rs

+6-14
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,11 @@ fn make_test_description<R: Read>(
3333

3434
#[test]
3535
fn test_parse_normalize_rule() {
36-
let good_data = &[
37-
(
38-
r#"normalize-stderr-32bit: "something (32 bits)" -> "something ($WORD bits)""#,
39-
"something (32 bits)",
40-
"something ($WORD bits)",
41-
),
42-
// FIXME(#126370): A colon after the header name should be mandatory,
43-
// but currently is not, and there are many tests that lack the colon.
44-
(
45-
r#"normalize-stderr-32bit "something (32 bits)" -> "something ($WORD bits)""#,
46-
"something (32 bits)",
47-
"something ($WORD bits)",
48-
),
49-
];
36+
let good_data = &[(
37+
r#"normalize-stderr-32bit: "something (32 bits)" -> "something ($WORD bits)""#,
38+
"something (32 bits)",
39+
"something ($WORD bits)",
40+
)];
5041

5142
for &(input, expected_regex, expected_replacement) in good_data {
5243
let parsed = parse_normalize_rule(input);
@@ -56,6 +47,7 @@ fn test_parse_normalize_rule() {
5647
}
5748

5849
let bad_data = &[
50+
r#"normalize-stderr-32bit "something (32 bits)" -> "something ($WORD bits)""#,
5951
r#"normalize-stderr-16bit: something (16 bits) -> something ($WORD bits)"#,
6052
r#"normalize-stderr-32bit: something (32 bits) -> something ($WORD bits)"#,
6153
r#"normalize-stderr-32bit: "something (32 bits) -> something ($WORD bits)"#,

Diff for: 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-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
44

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

Diff for: tests/rustdoc-ui/doctest/cfg-test.rs

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

Diff for: tests/rustdoc-ui/doctest/check-cfg-test.rs

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

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

Diff for: tests/rustdoc-ui/doctest/display-output.rs

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

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

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

+1-1
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
33
//@ normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
4-
//@ normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
4+
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
55
//@ check-pass
66

77
//! ```rust

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

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

66
/// ```

Diff for: tests/rustdoc-ui/doctest/doc-test-doctest-feature.rs

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

Diff for: tests/rustdoc-ui/doctest/doc-test-rustdoc-feature.rs

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

66
#![feature(doc_cfg)]
77

Diff for: tests/rustdoc-ui/doctest/doctest-multiline-crate-attribute.rs

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

66
/// ```

Diff for: tests/rustdoc-ui/doctest/doctest-output.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//@ aux-build:extern_macros.rs
33
//@ compile-flags:--test --test-args=--test-threads=1
44
//@ normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
5-
//@ normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
5+
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
66
//@ check-pass
77

88
//! ```

Diff for: tests/rustdoc-ui/doctest/failed-doctest-compile-fail.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

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

99
/// ```compile_fail

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

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

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

Diff for: tests/rustdoc-ui/doctest/failed-doctest-missing-codes.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

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

99
/// ```compile_fail,E0004

Diff for: tests/rustdoc-ui/doctest/failed-doctest-output-windows.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
//@ compile-flags:--test --test-args --test-threads=1
99
//@ rustc-env:RUST_BACKTRACE=0
1010
//@ normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
11-
//@ normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
11+
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
1212
//@ failure-status: 101
1313

1414
// doctest fails at runtime

Diff for: tests/rustdoc-ui/doctest/failed-doctest-output.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
//@ compile-flags:--test --test-args --test-threads=1
99
//@ rustc-env:RUST_BACKTRACE=0
1010
//@ normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
11-
//@ normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
11+
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
1212
//@ failure-status: 101
1313

1414
// doctest fails at runtime

Diff for: tests/rustdoc-ui/doctest/failed-doctest-should-panic.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

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

99
/// ```should_panic

Diff for: tests/rustdoc-ui/doctest/no-run-flag.rs

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

88
/// ```
99
/// let a = true;

Diff for: tests/rustdoc-ui/doctest/nocapture-fail.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//@ compile-flags:--test -Zunstable-options --nocapture
33
//@ normalize-stderr-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
44
//@ normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
5-
//@ normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
5+
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
66

77
/// ```compile_fail
88
/// fn foo() {

Diff for: tests/rustdoc-ui/doctest/nocapture.rs

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

66
/// ```
77
/// println!("hello!");

Diff for: tests/rustdoc-ui/doctest/non-local-defs-impl.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//@ aux-build:pub_trait.rs
55
//@ compile-flags: --test --test-args --test-threads=1
66
//@ normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
7-
//@ normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
7+
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
88

99
#![doc(test(attr(deny(non_local_definitions))))]
1010
#![doc(test(attr(allow(dead_code))))]

Diff for: tests/rustdoc-ui/doctest/non_local_defs.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//@ compile-flags:--test --test-args --test-threads=1 --nocapture -Zunstable-options
33
//@ normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
44
//@ normalize-stderr-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
5-
//@ normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
5+
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
66

77
#![doc(test(attr(warn(non_local_definitions))))]
88

Diff for: tests/rustdoc-ui/doctest/run-directory.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
//@ [correct]compile-flags:--test --test-run-directory={{src-base}}
66
//@ [incorrect]compile-flags:--test --test-run-directory={{src-base}}/coverage
77
//@ normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
8-
//@ normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
8+
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
99

1010
/// ```
1111
/// assert_eq!(

Diff for: tests/rustdoc-ui/doctest/test-no_std.rs

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

66
#![no_std]

Diff for: tests/rustdoc-ui/doctest/test-type.rs

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

66
/// ```
77
/// let a = true;

Diff for: tests/rustdoc-ui/doctest/unparseable-doc-test.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//@ compile-flags: --test
22
//@ normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
3-
//@ normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
3+
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
44
//@ failure-status: 101
55
//@ rustc-env: RUST_BACKTRACE=0
66

Diff for: tests/rustdoc-ui/ice-bug-report-url.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
//@ error-pattern: aborting due to
55
//@ error-pattern: we would appreciate a bug report: https://github.com./rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-rustdoc&template=ice.md
66

7-
//@ normalize-stderr-test "note: compiler flags.*\n\n" -> ""
8-
//@ normalize-stderr-test "note: rustc.*running on.*" -> "note: rustc {version} running on {platform}"
9-
//@ normalize-stderr-test "thread.*panicked at compiler.*" -> ""
10-
//@ normalize-stderr-test " +\d{1,}: .*\n" -> ""
11-
//@ normalize-stderr-test " + at .*\n" -> ""
12-
//@ normalize-stderr-test ".*note: Some details are omitted.*\n" -> ""
7+
//@ normalize-stderr-test: "note: compiler flags.*\n\n" -> ""
8+
//@ normalize-stderr-test: "note: rustc.*running on.*" -> "note: rustc {version} running on {platform}"
9+
//@ normalize-stderr-test: "thread.*panicked at compiler.*" -> ""
10+
//@ normalize-stderr-test: " +\d{1,}: .*\n" -> ""
11+
//@ normalize-stderr-test: " + at .*\n" -> ""
12+
//@ normalize-stderr-test: ".*note: Some details are omitted.*\n" -> ""
1313

1414
fn wrong()
1515
//~^ ERROR expected one of

Diff for: tests/rustdoc-ui/issues/issue-80992.rs

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

66
pub fn test() -> Result<(), ()> {
77
//! ```compile_fail

Diff for: tests/rustdoc-ui/issues/issue-81662-shortness.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//@ check-stdout
33
//@ error-pattern:cannot find function `foo` in this scope
44
//@ normalize-stdout-test: "tests/rustdoc-ui/issues" -> "$$DIR"
5-
//@ normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
5+
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
66
//@ failure-status: 101
77

88
/// ```rust

Diff for: tests/rustdoc-ui/issues/issue-91134.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//@ aux-build:empty-fn.rs
33
//@ check-pass
44
//@ normalize-stdout-test: "tests/rustdoc-ui/issues" -> "$$DIR"
5-
//@ normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
5+
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
66
//@ edition:2021
77

88
/// <https://github.com./rust-lang/rust/issues/91134>

Diff for: tests/rustdoc-ui/remap-path-prefix-failed-doctest-output.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
//@ failure-status: 101
55
//@ compile-flags:--test -Z unstable-options --remap-path-prefix={{src-base}}=remapped_path --test-args --test-threads=1
66
//@ rustc-env:RUST_BACKTRACE=0
7-
//@ normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
8-
//@ normalize-stdout-test "exit (status|code): 101" -> "exit status: 101"
7+
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
8+
//@ normalize-stdout-test: "exit (status|code): 101" -> "exit status: 101"
99

1010
// doctest fails at runtime
1111
/// ```

Diff for: tests/rustdoc-ui/remap-path-prefix-invalid-doctest.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//@ failure-status: 101
55
//@ compile-flags:--test -Z unstable-options --remap-path-prefix={{src-base}}=remapped_path --test-args --test-threads=1
66
//@ rustc-env:RUST_BACKTRACE=0
7-
//@ normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
7+
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
88

99
// doctest fails to compile
1010
/// ```

Diff for: tests/rustdoc-ui/remap-path-prefix-passed-doctest-output.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// adapted to use that, and that normalize line can go away
66

77
//@ compile-flags:--test -Z unstable-options --remap-path-prefix={{src-base}}=remapped_path --test-args --test-threads=1
8-
//@ normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
8+
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
99

1010
// doctest passes at runtime
1111
/// ```

Diff for: tests/rustdoc-ui/track-diagnostics.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
// Normalize the emitted location so this doesn't need
55
// updating everytime someone adds or removes a line.
6-
//@ normalize-stderr-test ".rs:\d+:\d+" -> ".rs:LL:CC"
6+
//@ normalize-stderr-test: ".rs:\d+:\d+" -> ".rs:LL:CC"
77

88
struct A;
99
struct B;

Diff for: tests/ui-fulldeps/fluent-messages/test.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//@ normalize-stderr-test "could not open Fluent resource:.*" -> "could not open Fluent resource: os-specific message"
1+
//@ normalize-stderr-test: "could not open Fluent resource:.*" -> "could not open Fluent resource: os-specific message"
22

33
#![feature(rustc_private)]
44
#![crate_type = "lib"]

Diff for: tests/ui-fulldeps/missing-rustc-driver-error.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Test that we get the following hint when trying to use a compiler crate without rustc_driver.
22
//@ error-pattern: try adding `extern crate rustc_driver;` at the top level of this crate
33
//@ compile-flags: --emit link
4-
//@ normalize-stderr-test ".*crate .* required.*\n\n" -> ""
4+
//@ normalize-stderr-test: ".*crate .* required.*\n\n" -> ""
55
//@ normalize-stderr-test: "aborting due to [0-9]+" -> "aborting due to NUMBER"
66

77
#![feature(rustc_private)]

Diff for: tests/ui-fulldeps/session-diagnostic/diagnostic-derive-doc-comment-field.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//@ check-fail
22
// Tests that a doc comment will not preclude a field from being considered a diagnostic argument
3-
//@ normalize-stderr-test "the following other types implement trait `IntoDiagArg`:(?:.*\n){0,9}\s+and \d+ others" -> "normalized in stderr"
4-
//@ normalize-stderr-test "(COMPILER_DIR/.*\.rs):[0-9]+:[0-9]+" -> "$1:LL:CC"
3+
//@ normalize-stderr-test: "the following other types implement trait `IntoDiagArg`:(?:.*\n){0,9}\s+and \d+ others" -> "normalized in stderr"
4+
//@ normalize-stderr-test: "(COMPILER_DIR/.*\.rs):[0-9]+:[0-9]+" -> "$1:LL:CC"
55

66
// The proc_macro2 crate handles spans differently when on beta/stable release rather than nightly,
77
// changing the output of this test. Since Subdiagnostic is strictly internal to the compiler

Diff for: tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//@ check-fail
22
// Tests error conditions for specifying diagnostics using #[derive(Diagnostic)]
3-
//@ normalize-stderr-test "the following other types implement trait `IntoDiagArg`:(?:.*\n){0,9}\s+and \d+ others" -> "normalized in stderr"
4-
//@ normalize-stderr-test "(COMPILER_DIR/.*\.rs):[0-9]+:[0-9]+" -> "$1:LL:CC"
3+
//@ normalize-stderr-test: "the following other types implement trait `IntoDiagArg`:(?:.*\n){0,9}\s+and \d+ others" -> "normalized in stderr"
4+
//@ normalize-stderr-test: "(COMPILER_DIR/.*\.rs):[0-9]+:[0-9]+" -> "$1:LL:CC"
55

66
// The proc_macro2 crate handles spans differently when on beta/stable release rather than nightly,
77
// changing the output of this test. Since Diagnostic is strictly internal to the compiler

0 commit comments

Comments
 (0)