Skip to content

Commit

Permalink
Auto merge of #126777 - Zalathar:normalize-colon, r=lcnr
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bors committed Jul 11, 2024
2 parents 9b00430 + b677359 commit fdf7ea6
Show file tree
Hide file tree
Showing 134 changed files with 235 additions and 245 deletions.
4 changes: 1 addition & 3 deletions src/tools/compiletest/src/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1121,13 +1121,11 @@ fn expand_variables(mut value: String, config: &Config) -> String {
/// normalize-*: "REGEX" -> "REPLACEMENT"
/// ```
fn parse_normalize_rule(header: &str) -> Option<(String, String)> {
// FIXME(#126370): A colon after the header name should be mandatory, but
// currently is not, and there are many tests that lack the colon.
// FIXME: Support escaped double-quotes in strings.
let captures = static_regex!(
r#"(?x) # (verbose mode regex)
^
[^:\s]+:?\s* # (header name followed by optional colon)
[^:\s]+:\s* # (header name followed by colon)
"(?<regex>[^"]*)" # "REGEX"
\s+->\s+ # ->
"(?<replacement>[^"]*)" # "REPLACEMENT"
Expand Down
20 changes: 6 additions & 14 deletions src/tools/compiletest/src/header/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,11 @@ fn make_test_description<R: Read>(

#[test]
fn test_parse_normalize_rule() {
let good_data = &[
(
r#"normalize-stderr-32bit: "something (32 bits)" -> "something ($WORD bits)""#,
"something (32 bits)",
"something ($WORD bits)",
),
// FIXME(#126370): A colon after the header name should be mandatory,
// but currently is not, and there are many tests that lack the colon.
(
r#"normalize-stderr-32bit "something (32 bits)" -> "something ($WORD bits)""#,
"something (32 bits)",
"something ($WORD bits)",
),
];
let good_data = &[(
r#"normalize-stderr-32bit: "something (32 bits)" -> "something ($WORD bits)""#,
"something (32 bits)",
"something ($WORD bits)",
)];

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

let bad_data = &[
r#"normalize-stderr-32bit "something (32 bits)" -> "something ($WORD bits)""#,
r#"normalize-stderr-16bit: something (16 bits) -> something ($WORD bits)"#,
r#"normalize-stderr-32bit: something (32 bits) -> something ($WORD bits)"#,
r#"normalize-stderr-32bit: "something (32 bits) -> something ($WORD bits)"#,
Expand Down
2 changes: 1 addition & 1 deletion tests/rustdoc-ui/doctest/block-doc-comment.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//@ check-pass
//@ compile-flags:--test
//@ normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"

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

Expand Down
2 changes: 1 addition & 1 deletion tests/rustdoc-ui/doctest/cfg-test.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//@ check-pass
//@ compile-flags:--test --test-args --test-threads=1
//@ normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
//@ normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"

// Crates like core have doctests gated on `cfg(not(test))` so we need to make
// sure `cfg(test)` is not active when running `rustdoc --test`.
Expand Down
2 changes: 1 addition & 1 deletion tests/rustdoc-ui/doctest/check-cfg-test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//@ compile-flags: --test --nocapture --check-cfg=cfg(feature,values("test")) -Z unstable-options
//@ normalize-stderr-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
//@ normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
//@ normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"

/// The doctest will produce a warning because feature invalid is unexpected
/// ```
Expand Down
2 changes: 1 addition & 1 deletion tests/rustdoc-ui/doctest/display-output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//@ edition:2018
//@ compile-flags:--test --test-args=--show-output
//@ normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
//@ normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"

/// ```
/// #![warn(unused)]
Expand Down
2 changes: 1 addition & 1 deletion tests/rustdoc-ui/doctest/doc-comment-multi-line-attr.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Regression test for #97440: Multiline inner attribute triggers ICE during doctest
//@ compile-flags:--test
//@ normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
//@ normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ check-pass

//! ```rust
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//@ compile-flags:--test
//@ normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
//@ normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ check-pass

/// ```
Expand Down
2 changes: 1 addition & 1 deletion tests/rustdoc-ui/doctest/doc-test-doctest-feature.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//@ check-pass
//@ compile-flags:--test
//@ normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
//@ normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"

// Make sure `cfg(doctest)` is set when finding doctests but not inside
// the doctests.
Expand Down
2 changes: 1 addition & 1 deletion tests/rustdoc-ui/doctest/doc-test-rustdoc-feature.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//@ check-pass
//@ compile-flags:--test
//@ normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
//@ normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"

#![feature(doc_cfg)]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//@ compile-flags:--test --test-args=--test-threads=1
//@ normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
//@ normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ check-pass

/// ```
Expand Down
2 changes: 1 addition & 1 deletion tests/rustdoc-ui/doctest/doctest-output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//@ aux-build:extern_macros.rs
//@ compile-flags:--test --test-args=--test-threads=1
//@ normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
//@ normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ check-pass

//! ```
Expand Down
2 changes: 1 addition & 1 deletion tests/rustdoc-ui/doctest/failed-doctest-compile-fail.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

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

/// ```compile_fail
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

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

/// <https://github.com/rust-lang/rust/issues/91014>
Expand Down
2 changes: 1 addition & 1 deletion tests/rustdoc-ui/doctest/failed-doctest-missing-codes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

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

/// ```compile_fail,E0004
Expand Down
2 changes: 1 addition & 1 deletion tests/rustdoc-ui/doctest/failed-doctest-output-windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
//@ compile-flags:--test --test-args --test-threads=1
//@ rustc-env:RUST_BACKTRACE=0
//@ normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
//@ normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ failure-status: 101

// doctest fails at runtime
Expand Down
2 changes: 1 addition & 1 deletion tests/rustdoc-ui/doctest/failed-doctest-output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
//@ compile-flags:--test --test-args --test-threads=1
//@ rustc-env:RUST_BACKTRACE=0
//@ normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
//@ normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ failure-status: 101

// doctest fails at runtime
Expand Down
2 changes: 1 addition & 1 deletion tests/rustdoc-ui/doctest/failed-doctest-should-panic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

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

/// ```should_panic
Expand Down
2 changes: 1 addition & 1 deletion tests/rustdoc-ui/doctest/no-run-flag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//@ check-pass
//@ compile-flags:-Z unstable-options --test --no-run --test-args=--test-threads=1
//@ normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
//@ normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"

/// ```
/// let a = true;
Expand Down
2 changes: 1 addition & 1 deletion tests/rustdoc-ui/doctest/nocapture-fail.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//@ compile-flags:--test -Zunstable-options --nocapture
//@ normalize-stderr-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
//@ normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
//@ normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"

/// ```compile_fail
/// fn foo() {
Expand Down
2 changes: 1 addition & 1 deletion tests/rustdoc-ui/doctest/nocapture.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//@ check-pass
//@ compile-flags:--test -Zunstable-options --nocapture
//@ normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
//@ normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"

/// ```
/// println!("hello!");
Expand Down
2 changes: 1 addition & 1 deletion tests/rustdoc-ui/doctest/non-local-defs-impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//@ aux-build:pub_trait.rs
//@ compile-flags: --test --test-args --test-threads=1
//@ normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
//@ normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"

#![doc(test(attr(deny(non_local_definitions))))]
#![doc(test(attr(allow(dead_code))))]
Expand Down
2 changes: 1 addition & 1 deletion tests/rustdoc-ui/doctest/non_local_defs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//@ compile-flags:--test --test-args --test-threads=1 --nocapture -Zunstable-options
//@ normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
//@ normalize-stderr-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
//@ normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"

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

Expand Down
2 changes: 1 addition & 1 deletion tests/rustdoc-ui/doctest/run-directory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
//@ [correct]compile-flags:--test --test-run-directory={{src-base}}
//@ [incorrect]compile-flags:--test --test-run-directory={{src-base}}/coverage
//@ normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
//@ normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"

/// ```
/// assert_eq!(
Expand Down
2 changes: 1 addition & 1 deletion tests/rustdoc-ui/doctest/test-no_std.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//@ compile-flags:--test
//@ normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
//@ normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ check-pass

#![no_std]
Expand Down
2 changes: 1 addition & 1 deletion tests/rustdoc-ui/doctest/test-type.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//@ compile-flags: --test --test-args=--test-threads=1
//@ check-pass
//@ normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
//@ normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"

/// ```
/// let a = true;
Expand Down
2 changes: 1 addition & 1 deletion tests/rustdoc-ui/doctest/unparseable-doc-test.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//@ compile-flags: --test
//@ normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
//@ normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ failure-status: 101
//@ rustc-env: RUST_BACKTRACE=0

Expand Down
12 changes: 6 additions & 6 deletions tests/rustdoc-ui/ice-bug-report-url.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
//@ error-pattern: aborting due to
//@ 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

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

fn wrong()
//~^ ERROR expected one of
2 changes: 1 addition & 1 deletion tests/rustdoc-ui/issues/issue-80992.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//@ check-pass
//@ compile-flags:--test
//@ normalize-stdout-test: "tests/rustdoc-ui/issues" -> "$$DIR"
//@ normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"

pub fn test() -> Result<(), ()> {
//! ```compile_fail
Expand Down
2 changes: 1 addition & 1 deletion tests/rustdoc-ui/issues/issue-81662-shortness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//@ check-stdout
//@ error-pattern:cannot find function `foo` in this scope
//@ normalize-stdout-test: "tests/rustdoc-ui/issues" -> "$$DIR"
//@ normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ failure-status: 101

/// ```rust
Expand Down
2 changes: 1 addition & 1 deletion tests/rustdoc-ui/issues/issue-91134.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//@ aux-build:empty-fn.rs
//@ check-pass
//@ normalize-stdout-test: "tests/rustdoc-ui/issues" -> "$$DIR"
//@ normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ edition:2021

/// <https://github.com/rust-lang/rust/issues/91134>
Expand Down
4 changes: 2 additions & 2 deletions tests/rustdoc-ui/remap-path-prefix-failed-doctest-output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
//@ failure-status: 101
//@ compile-flags:--test -Z unstable-options --remap-path-prefix={{src-base}}=remapped_path --test-args --test-threads=1
//@ rustc-env:RUST_BACKTRACE=0
//@ normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ normalize-stdout-test "exit (status|code): 101" -> "exit status: 101"
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ normalize-stdout-test: "exit (status|code): 101" -> "exit status: 101"

// doctest fails at runtime
/// ```
Expand Down
2 changes: 1 addition & 1 deletion tests/rustdoc-ui/remap-path-prefix-invalid-doctest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//@ failure-status: 101
//@ compile-flags:--test -Z unstable-options --remap-path-prefix={{src-base}}=remapped_path --test-args --test-threads=1
//@ rustc-env:RUST_BACKTRACE=0
//@ normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"

// doctest fails to compile
/// ```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// adapted to use that, and that normalize line can go away

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

// doctest passes at runtime
/// ```
Expand Down
2 changes: 1 addition & 1 deletion tests/rustdoc-ui/track-diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

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

struct A;
struct B;
Expand Down
2 changes: 1 addition & 1 deletion tests/ui-fulldeps/fluent-messages/test.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ normalize-stderr-test "could not open Fluent resource:.*" -> "could not open Fluent resource: os-specific message"
//@ normalize-stderr-test: "could not open Fluent resource:.*" -> "could not open Fluent resource: os-specific message"

#![feature(rustc_private)]
#![crate_type = "lib"]
Expand Down
2 changes: 1 addition & 1 deletion tests/ui-fulldeps/missing-rustc-driver-error.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Test that we get the following hint when trying to use a compiler crate without rustc_driver.
//@ error-pattern: try adding `extern crate rustc_driver;` at the top level of this crate
//@ compile-flags: --emit link
//@ normalize-stderr-test ".*crate .* required.*\n\n" -> ""
//@ normalize-stderr-test: ".*crate .* required.*\n\n" -> ""
//@ normalize-stderr-test: "aborting due to [0-9]+" -> "aborting due to NUMBER"

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

// The proc_macro2 crate handles spans differently when on beta/stable release rather than nightly,
// changing the output of this test. Since Subdiagnostic is strictly internal to the compiler
Expand Down
4 changes: 2 additions & 2 deletions tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//@ check-fail
// Tests error conditions for specifying diagnostics using #[derive(Diagnostic)]
//@ normalize-stderr-test "the following other types implement trait `IntoDiagArg`:(?:.*\n){0,9}\s+and \d+ others" -> "normalized in stderr"
//@ normalize-stderr-test "(COMPILER_DIR/.*\.rs):[0-9]+:[0-9]+" -> "$1:LL:CC"
//@ normalize-stderr-test: "the following other types implement trait `IntoDiagArg`:(?:.*\n){0,9}\s+and \d+ others" -> "normalized in stderr"
//@ normalize-stderr-test: "(COMPILER_DIR/.*\.rs):[0-9]+:[0-9]+" -> "$1:LL:CC"

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

0 comments on commit fdf7ea6

Please sign in to comment.