Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/tools/compiletest/src/directive-list.rs
Original file line number Diff line number Diff line change
@@ -160,10 +160,10 @@ const KNOWN_DIRECTIVE_NAMES: &[&str] = &[
"needs-xray",
"no-auto-check-cfg",
"no-prefer-dynamic",
"normalize-stderr",
"normalize-stderr-32bit",
"normalize-stderr-64bit",
"normalize-stderr-test",
"normalize-stdout-test",
"normalize-stdout",
"only-16bit",
"only-32bit",
"only-64bit",
61 changes: 47 additions & 14 deletions src/tools/compiletest/src/header.rs
Original file line number Diff line number Diff line change
@@ -12,7 +12,6 @@ use tracing::*;
use crate::common::{Config, Debugger, FailMode, Mode, PassMode};
use crate::debuggers::{extract_cdb_version, extract_gdb_version};
use crate::header::auxiliary::{AuxProps, parse_and_update_aux};
use crate::header::cfg::{MatchOutcome, parse_cfg_name_directive};
use crate::header::needs::CachedNeedsConditions;
use crate::util::static_regex;

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

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

if let Some(rule) = config.parse_custom_normalization(ln, "normalize-stdout") {
self.normalize_stdout.push(rule);
}
if let Some(rule) = config.parse_custom_normalization(ln, "normalize-stderr") {
self.normalize_stderr.push(rule);
if let Some(NormalizeRule { kind, regex, replacement }) =
config.parse_custom_normalization(ln)
{
let rule_tuple = (regex, replacement);
match kind {
NormalizeKind::Stdout => self.normalize_stdout.push(rule_tuple),
NormalizeKind::Stderr => self.normalize_stderr.push(rule_tuple),
NormalizeKind::Stderr32bit => {
if config.target_cfg().pointer_width == 32 {
self.normalize_stderr.push(rule_tuple);
}
}
NormalizeKind::Stderr64bit => {
if config.target_cfg().pointer_width == 64 {
self.normalize_stderr.push(rule_tuple);
}
}
}
}

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

fn parse_custom_normalization(&self, line: &str, prefix: &str) -> Option<(String, String)> {
let parsed = parse_cfg_name_directive(self, line, prefix);
if parsed.outcome != MatchOutcome::Match {
return None;
}
let name = parsed.name.expect("successful match always has a name");
fn parse_custom_normalization(&self, line: &str) -> Option<NormalizeRule> {
// FIXME(Zalathar): Integrate name/value splitting into `DirectiveLine`
// instead of doing it here.
let (directive_name, _value) = line.split_once(':')?;

let kind = match directive_name {
"normalize-stdout" => NormalizeKind::Stdout,
"normalize-stderr" => NormalizeKind::Stderr,
"normalize-stderr-32bit" => NormalizeKind::Stderr32bit,
"normalize-stderr-64bit" => NormalizeKind::Stderr64bit,
_ => return None,
};

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

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

struct NormalizeRule {
kind: NormalizeKind,
regex: String,
replacement: String,
}

enum NormalizeKind {
Stdout,
Stderr,
Stderr32bit,
Stderr64bit,
}

/// Parses the regex and replacement values of a `//@ normalize-*` header,
/// in the format:
/// ```text
4 changes: 2 additions & 2 deletions src/tools/compiletest/src/header/cfg.rs
Original file line number Diff line number Diff line change
@@ -40,8 +40,8 @@ pub(super) fn handle_only(config: &Config, line: &str) -> IgnoreDecision {
}

/// Parses a name-value directive which contains config-specific information, e.g., `ignore-x86`
/// or `normalize-stderr-32bit`.
pub(super) fn parse_cfg_name_directive<'a>(
/// or `only-windows`.
fn parse_cfg_name_directive<'a>(
config: &Config,
line: &'a str,
prefix: &str,
7 changes: 3 additions & 4 deletions src/tools/tidy/src/style.rs
Original file line number Diff line number Diff line change
@@ -69,8 +69,7 @@ const ANNOTATIONS_TO_IGNORE: &[&str] = &[
"// gdb",
"// lldb",
"// cdb",
"// normalize-stderr-test",
"//@ normalize-stderr-test",
"//@ normalize-stderr",
];

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

// For `ui_test`-style UI test directives, also ignore
// - `//@[rev] compile-flags`
// - `//@[rev] normalize-stderr-test`
|| static_regex!("\\s*//@(\\[.*\\]) (compile-flags|normalize-stderr-test|error-pattern).*")
// - `//@[rev] normalize-stderr`
|| static_regex!("\\s*//@(\\[.*\\]) (compile-flags|normalize-stderr|error-pattern).*")
.is_match(line)
// Matching for rustdoc tests commands.
// It allows to prevent them emitting warnings like `line longer than 100 chars`.
6 changes: 3 additions & 3 deletions tests/rustdoc-ui/2024-doctests-checks.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
//@ check-pass
//@ edition: 2024
//@ compile-flags: --test --test-args=--test-threads=1
//@ normalize-stdout-test: "tests/rustdoc-ui" -> "$$DIR"
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ normalize-stdout-test: ".rs:\d+:\d+" -> ".rs:$$LINE:$$COL"
//@ normalize-stdout: "tests/rustdoc-ui" -> "$$DIR"
//@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ normalize-stdout: ".rs:\d+:\d+" -> ".rs:$$LINE:$$COL"

/// ```
/// let x = 12;
6 changes: 3 additions & 3 deletions tests/rustdoc-ui/2024-doctests-crate-attribute.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
//@ check-pass
//@ edition: 2024
//@ compile-flags: --test --test-args=--test-threads=1
//@ normalize-stdout-test: "tests/rustdoc-ui" -> "$$DIR"
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ normalize-stdout-test: ".rs:\d+:\d+" -> ".rs:$$LINE:$$COL"
//@ normalize-stdout: "tests/rustdoc-ui" -> "$$DIR"
//@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ normalize-stdout: ".rs:\d+:\d+" -> ".rs:$$LINE:$$COL"

/// This doctest is used to ensure that if a crate attribute is present,
/// it will not be part of the merged doctests.
Original file line number Diff line number Diff line change
@@ -5,8 +5,8 @@
// line arguments and is only run on windows.
//
//@ only-windows
//@ normalize-stderr-test: "os error \d+" -> "os error $$ERR"
//@ normalize-stderr-test: "commandline-argfile-missing.args:[^(]*" -> "commandline-argfile-missing.args: $$FILE_MISSING "
//@ normalize-stderr: "os error \d+" -> "os error $$ERR"
//@ normalize-stderr: "commandline-argfile-missing.args:[^(]*" -> "commandline-argfile-missing.args: $$FILE_MISSING "
//@ compile-flags: --cfg cmdline_set @{{src-base}}\argfile\commandline-argfile-missing.args

#[cfg(not(cmdline_set))]
4 changes: 2 additions & 2 deletions tests/rustdoc-ui/argfile/commandline-argfile-missing.rs
Original file line number Diff line number Diff line change
@@ -6,8 +6,8 @@
// windows.
//
//@ ignore-windows
//@ normalize-stderr-test: "os error \d+" -> "os error $$ERR"
//@ normalize-stderr-test: "commandline-argfile-missing.args:[^(]*" -> "commandline-argfile-missing.args: $$FILE_MISSING "
//@ normalize-stderr: "os error \d+" -> "os error $$ERR"
//@ normalize-stderr: "commandline-argfile-missing.args:[^(]*" -> "commandline-argfile-missing.args: $$FILE_MISSING "
//@ compile-flags: --cfg cmdline_set @{{src-base}}/argfile/commandline-argfile-missing.args

#[cfg(not(cmdline_set))]
Original file line number Diff line number Diff line change
@@ -5,9 +5,9 @@
// line arguments and is only run on windows.
//
//@ only-windows
//@ normalize-stderr-test: "os error \d+" -> "os error $$ERR"
//@ normalize-stderr-test: "commandline-argfile-missing.args:[^(]*" -> "commandline-argfile-missing.args: $$FILE_MISSING "
//@ normalize-stderr-test: "commandline-argfile-missing2.args:[^(]*" -> "commandline-argfile-missing2.args: $$FILE_MISSING "
//@ normalize-stderr: "os error \d+" -> "os error $$ERR"
//@ normalize-stderr: "commandline-argfile-missing.args:[^(]*" -> "commandline-argfile-missing.args: $$FILE_MISSING "
//@ normalize-stderr: "commandline-argfile-missing2.args:[^(]*" -> "commandline-argfile-missing2.args: $$FILE_MISSING "
//@ 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

#[cfg(not(cmdline_set))]
6 changes: 3 additions & 3 deletions tests/rustdoc-ui/argfile/commandline-argfile-multiple.rs
Original file line number Diff line number Diff line change
@@ -6,9 +6,9 @@
// windows.
//
//@ ignore-windows
//@ normalize-stderr-test: "os error \d+" -> "os error $$ERR"
//@ normalize-stderr-test: "commandline-argfile-missing.args:[^(]*" -> "commandline-argfile-missing.args: $$FILE_MISSING "
//@ normalize-stderr-test: "commandline-argfile-missing2.args:[^(]*" -> "commandline-argfile-missing2.args: $$FILE_MISSING "
//@ normalize-stderr: "os error \d+" -> "os error $$ERR"
//@ normalize-stderr: "commandline-argfile-missing.args:[^(]*" -> "commandline-argfile-missing.args: $$FILE_MISSING "
//@ normalize-stderr: "commandline-argfile-missing2.args:[^(]*" -> "commandline-argfile-missing2.args: $$FILE_MISSING "
//@ 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

#[cfg(not(cmdline_set))]
2 changes: 1 addition & 1 deletion tests/rustdoc-ui/disambiguator-endswith-named-suffix.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//@ check-pass
//@ normalize-stderr-test: "nightly|beta|1\.[0-9][0-9]\.[0-9]" -> "$$CHANNEL"
//@ normalize-stderr: "nightly|beta|1\.[0-9][0-9]\.[0-9]" -> "$$CHANNEL"

//! [struct@m!()] //~ WARN: unmatched disambiguator `struct` and suffix `!()`
//! [struct@m!{}]
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: "finished in \d+\.\d+s" -> "finished in $$TIME"

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

4 changes: 2 additions & 2 deletions 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: "tests/rustdoc-ui/doctest" -> "$$DIR"
//@ normalize-stdout: "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`.
6 changes: 3 additions & 3 deletions tests/rustdoc-ui/doctest/check-cfg-test.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//@ check-pass
//@ 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-stderr: "tests/rustdoc-ui/doctest" -> "$$DIR"
//@ normalize-stdout: "tests/rustdoc-ui/doctest" -> "$$DIR"
//@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"

/// The doctest will produce a warning because feature invalid is unexpected
/// ```
6 changes: 3 additions & 3 deletions tests/rustdoc-ui/doctest/comment-in-attr-134221-2.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//@ compile-flags:--test --test-args --test-threads=1
//@ failure-status: 101
//@ normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ normalize-stdout-test: ".rs:\d+:\d+" -> ".rs:$$LINE:$$COL"
//@ normalize-stdout: "tests/rustdoc-ui/doctest" -> "$$DIR"
//@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ normalize-stdout: ".rs:\d+:\d+" -> ".rs:$$LINE:$$COL"

//! ```
#![doc = "#![all\
6 changes: 3 additions & 3 deletions tests/rustdoc-ui/doctest/comment-in-attr-134221.rs
Original file line number Diff line number Diff line change
@@ -4,9 +4,9 @@

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

/*!
```rust
4 changes: 2 additions & 2 deletions tests/rustdoc-ui/doctest/dead-code-2024.rs
Original file line number Diff line number Diff line change
@@ -2,8 +2,8 @@

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

#![doc(test(attr(allow(unused_variables), deny(warnings))))]
4 changes: 2 additions & 2 deletions tests/rustdoc-ui/doctest/dead-code.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// This test ensures that the doctest will not use `#[allow(unused)]`.

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

#![doc(test(attr(allow(unused_variables), deny(warnings))))]
4 changes: 2 additions & 2 deletions tests/rustdoc-ui/doctest/display-output.rs
Original file line number Diff line number Diff line change
@@ -3,8 +3,8 @@
//@ check-pass
//@ 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: "tests/rustdoc-ui/doctest" -> "$$DIR"
//@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"

/// ```
/// #![warn(unused)]
4 changes: 2 additions & 2 deletions 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: "tests/rustdoc-ui/doctest" -> "$$DIR"
//@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ check-pass

//! ```rust
4 changes: 2 additions & 2 deletions tests/rustdoc-ui/doctest/doc-comment-multi-line-cfg-attr.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: "tests/rustdoc-ui/doctest" -> "$$DIR"
//@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ check-pass

/// ```
4 changes: 2 additions & 2 deletions 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: "tests/rustdoc-ui/doctest" -> "$$DIR"
//@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"

// Make sure `cfg(doctest)` is set when finding doctests but not inside
// the doctests.
4 changes: 2 additions & 2 deletions 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: "tests/rustdoc-ui/doctest" -> "$$DIR"
//@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"

#![feature(doc_cfg)]

4 changes: 2 additions & 2 deletions tests/rustdoc-ui/doctest/doctest-multiline-crate-attribute.rs
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: "tests/rustdoc-ui/doctest" -> "$$DIR"
//@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ check-pass

/// ```
4 changes: 2 additions & 2 deletions tests/rustdoc-ui/doctest/doctest-output-include-fail.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//@ edition:2024
//@ 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: "tests/rustdoc-ui/doctest" -> "$$DIR"
//@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ failure-status: 101

// https://github.com/rust-lang/rust/issues/130470
4 changes: 2 additions & 2 deletions tests/rustdoc-ui/doctest/doctest-output.rs
Original file line number Diff line number Diff line change
@@ -5,8 +5,8 @@
//@[edition2024]edition:2015
//@[edition2024]aux-build:extern_macros.rs
//@[edition2024]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: "tests/rustdoc-ui/doctest" -> "$$DIR"
//@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ check-pass

//! ```
4 changes: 2 additions & 2 deletions tests/rustdoc-ui/doctest/failed-doctest-compile-fail.rs
Original file line number Diff line number Diff line change
@@ -2,8 +2,8 @@
// adapted to use that, and that normalize line can go away

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

/// ```compile_fail
Original file line number Diff line number Diff line change
@@ -2,8 +2,8 @@
// adapted to use that, and that normalize line can go away

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

/// <https://github.com/rust-lang/rust/issues/91014>
4 changes: 2 additions & 2 deletions tests/rustdoc-ui/doctest/failed-doctest-missing-codes.rs
Original file line number Diff line number Diff line change
@@ -2,8 +2,8 @@
// adapted to use that, and that normalize line can go away

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

/// ```compile_fail,E0004
4 changes: 2 additions & 2 deletions tests/rustdoc-ui/doctest/failed-doctest-output-windows.rs
Original file line number Diff line number Diff line change
@@ -7,8 +7,8 @@

//@ 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: "tests/rustdoc-ui/doctest" -> "$$DIR"
//@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ failure-status: 101

// doctest fails at runtime
4 changes: 2 additions & 2 deletions tests/rustdoc-ui/doctest/failed-doctest-output.rs
Original file line number Diff line number Diff line change
@@ -7,8 +7,8 @@

//@ 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: "tests/rustdoc-ui/doctest" -> "$$DIR"
//@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ failure-status: 101

// doctest fails at runtime
4 changes: 2 additions & 2 deletions tests/rustdoc-ui/doctest/failed-doctest-should-panic-2021.rs
Original file line number Diff line number Diff line change
@@ -2,8 +2,8 @@
// adapted to use that, and that normalize line can go away

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

/// ```should_panic
4 changes: 2 additions & 2 deletions tests/rustdoc-ui/doctest/failed-doctest-should-panic.rs
Original file line number Diff line number Diff line change
@@ -3,8 +3,8 @@

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

/// ```should_panic
4 changes: 2 additions & 2 deletions tests/rustdoc-ui/doctest/merged-ignore-no_run.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//@ edition: 2024
//@ 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: "tests/rustdoc-ui/doctest" -> "$$DIR"
//@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ check-pass

/// ```ignore (test)
4 changes: 2 additions & 2 deletions tests/rustdoc-ui/doctest/nested-main.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: "tests/rustdoc-ui/doctest" -> "$$DIR"
//@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"

// Regression test for <https://github.com/rust-lang/rust/issues/131893>.
// It ensures that if a function called `main` is nested, it will not consider
4 changes: 2 additions & 2 deletions tests/rustdoc-ui/doctest/no-run-flag.rs
Original file line number Diff line number Diff line change
@@ -2,8 +2,8 @@

//@ 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: "tests/rustdoc-ui/doctest" -> "$$DIR"
//@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"

/// ```
/// let a = true;
6 changes: 3 additions & 3 deletions tests/rustdoc-ui/doctest/nocapture-fail.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//@ check-pass
//@ 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-stderr: "tests/rustdoc-ui/doctest" -> "$$DIR"
//@ normalize-stdout: "tests/rustdoc-ui/doctest" -> "$$DIR"
//@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"

/// ```compile_fail
/// fn foo() {
4 changes: 2 additions & 2 deletions 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: "tests/rustdoc-ui/doctest" -> "$$DIR"
//@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"

/// ```
/// println!("hello!");
4 changes: 2 additions & 2 deletions tests/rustdoc-ui/doctest/non-local-defs-impl.rs
Original file line number Diff line number Diff line change
@@ -3,8 +3,8 @@
//@ failure-status: 101
//@ 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: "tests/rustdoc-ui/doctest" -> "$$DIR"
//@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"

#![doc(test(attr(deny(non_local_definitions))))]
#![doc(test(attr(allow(dead_code))))]
6 changes: 3 additions & 3 deletions tests/rustdoc-ui/doctest/non_local_defs.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//@ check-pass
//@ 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: "tests/rustdoc-ui/doctest" -> "$$DIR"
//@ normalize-stderr: "tests/rustdoc-ui/doctest" -> "$$DIR"
//@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"

//! ```
//! #[macro_export]
Original file line number Diff line number Diff line change
@@ -7,8 +7,8 @@
//@[edition2024]edition:2024
//@[edition2024]check-pass
//@[edition2024]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: "tests/rustdoc-ui/doctest" -> "$$DIR"
//@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"

// https://github.com/rust-lang/rust/issues/132203
// This version, because it's edition2024, passes thanks to the new
4 changes: 2 additions & 2 deletions tests/rustdoc-ui/doctest/run-directory.rs
Original file line number Diff line number Diff line change
@@ -4,8 +4,8 @@
//@ check-pass
//@ [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: "tests/rustdoc-ui/doctest" -> "$$DIR"
//@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"

/// ```
/// assert_eq!(
4 changes: 2 additions & 2 deletions tests/rustdoc-ui/doctest/rustflags-multiple-args.rs
Original file line number Diff line number Diff line change
@@ -4,8 +4,8 @@
//@ check-pass
//@ compile-flags: --test -Zunstable-options --doctest-compilation-args=--cfg=testcase_must_be_present
//@ compile-flags: --doctest-compilation-args=--cfg=another
//@ normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ normalize-stdout: "tests/rustdoc-ui/doctest" -> "$$DIR"
//@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"

/// ```
/// #[cfg(testcase_must_be_present)]
4 changes: 2 additions & 2 deletions tests/rustdoc-ui/doctest/rustflags.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//@ check-pass
//@ compile-flags: --test -Zunstable-options --doctest-compilation-args=--cfg=testcase_must_be_present
//@ normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ normalize-stdout: "tests/rustdoc-ui/doctest" -> "$$DIR"
//@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"

/// ```
/// #[cfg(testcase_must_be_present)]
6 changes: 3 additions & 3 deletions tests/rustdoc-ui/doctest/standalone-warning-2024.rs
Original file line number Diff line number Diff line change
@@ -2,9 +2,9 @@

//@ edition: 2024
//@ 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: ".rs:\d+:\d+" -> ".rs:$$LINE:$$COL"
//@ normalize-stdout: "tests/rustdoc-ui/doctest" -> "$$DIR"
//@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ normalize-stdout: ".rs:\d+:\d+" -> ".rs:$$LINE:$$COL"

#![deny(warnings)]

4 changes: 2 additions & 2 deletions 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: "tests/rustdoc-ui/doctest" -> "$$DIR"
//@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ check-pass

#![no_std]
4 changes: 2 additions & 2 deletions 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: "tests/rustdoc-ui/doctest" -> "$$DIR"
//@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"

/// ```
/// let a = true;
4 changes: 2 additions & 2 deletions 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: "tests/rustdoc-ui/doctest" -> "$$DIR"
//@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ failure-status: 101
//@ rustc-env: RUST_BACKTRACE=0

6 changes: 3 additions & 3 deletions tests/rustdoc-ui/doctest/wrong-ast-2024.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//@ edition: 2024
//@ 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: ".rs:\d+:\d+" -> ".rs:$$LINE:$$COL"
//@ normalize-stdout: "tests/rustdoc-ui/doctest" -> "$$DIR"
//@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ normalize-stdout: ".rs:\d+:\d+" -> ".rs:$$LINE:$$COL"
//@ failure-status: 101

/// ```
4 changes: 2 additions & 2 deletions tests/rustdoc-ui/doctest/wrong-ast.rs
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: "tests/rustdoc-ui/doctest" -> "$$DIR"
//@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ failure-status: 101

/// ```
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//@ normalize-stderr-test: "`.*`" -> "`DEF_ID`"
//@ normalize-stdout-test: "`.*`" -> "`DEF_ID`"
//@ normalize-stderr: "`.*`" -> "`DEF_ID`"
//@ normalize-stdout: "`.*`" -> "`DEF_ID`"
//@ edition:2018

pub async fn f() -> impl std::fmt::Debug {
12 changes: 6 additions & 6 deletions tests/rustdoc-ui/ice-bug-report-url.rs
Original file line number Diff line number Diff line change
@@ -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: "note: compiler flags.*\n\n" -> ""
//@ normalize-stderr: "note: rustc.*running on.*" -> "note: rustc {version} running on {platform}"
//@ normalize-stderr: "thread.*panicked at compiler.*" -> ""
//@ normalize-stderr: " +\d{1,}: .*\n" -> ""
//@ normalize-stderr: " + at .*\n" -> ""
//@ normalize-stderr: ".*note: Some details are omitted.*\n" -> ""

fn wrong()
//~^ ERROR expected one of
2 changes: 1 addition & 1 deletion tests/rustdoc-ui/intra-doc/email-address-localhost.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ normalize-stderr-test: "nightly|beta|1\.[0-9][0-9]\.[0-9]" -> "$$CHANNEL"
//@ normalize-stderr: "nightly|beta|1\.[0-9][0-9]\.[0-9]" -> "$$CHANNEL"
//@ check-pass
#![deny(warnings)]

2 changes: 1 addition & 1 deletion tests/rustdoc-ui/intra-doc/unknown-disambiguator.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ normalize-stderr-test: "nightly|beta|1\.[0-9][0-9]\.[0-9]" -> "$$CHANNEL"
//@ normalize-stderr: "nightly|beta|1\.[0-9][0-9]\.[0-9]" -> "$$CHANNEL"
#![deny(warnings)]

//! Linking to [foo@banana] and [`bar@banana!()`].
4 changes: 2 additions & 2 deletions 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: "tests/rustdoc-ui/issues" -> "$$DIR"
//@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"

pub fn test() -> Result<(), ()> {
//! ```compile_fail
4 changes: 2 additions & 2 deletions tests/rustdoc-ui/issues/issue-81662-shortness.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//@ compile-flags:--test --error-format=short
//@ check-stdout
//@ error-pattern:cannot find function `foo`
//@ normalize-stdout-test: "tests/rustdoc-ui/issues" -> "$$DIR"
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ normalize-stdout: "tests/rustdoc-ui/issues" -> "$$DIR"
//@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ failure-status: 101

/// ```rust
4 changes: 2 additions & 2 deletions tests/rustdoc-ui/issues/issue-83883-describe-lints.rs
Original file line number Diff line number Diff line change
@@ -6,5 +6,5 @@
//
// ignore-tidy-linelength
//
//@ normalize-stdout-test: "( +name default meaning\n +---- ------- -------\n)?( *[[:word:]:-]+ (allow |warn |deny |forbid ) [^\n]+\n)+" -> " $$NAMES $$LEVELS $$MEANINGS"
//@ normalize-stdout-test: " +name sub-lints\n +---- ---------\n( *[[:word:]:-]+ [^\n]+\n)+" -> " $$NAMES $$SUB_LINTS"
//@ normalize-stdout: "( +name default meaning\n +---- ------- -------\n)?( *[[:word:]:-]+ (allow |warn |deny |forbid ) [^\n]+\n)+" -> " $$NAMES $$LEVELS $$MEANINGS"
//@ normalize-stdout: " +name sub-lints\n +---- ---------\n( *[[:word:]:-]+ [^\n]+\n)+" -> " $$NAMES $$SUB_LINTS"
4 changes: 2 additions & 2 deletions tests/rustdoc-ui/issues/issue-91134.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//@ compile-flags: --test --crate-name=empty_fn --extern=empty_fn --test-args=--test-threads=1
//@ 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: "tests/rustdoc-ui/issues" -> "$$DIR"
//@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ edition:2021

/// <https://github.com/rust-lang/rust/issues/91134>
2 changes: 1 addition & 1 deletion tests/rustdoc-ui/lints/check.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//@ check-pass
//@ compile-flags: -Z unstable-options --check
//@ normalize-stderr-test: "nightly|beta|1\.[0-9][0-9]\.[0-9]" -> "$$CHANNEL"
//@ normalize-stderr: "nightly|beta|1\.[0-9][0-9]\.[0-9]" -> "$$CHANNEL"

#![feature(rustdoc_missing_doc_code_examples)]
//~^ WARN
2 changes: 1 addition & 1 deletion tests/rustdoc-ui/lints/no-crate-level-doc-lint.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//@ error-pattern: no documentation found
//@ normalize-stderr-test: "nightly|beta|1\.[0-9][0-9]\.[0-9]" -> "$$CHANNEL"
//@ normalize-stderr: "nightly|beta|1\.[0-9][0-9]\.[0-9]" -> "$$CHANNEL"
#![deny(rustdoc::missing_crate_level_docs)]
//^~ NOTE defined here

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
@@ -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: "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ normalize-stdout: "exit (status|code): 101" -> "exit status: 101"

// doctest fails at runtime
/// ```
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
@@ -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: "finished in \d+\.\d+s" -> "finished in $$TIME"

// doctest fails to compile
/// ```
Original file line number Diff line number Diff line change
@@ -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: "finished in \d+\.\d+s" -> "finished in $$TIME"

// doctest passes at runtime
/// ```
2 changes: 1 addition & 1 deletion tests/rustdoc-ui/track-diagnostics.rs
Original file line number Diff line number Diff line change
@@ -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: ".rs:\d+:\d+" -> ".rs:LL:CC"

struct A;
struct B;
4 changes: 2 additions & 2 deletions tests/ui-fulldeps/codegen-backend/hotplug.rs
Original file line number Diff line number Diff line change
@@ -3,8 +3,8 @@
//@ ignore-stage1 (requires matching sysroot built with in-tree compiler)

//@ aux-codegen-backend: the_backend.rs
//@ normalize-stdout-test: "libthe_backend.dylib" -> "libthe_backend.so"
//@ normalize-stdout-test: "the_backend.dll" -> "libthe_backend.so"
//@ normalize-stdout: "libthe_backend.dylib" -> "libthe_backend.so"
//@ normalize-stdout: "the_backend.dll" -> "libthe_backend.so"

//@ revisions: normal dep bindep
//@ compile-flags: --crate-type=lib
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: "could not open Fluent resource:.*" -> "could not open Fluent resource: os-specific message"

#![feature(rustc_private)]
#![crate_type = "lib"]
4 changes: 2 additions & 2 deletions tests/ui-fulldeps/missing-rustc-driver-error.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// 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: "aborting due to [0-9]+" -> "aborting due to NUMBER"
//@ normalize-stderr: ".*crate .* required.*\n\n" -> ""
//@ normalize-stderr: "aborting due to [0-9]+" -> "aborting due to NUMBER"

#![feature(rustc_private)]

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: "the following other types implement trait `IntoDiagArg`:(?:.*\n){0,9}\s+and \d+ others" -> "normalized in stderr"
//@ normalize-stderr: "(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
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: "the following other types implement trait `IntoDiagArg`:(?:.*\n){0,9}\s+and \d+ others" -> "normalized in stderr"
//@ normalize-stderr: "(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
2 changes: 1 addition & 1 deletion tests/ui/abi/c-zst.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ normalize-stderr-test: "(abi|pref|unadjusted_abi_align): Align\([1-8] bytes\)" -> "$1: $$SOME_ALIGN"
//@ normalize-stderr: "(abi|pref|unadjusted_abi_align): Align\([1-8] bytes\)" -> "$1: $$SOME_ALIGN"
/*!
C doesn't have zero-sized types... except it does.
10 changes: 5 additions & 5 deletions tests/ui/abi/debug.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
//@ normalize-stderr-test: "(abi|pref|unadjusted_abi_align): Align\([1-8] bytes\)" -> "$1: $$SOME_ALIGN"
//@ normalize-stderr-test: "(size): Size\([48] bytes\)" -> "$1: $$SOME_SIZE"
//@ normalize-stderr-test: "(can_unwind): (true|false)" -> "$1: $$SOME_BOOL"
//@ normalize-stderr-test: "(valid_range): 0\.\.=(4294967295|18446744073709551615)" -> "$1: $$FULL"
//@ normalize-stderr: "(abi|pref|unadjusted_abi_align): Align\([1-8] bytes\)" -> "$1: $$SOME_ALIGN"
//@ normalize-stderr: "(size): Size\([48] bytes\)" -> "$1: $$SOME_SIZE"
//@ normalize-stderr: "(can_unwind): (true|false)" -> "$1: $$SOME_BOOL"
//@ normalize-stderr: "(valid_range): 0\.\.=(4294967295|18446744073709551615)" -> "$1: $$FULL"
// This pattern is prepared for when we account for alignment in the niche.
//@ normalize-stderr-test: "(valid_range): [1-9]\.\.=(429496729[0-9]|1844674407370955161[0-9])" -> "$1: $$NON_NULL"
//@ normalize-stderr: "(valid_range): [1-9]\.\.=(429496729[0-9]|1844674407370955161[0-9])" -> "$1: $$NON_NULL"
// Some attributes are only computed for release builds:
//@ compile-flags: -O
#![feature(rustc_attrs)]
2 changes: 1 addition & 1 deletion tests/ui/abi/sysv64-zst.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//@ only-x86_64
//@ normalize-stderr-test: "(abi|pref|unadjusted_abi_align): Align\([1-8] bytes\)" -> "$1: $$SOME_ALIGN"
//@ normalize-stderr: "(abi|pref|unadjusted_abi_align): Align\([1-8] bytes\)" -> "$1: $$SOME_ALIGN"

#![feature(rustc_attrs)]
#![crate_type = "lib"]
2 changes: 1 addition & 1 deletion tests/ui/abi/win64-zst.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ normalize-stderr-test: "(abi|pref|unadjusted_abi_align): Align\([1-8] bytes\)" -> "$1: $$SOME_ALIGN"
//@ normalize-stderr: "(abi|pref|unadjusted_abi_align): Align\([1-8] bytes\)" -> "$1: $$SOME_ALIGN"
//@ only-x86_64

//@ revisions: x86_64-linux
4 changes: 2 additions & 2 deletions tests/ui/argfile/commandline-argfile-missing-windows.rs
Original file line number Diff line number Diff line change
@@ -5,8 +5,8 @@
// line arguments and is only run on windows.
//
//@ only-windows
//@ normalize-stderr-test: "os error \d+" -> "os error $$ERR"
//@ normalize-stderr-test: "commandline-argfile-missing.args:[^(]*" -> "commandline-argfile-missing.args: $$FILE_MISSING "
//@ normalize-stderr: "os error \d+" -> "os error $$ERR"
//@ normalize-stderr: "commandline-argfile-missing.args:[^(]*" -> "commandline-argfile-missing.args: $$FILE_MISSING "
//@ compile-flags: --cfg cmdline_set @{{src-base}}\argfile\commandline-argfile-missing.args

#[cfg(not(cmdline_set))]
4 changes: 2 additions & 2 deletions tests/ui/argfile/commandline-argfile-missing.rs
Original file line number Diff line number Diff line change
@@ -6,8 +6,8 @@
// windows.
//
//@ ignore-windows
//@ normalize-stderr-test: "os error \d+" -> "os error $$ERR"
//@ normalize-stderr-test: "commandline-argfile-missing.args:[^(]*" -> "commandline-argfile-missing.args: $$FILE_MISSING "
//@ normalize-stderr: "os error \d+" -> "os error $$ERR"
//@ normalize-stderr: "commandline-argfile-missing.args:[^(]*" -> "commandline-argfile-missing.args: $$FILE_MISSING "
//@ compile-flags: --cfg cmdline_set @{{src-base}}/argfile/commandline-argfile-missing.args

#[cfg(not(cmdline_set))]
6 changes: 3 additions & 3 deletions tests/ui/argfile/commandline-argfile-multiple-windows.rs
Original file line number Diff line number Diff line change
@@ -5,9 +5,9 @@
// line arguments and is only run on windows.
//
//@ only-windows
//@ normalize-stderr-test: "os error \d+" -> "os error $$ERR"
//@ normalize-stderr-test: "commandline-argfile-missing.args:[^(]*" -> "commandline-argfile-missing.args: $$FILE_MISSING "
//@ normalize-stderr-test: "commandline-argfile-missing2.args:[^(]*" -> "commandline-argfile-missing2.args: $$FILE_MISSING "
//@ normalize-stderr: "os error \d+" -> "os error $$ERR"
//@ normalize-stderr: "commandline-argfile-missing.args:[^(]*" -> "commandline-argfile-missing.args: $$FILE_MISSING "
//@ normalize-stderr: "commandline-argfile-missing2.args:[^(]*" -> "commandline-argfile-missing2.args: $$FILE_MISSING "
//@ 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

#[cfg(not(cmdline_set))]
6 changes: 3 additions & 3 deletions tests/ui/argfile/commandline-argfile-multiple.rs
Original file line number Diff line number Diff line change
@@ -6,9 +6,9 @@
// windows.
//
//@ ignore-windows
//@ normalize-stderr-test: "os error \d+" -> "os error $$ERR"
//@ normalize-stderr-test: "commandline-argfile-missing.args:[^(]*" -> "commandline-argfile-missing.args: $$FILE_MISSING "
//@ normalize-stderr-test: "commandline-argfile-missing2.args:[^(]*" -> "commandline-argfile-missing2.args: $$FILE_MISSING "
//@ normalize-stderr: "os error \d+" -> "os error $$ERR"
//@ normalize-stderr: "commandline-argfile-missing.args:[^(]*" -> "commandline-argfile-missing.args: $$FILE_MISSING "
//@ normalize-stderr: "commandline-argfile-missing2.args:[^(]*" -> "commandline-argfile-missing2.args: $$FILE_MISSING "
//@ 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

#[cfg(not(cmdline_set))]
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ normalize-stderr-test: "and \d+ other candidates" -> "and N other candidates"
//@ normalize-stderr: "and \d+ other candidates" -> "and N other candidates"

trait Get {
type Value;
2 changes: 1 addition & 1 deletion tests/ui/attributes/dump-preds.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ normalize-stderr-test: "DefId\(.+?\)" -> "DefId(..)"
//@ normalize-stderr: "DefId\(.+?\)" -> "DefId(..)"

#![feature(rustc_attrs)]

2 changes: 1 addition & 1 deletion tests/ui/attributes/dump_def_parents.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ normalize-stderr-test: "DefId\(.+?\)" -> "DefId(..)"
//@ normalize-stderr: "DefId\(.+?\)" -> "DefId(..)"
#![feature(rustc_attrs)]

fn bar() {
2 changes: 1 addition & 1 deletion tests/ui/attributes/extented-attribute-macro-error.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ normalize-stderr-test: "couldn't read.*" -> "couldn't read the file"
//@ normalize-stderr: "couldn't read.*" -> "couldn't read the file"

#![doc = include_str!("../not_existing_file.md")]
struct Documented {}
4 changes: 2 additions & 2 deletions tests/ui/check-cfg/and-more-diagnostic.rs
Original file line number Diff line number Diff line change
@@ -4,8 +4,8 @@
//@ check-pass
//@ no-auto-check-cfg
//@ compile-flags: --check-cfg=cfg()
//@ normalize-stderr-test: "and \d+ more" -> "and X more"
//@ normalize-stderr-test: "`[a-zA-Z0-9_-]+`" -> "`xxx`"
//@ normalize-stderr: "and \d+ more" -> "and X more"
//@ normalize-stderr: "`[a-zA-Z0-9_-]+`" -> "`xxx`"

fn main() {
cfg!(target_feature = "zebra");
2 changes: 1 addition & 1 deletion tests/ui/check-cfg/target_feature.rs
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@
//@ check-pass
//@ no-auto-check-cfg
//@ compile-flags: --check-cfg=cfg() -Zcheck-cfg-all-expected
//@ normalize-stderr-test: "`, `" -> "`\n`"
//@ normalize-stderr: "`, `" -> "`\n`"

fn main() {
cfg!(target_feature = "_UNEXPECTED_VALUE");
4 changes: 2 additions & 2 deletions tests/ui/codegen/mismatched-data-layouts.rs
Original file line number Diff line number Diff line change
@@ -4,8 +4,8 @@
//@ needs-llvm-components: x86
//@ compile-flags: --crate-type=lib --target={{src-base}}/codegen/mismatched-data-layout.json -Z unstable-options
//@ error-pattern: differs from LLVM target's
//@ normalize-stderr-test: "`, `[A-Za-z0-9-:]*`" -> "`, `normalized data layout`"
//@ normalize-stderr-test: "layout, `[A-Za-z0-9-:]*`" -> "layout, `normalized data layout`"
//@ normalize-stderr: "`, `[A-Za-z0-9-:]*`" -> "`, `normalized data layout`"
//@ normalize-stderr: "layout, `[A-Za-z0-9-:]*`" -> "layout, `normalized data layout`"

#![feature(lang_items, no_core, auto_traits)]
#![no_core]
2 changes: 1 addition & 1 deletion tests/ui/codegen/target-cpus.rs
Original file line number Diff line number Diff line change
@@ -6,4 +6,4 @@
// output so that the stdout with LLVM-at-HEAD matches the output of the LLVM
// versions currently used by default.
// FIXME(#133919): Once Rust upgrades to LLVM 20, remove this.
//@ normalize-stdout-test: "(?m)^ *lime1\n" -> ""
//@ normalize-stdout: "(?m)^ *lime1\n" -> ""
6 changes: 3 additions & 3 deletions tests/ui/const-generics/generic_const_exprs/issue-80742.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
//@ check-fail
//@ known-bug: #97477
//@ failure-status: 101
//@ normalize-stderr-test: "note: .*\n\n" -> ""
//@ normalize-stderr-test: "thread 'rustc' panicked.*\n" -> ""
//@ normalize-stderr-test: "(error: internal compiler error: [^:]+):\d+:\d+: " -> "$1:LL:CC: "
//@ normalize-stderr: "note: .*\n\n" -> ""
//@ normalize-stderr: "thread 'rustc' panicked.*\n" -> ""
//@ normalize-stderr: "(error: internal compiler error: [^:]+):\d+:\d+: " -> "$1:LL:CC: "
//@ rustc-env:RUST_BACKTRACE=0

// This test used to cause an ICE in rustc_mir::interpret::step::eval_rvalue_into_place
3 changes: 1 addition & 2 deletions tests/ui/const-generics/transmute-fail.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// ignore-tidy-linelength
//@ normalize-stderr-32bit: "values of the type `[^`]+` are too big" -> "values of the type $$REALLY_TOO_BIG are too big"
//@ normalize-stderr-64bit: "values of the type `[^`]+` are too big" -> "values of the type $$REALLY_TOO_BIG are too big"
//@ normalize-stderr: "values of the type `[^`]+` are too big" -> "values of the type $$REALLY_TOO_BIG are too big"


#![feature(transmute_generic_consts)]
30 changes: 15 additions & 15 deletions tests/ui/const-generics/transmute-fail.stderr
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
error: the constant `W` is not of type `usize`
--> $DIR/transmute-fail.rs:17:42
--> $DIR/transmute-fail.rs:16:42
|
LL | fn bar<const W: bool, const H: usize>(v: [[u32; H]; W]) -> [[u32; W]; H] {
| ^^^^^^^^^^^^^ expected `usize`, found `bool`

error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
--> $DIR/transmute-fail.rs:12:9
--> $DIR/transmute-fail.rs:11:9
|
LL | std::mem::transmute(v)
| ^^^^^^^^^^^^^^^^^^^
@@ -14,13 +14,13 @@ LL | std::mem::transmute(v)
= note: target type: `[[u32; W + 1]; H]` (size can vary because of [u32; W + 1])

error: the constant `W` is not of type `usize`
--> $DIR/transmute-fail.rs:20:9
--> $DIR/transmute-fail.rs:19:9
|
LL | std::mem::transmute(v)
| ^^^^^^^^^^^^^^^^^^^ expected `usize`, found `bool`

error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
--> $DIR/transmute-fail.rs:27:9
--> $DIR/transmute-fail.rs:26:9
|
LL | std::mem::transmute(v)
| ^^^^^^^^^^^^^^^^^^^
@@ -29,7 +29,7 @@ LL | std::mem::transmute(v)
= note: target type: `[u32; W * H * H]` (this type does not have a fixed size)

error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
--> $DIR/transmute-fail.rs:34:9
--> $DIR/transmute-fail.rs:33:9
|
LL | std::mem::transmute(v)
| ^^^^^^^^^^^^^^^^^^^
@@ -38,7 +38,7 @@ LL | std::mem::transmute(v)
= note: target type: `[[[u32; 9999999]; 777777777]; 8888888]` (values of the type $REALLY_TOO_BIG are too big for the target architecture)

error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
--> $DIR/transmute-fail.rs:40:14
--> $DIR/transmute-fail.rs:39:14
|
LL | unsafe { std::mem::transmute(v) }
| ^^^^^^^^^^^^^^^^^^^
@@ -47,7 +47,7 @@ LL | unsafe { std::mem::transmute(v) }
= note: target type: `[[[u32; 9999999]; 777777777]; 239]` (values of the type $REALLY_TOO_BIG are too big for the target architecture)

error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
--> $DIR/transmute-fail.rs:46:9
--> $DIR/transmute-fail.rs:45:9
|
LL | std::mem::transmute(v)
| ^^^^^^^^^^^^^^^^^^^
@@ -56,7 +56,7 @@ LL | std::mem::transmute(v)
= note: target type: `[[u32; W]; H]` (size can vary because of [u32; W])

error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
--> $DIR/transmute-fail.rs:57:9
--> $DIR/transmute-fail.rs:56:9
|
LL | std::mem::transmute(v)
| ^^^^^^^^^^^^^^^^^^^
@@ -65,7 +65,7 @@ LL | std::mem::transmute(v)
= note: target type: `[u32; W * H]` (this type does not have a fixed size)

error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
--> $DIR/transmute-fail.rs:64:9
--> $DIR/transmute-fail.rs:63:9
|
LL | std::mem::transmute(v)
| ^^^^^^^^^^^^^^^^^^^
@@ -74,7 +74,7 @@ LL | std::mem::transmute(v)
= note: target type: `[[u32; W]; H]` (size can vary because of [u32; W])

error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
--> $DIR/transmute-fail.rs:73:9
--> $DIR/transmute-fail.rs:72:9
|
LL | std::mem::transmute(v)
| ^^^^^^^^^^^^^^^^^^^
@@ -83,7 +83,7 @@ LL | std::mem::transmute(v)
= note: target type: `[u32; D * W * H]` (this type does not have a fixed size)

error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
--> $DIR/transmute-fail.rs:82:9
--> $DIR/transmute-fail.rs:81:9
|
LL | std::mem::transmute(v)
| ^^^^^^^^^^^^^^^^^^^
@@ -92,7 +92,7 @@ LL | std::mem::transmute(v)
= note: target type: `[[u32; D * W]; H]` (size can vary because of [u32; D * W])

error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
--> $DIR/transmute-fail.rs:89:9
--> $DIR/transmute-fail.rs:88:9
|
LL | std::mem::transmute(v)
| ^^^^^^^^^^^^^^^^^^^
@@ -101,7 +101,7 @@ LL | std::mem::transmute(v)
= note: target type: `[u8; L * 2]` (this type does not have a fixed size)

error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
--> $DIR/transmute-fail.rs:96:9
--> $DIR/transmute-fail.rs:95:9
|
LL | std::mem::transmute(v)
| ^^^^^^^^^^^^^^^^^^^
@@ -110,7 +110,7 @@ LL | std::mem::transmute(v)
= note: target type: `[u16; L]` (this type does not have a fixed size)

error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
--> $DIR/transmute-fail.rs:103:9
--> $DIR/transmute-fail.rs:102:9
|
LL | std::mem::transmute(v)
| ^^^^^^^^^^^^^^^^^^^
@@ -119,7 +119,7 @@ LL | std::mem::transmute(v)
= note: target type: `[[u8; 1]; L]` (this type does not have a fixed size)

error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
--> $DIR/transmute-fail.rs:112:9
--> $DIR/transmute-fail.rs:111:9
|
LL | std::mem::transmute(v)
| ^^^^^^^^^^^^^^^^^^^
4 changes: 2 additions & 2 deletions tests/ui/const-ptr/forbidden_slices.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Strip out raw byte dumps to make comparison platform-independent:
//@ normalize-stderr-test: "(the raw bytes of the constant) \(size: [0-9]*, align: [0-9]*\)" -> "$1 (size: $$SIZE, align: $$ALIGN)"
//@ normalize-stderr-test: "([0-9a-f][0-9a-f] |╾─*A(LLOC)?[0-9]+(\+[a-z0-9]+)?(<imm>)?─*╼ )+ *│.*" -> "HEX_DUMP"
//@ normalize-stderr: "(the raw bytes of the constant) \(size: [0-9]*, align: [0-9]*\)" -> "$1 (size: $$SIZE, align: $$ALIGN)"
//@ normalize-stderr: "([0-9a-f][0-9a-f] |╾─*A(LLOC)?[0-9]+(\+[a-z0-9]+)?(<imm>)?─*╼ )+ *│.*" -> "HEX_DUMP"

#![feature(
slice_from_ptr_range,
20 changes: 10 additions & 10 deletions tests/ui/consts/const-eval/const-eval-query-stack.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
//@ compile-flags: -Ztreat-err-as-bug=1
//@ failure-status: 101
//@ rustc-env:RUST_BACKTRACE=1
//@ normalize-stderr-test: "\nerror: .*unexpectedly panicked.*\n\n" -> ""
//@ normalize-stderr-test: "note: we would appreciate a bug report.*\n\n" -> ""
//@ normalize-stderr-test: "note: compiler flags.*\n\n" -> ""
//@ normalize-stderr-test: "note: rustc.*running on.*\n\n" -> ""
//@ normalize-stderr-test: "thread.*panicked.*:\n.*\n" -> ""
//@ normalize-stderr-test: "stack backtrace:\n" -> ""
//@ normalize-stderr-test: "\s\d{1,}: .*\n" -> ""
//@ normalize-stderr-test: "\s at .*\n" -> ""
//@ normalize-stderr-test: ".*note: Some details.*\n" -> ""
//@ normalize-stderr-test: ".*omitted \d{1,} frame.*\n" -> ""
//@ normalize-stderr: "\nerror: .*unexpectedly panicked.*\n\n" -> ""
//@ normalize-stderr: "note: we would appreciate a bug report.*\n\n" -> ""
//@ normalize-stderr: "note: compiler flags.*\n\n" -> ""
//@ normalize-stderr: "note: rustc.*running on.*\n\n" -> ""
//@ normalize-stderr: "thread.*panicked.*:\n.*\n" -> ""
//@ normalize-stderr: "stack backtrace:\n" -> ""
//@ normalize-stderr: "\s\d{1,}: .*\n" -> ""
//@ normalize-stderr: "\s at .*\n" -> ""
//@ normalize-stderr: ".*note: Some details.*\n" -> ""
//@ normalize-stderr: ".*omitted \d{1,} frame.*\n" -> ""
#![allow(unconditional_panic)]

const X: i32 = 1 / 0; //~ERROR constant
6 changes: 3 additions & 3 deletions tests/ui/consts/const-eval/heap/dealloc_intrinsic_dangling.rs
Original file line number Diff line number Diff line change
@@ -2,9 +2,9 @@
#![feature(const_heap)]

// Strip out raw byte dumps to make comparison platform-independent:
//@ normalize-stderr-test: "(the raw bytes of the constant) \(size: [0-9]*, align: [0-9]*\)" -> "$1 (size: $$SIZE, align: $$ALIGN)"
//@ normalize-stderr-test: "([0-9a-f][0-9a-f] |╾─*A(LLOC)?[0-9]+(\+[a-z0-9]+)?(<imm>)?─*╼ )+ *│.*" -> "HEX_DUMP"
//@ normalize-stderr-test: "HEX_DUMP\s*\n\s*HEX_DUMP" -> "HEX_DUMP"
//@ normalize-stderr: "(the raw bytes of the constant) \(size: [0-9]*, align: [0-9]*\)" -> "$1 (size: $$SIZE, align: $$ALIGN)"
//@ normalize-stderr: "([0-9a-f][0-9a-f] |╾─*A(LLOC)?[0-9]+(\+[a-z0-9]+)?(<imm>)?─*╼ )+ *│.*" -> "HEX_DUMP"
//@ normalize-stderr: "HEX_DUMP\s*\n\s*HEX_DUMP" -> "HEX_DUMP"

use std::intrinsics;

2 changes: 1 addition & 1 deletion tests/ui/consts/const-eval/raw-bytes.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//@ stderr-per-bitwidth
//@ ignore-endian-big
// ignore-tidy-linelength
//@ normalize-stderr-test: "╾─*ALLOC[0-9]+(\+[a-z0-9]+)?(<imm>)?─*╼" -> "╾ALLOC_ID$1╼"
//@ normalize-stderr: "╾─*ALLOC[0-9]+(\+[a-z0-9]+)?(<imm>)?─*╼" -> "╾ALLOC_ID$1╼"
#![allow(invalid_value)]
#![feature(never_type, rustc_attrs, ptr_metadata, slice_from_ptr_range, const_slice_from_ptr_range)]

6 changes: 3 additions & 3 deletions tests/ui/consts/const-eval/ub-enum.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Strip out raw byte dumps to make comparison platform-independent:
//@ normalize-stderr-test: "(the raw bytes of the constant) \(size: [0-9]*, align: [0-9]*\)" -> "$1 (size: $$SIZE, align: $$ALIGN)"
//@ normalize-stderr-test: "([0-9a-f][0-9a-f] |╾─*ALLOC[0-9]+(\+[a-z0-9]+)?(<imm>)?─*╼ )+ *│.*" -> "HEX_DUMP"
//@ normalize-stderr-test: "0x0+" -> "0x0"
//@ normalize-stderr: "(the raw bytes of the constant) \(size: [0-9]*, align: [0-9]*\)" -> "$1 (size: $$SIZE, align: $$ALIGN)"
//@ normalize-stderr: "([0-9a-f][0-9a-f] |╾─*ALLOC[0-9]+(\+[a-z0-9]+)?(<imm>)?─*╼ )+ *│.*" -> "HEX_DUMP"
//@ normalize-stderr: "0x0+" -> "0x0"
#![feature(never_type)]
#![allow(invalid_value)]

4 changes: 2 additions & 2 deletions tests/ui/consts/const-eval/ub-nonnull.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Strip out raw byte dumps to make comparison platform-independent:
//@ normalize-stderr-test: "(the raw bytes of the constant) \(size: [0-9]*, align: [0-9]*\)" -> "$1 (size: $$SIZE, align: $$ALIGN)"
//@ normalize-stderr-test: "([0-9a-f][0-9a-f] |╾─*ALLOC[0-9]+(\+[a-z0-9]+)?─*╼ )+ *│.*" -> "HEX_DUMP"
//@ normalize-stderr: "(the raw bytes of the constant) \(size: [0-9]*, align: [0-9]*\)" -> "$1 (size: $$SIZE, align: $$ALIGN)"
//@ normalize-stderr: "([0-9a-f][0-9a-f] |╾─*ALLOC[0-9]+(\+[a-z0-9]+)?─*╼ )+ *│.*" -> "HEX_DUMP"
#![allow(invalid_value)] // make sure we cannot allow away the errors tested here
#![feature(rustc_attrs, ptr_metadata)]

4 changes: 2 additions & 2 deletions tests/ui/consts/const-eval/ub-ref-ptr.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ignore-tidy-linelength
// Strip out raw byte dumps to make comparison platform-independent:
//@ normalize-stderr-test: "(the raw bytes of the constant) \(size: [0-9]*, align: [0-9]*\)" -> "$1 (size: $$SIZE, align: $$ALIGN)"
//@ normalize-stderr-test: "([0-9a-f][0-9a-f] |╾─*ALLOC[0-9]+(\+[a-z0-9]+)?(<imm>)?─*╼ )+ *│.*" -> "HEX_DUMP"
//@ normalize-stderr: "(the raw bytes of the constant) \(size: [0-9]*, align: [0-9]*\)" -> "$1 (size: $$SIZE, align: $$ALIGN)"
//@ normalize-stderr: "([0-9a-f][0-9a-f] |╾─*ALLOC[0-9]+(\+[a-z0-9]+)?(<imm>)?─*╼ )+ *│.*" -> "HEX_DUMP"
#![allow(invalid_value)]

use std::mem;
4 changes: 2 additions & 2 deletions tests/ui/consts/const-eval/ub-uninhabit.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Strip out raw byte dumps to make comparison platform-independent:
//@ normalize-stderr-test: "(the raw bytes of the constant) \(size: [0-9]*, align: [0-9]*\)" -> "$1 (size: $$SIZE, align: $$ALIGN)"
//@ normalize-stderr-test: "([0-9a-f][0-9a-f] |╾─*ALLOC[0-9]+(\+[a-z0-9]+)?(<imm>)?─*╼ )+ *│.*" -> "HEX_DUMP"
//@ normalize-stderr: "(the raw bytes of the constant) \(size: [0-9]*, align: [0-9]*\)" -> "$1 (size: $$SIZE, align: $$ALIGN)"
//@ normalize-stderr: "([0-9a-f][0-9a-f] |╾─*ALLOC[0-9]+(\+[a-z0-9]+)?(<imm>)?─*╼ )+ *│.*" -> "HEX_DUMP"
#![feature(core_intrinsics)]
#![feature(never_type)]

8 changes: 4 additions & 4 deletions tests/ui/consts/const-eval/ub-wide-ptr.rs
Original file line number Diff line number Diff line change
@@ -5,10 +5,10 @@
use std::{ptr, mem};

// Strip out raw byte dumps to make comparison platform-independent:
//@ normalize-stderr-test: "(the raw bytes of the constant) \(size: [0-9]*, align: [0-9]*\)" -> "$1 (size: $$SIZE, align: $$ALIGN)"
//@ normalize-stderr-test: "([0-9a-f][0-9a-f] |╾─*ALLOC[0-9]+(\+[a-z0-9]+)?(<imm>)?─*╼ )+ *│.*" -> "HEX_DUMP"
//@ normalize-stderr-test: "offset \d+" -> "offset N"
//@ normalize-stderr-test: "size \d+" -> "size N"
//@ normalize-stderr: "(the raw bytes of the constant) \(size: [0-9]*, align: [0-9]*\)" -> "$1 (size: $$SIZE, align: $$ALIGN)"
//@ normalize-stderr: "([0-9a-f][0-9a-f] |╾─*ALLOC[0-9]+(\+[a-z0-9]+)?(<imm>)?─*╼ )+ *│.*" -> "HEX_DUMP"
//@ normalize-stderr: "offset \d+" -> "offset N"
//@ normalize-stderr: "size \d+" -> "size N"


/// A newtype wrapper to prevent MIR generation from inserting reborrows that would affect the error
6 changes: 3 additions & 3 deletions tests/ui/consts/const-mut-refs/mut_ref_in_final.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//@ normalize-stderr-test: "(the raw bytes of the constant) \(size: [0-9]*, align: [0-9]*\)" -> "$1 (size: $$SIZE, align: $$ALIGN)"
//@ normalize-stderr-test: "( 0x[0-9a-f][0-9a-f] │)? ([0-9a-f][0-9a-f] |__ |╾─*ALLOC[0-9]+(\+[a-z0-9]+)?(<imm>)?─*╼ )+ *│.*" -> " HEX_DUMP"
//@ normalize-stderr-test: "HEX_DUMP\s*\n\s*HEX_DUMP" -> "HEX_DUMP"
//@ normalize-stderr: "(the raw bytes of the constant) \(size: [0-9]*, align: [0-9]*\)" -> "$1 (size: $$SIZE, align: $$ALIGN)"
//@ normalize-stderr: "( 0x[0-9a-f][0-9a-f] │)? ([0-9a-f][0-9a-f] |__ |╾─*ALLOC[0-9]+(\+[a-z0-9]+)?(<imm>)?─*╼ )+ *│.*" -> " HEX_DUMP"
//@ normalize-stderr: "HEX_DUMP\s*\n\s*HEX_DUMP" -> "HEX_DUMP"

use std::cell::UnsafeCell;
use std::mem;
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//@ normalize-stderr-test: "(the raw bytes of the constant) \(size: [0-9]*, align: [0-9]*\)" -> "$1 (size: $$SIZE, align: $$ALIGN)"
//@ normalize-stderr-test: "( 0x[0-9a-f][0-9a-f] │)? ([0-9a-f][0-9a-f] |__ |╾─*ALLOC[0-9]+(\+[a-z0-9]+)?(<imm>)?─*╼ )+ *│.*" -> " HEX_DUMP"
//@ normalize-stderr-test: "HEX_DUMP\s*\n\s*HEX_DUMP" -> "HEX_DUMP"
//@ normalize-stderr: "(the raw bytes of the constant) \(size: [0-9]*, align: [0-9]*\)" -> "$1 (size: $$SIZE, align: $$ALIGN)"
//@ normalize-stderr: "( 0x[0-9a-f][0-9a-f] │)? ([0-9a-f][0-9a-f] |__ |╾─*ALLOC[0-9]+(\+[a-z0-9]+)?(<imm>)?─*╼ )+ *│.*" -> " HEX_DUMP"
//@ normalize-stderr: "HEX_DUMP\s*\n\s*HEX_DUMP" -> "HEX_DUMP"

use std::sync::Mutex;

4 changes: 2 additions & 2 deletions tests/ui/consts/const_refs_to_static_fail.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//@ normalize-stderr-test: "(the raw bytes of the constant) \(size: [0-9]*, align: [0-9]*\)" -> "$1 (size: $$SIZE, align: $$ALIGN)"
//@ normalize-stderr-test: "([0-9a-f][0-9a-f] |╾─*ALLOC[0-9]+(\+[a-z0-9]+)?(<imm>)?─*╼ )+ *│.*" -> "HEX_DUMP"
//@ normalize-stderr: "(the raw bytes of the constant) \(size: [0-9]*, align: [0-9]*\)" -> "$1 (size: $$SIZE, align: $$ALIGN)"
//@ normalize-stderr: "([0-9a-f][0-9a-f] |╾─*ALLOC[0-9]+(\+[a-z0-9]+)?(<imm>)?─*╼ )+ *│.*" -> "HEX_DUMP"

#![feature(sync_unsafe_cell)]

4 changes: 2 additions & 2 deletions tests/ui/consts/const_refs_to_static_fail_invalid.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//@ normalize-stderr-test: "(the raw bytes of the constant) \(size: [0-9]*, align: [0-9]*\)" -> "$1 (size: $$SIZE, align: $$ALIGN)"
//@ normalize-stderr-test: "([0-9a-f][0-9a-f] |╾─*ALLOC[0-9]+(\+[a-z0-9]+)?(<imm>)?─*╼ )+ *│.*" -> "HEX_DUMP"
//@ normalize-stderr: "(the raw bytes of the constant) \(size: [0-9]*, align: [0-9]*\)" -> "$1 (size: $$SIZE, align: $$ALIGN)"
//@ normalize-stderr: "([0-9a-f][0-9a-f] |╾─*ALLOC[0-9]+(\+[a-z0-9]+)?(<imm>)?─*╼ )+ *│.*" -> "HEX_DUMP"
#![allow(static_mut_refs)]

fn invalid() {
6 changes: 3 additions & 3 deletions tests/ui/consts/dangling-alloc-id-ice.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// https://github.com/rust-lang/rust/issues/55223
// Strip out raw byte dumps to make comparison platform-independent:
//@ normalize-stderr-test: "(the raw bytes of the constant) \(size: [0-9]*, align: [0-9]*\)" -> "$1 (size: $$SIZE, align: $$ALIGN)"
//@ normalize-stderr-test: "([0-9a-f][0-9a-f] |╾─*A(LLOC)?[0-9]+(\+[a-z0-9]+)?(<imm>)?─*╼ )+ *│.*" -> "HEX_DUMP"
//@ normalize-stderr-test: "HEX_DUMP\s*\n\s*HEX_DUMP" -> "HEX_DUMP"
//@ normalize-stderr: "(the raw bytes of the constant) \(size: [0-9]*, align: [0-9]*\)" -> "$1 (size: $$SIZE, align: $$ALIGN)"
//@ normalize-stderr: "([0-9a-f][0-9a-f] |╾─*A(LLOC)?[0-9]+(\+[a-z0-9]+)?(<imm>)?─*╼ )+ *│.*" -> "HEX_DUMP"
//@ normalize-stderr: "HEX_DUMP\s*\n\s*HEX_DUMP" -> "HEX_DUMP"

union Foo<'a> {
y: &'a (),
6 changes: 3 additions & 3 deletions tests/ui/consts/dangling-zst-ice-issue-126393.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Strip out raw byte dumps to make comparison platform-independent:
//@ normalize-stderr-test: "(the raw bytes of the constant) \(size: [0-9]*, align: [0-9]*\)" -> "$1 (size: $$SIZE, align: $$ALIGN)"
//@ normalize-stderr-test: "([0-9a-f][0-9a-f] |╾─*A(LLOC)?[0-9]+(\+[a-z0-9]+)?(<imm>)?─*╼ )+ *│.*" -> "HEX_DUMP"
//@ normalize-stderr-test: "HEX_DUMP\s*\n\s*HEX_DUMP" -> "HEX_DUMP"
//@ normalize-stderr: "(the raw bytes of the constant) \(size: [0-9]*, align: [0-9]*\)" -> "$1 (size: $$SIZE, align: $$ALIGN)"
//@ normalize-stderr: "([0-9a-f][0-9a-f] |╾─*A(LLOC)?[0-9]+(\+[a-z0-9]+)?(<imm>)?─*╼ )+ *│.*" -> "HEX_DUMP"
//@ normalize-stderr: "HEX_DUMP\s*\n\s*HEX_DUMP" -> "HEX_DUMP"

pub struct Wrapper;
pub static MAGIC_FFI_REF: &'static Wrapper = unsafe {
5 changes: 2 additions & 3 deletions tests/ui/consts/issue-17718-const-bad-values.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
//@ normalize-stderr-32bit: "\(size: \d+, align: \d+\)" -> "(size: $$PTR, align: $$PTR)"
//@ normalize-stderr-64bit: "\(size: \d+, align: \d+\)" -> "(size: $$PTR, align: $$PTR)"
//@ normalize-stderr-test: "([0-9a-f][0-9a-f] |╾─*A(LLOC)?[0-9]+(\+[a-z0-9]+)?(<imm>)?─*╼ )+ *│.*" -> "HEX_DUMP"
//@ normalize-stderr: "\(size: \d+, align: \d+\)" -> "(size: $$PTR, align: $$PTR)"
//@ normalize-stderr: "([0-9a-f][0-9a-f] |╾─*A(LLOC)?[0-9]+(\+[a-z0-9]+)?(<imm>)?─*╼ )+ *│.*" -> "HEX_DUMP"

#![allow(static_mut_refs)]

4 changes: 2 additions & 2 deletions tests/ui/consts/issue-17718-const-bad-values.stderr
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
error[E0764]: mutable references are not allowed in the final value of constants
--> $DIR/issue-17718-const-bad-values.rs:7:34
--> $DIR/issue-17718-const-bad-values.rs:6:34
|
LL | const C1: &'static mut [usize] = &mut [];
| ^^^^^^^

error[E0080]: it is undefined behavior to use this value
--> $DIR/issue-17718-const-bad-values.rs:11:1
--> $DIR/issue-17718-const-bad-values.rs:10:1
|
LL | const C2: &'static mut i32 = unsafe { &mut S };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered reference to mutable memory in `const`
2 changes: 1 addition & 1 deletion tests/ui/consts/issue-miri-1910.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//@ error-pattern unable to turn pointer into raw bytes
//@ normalize-stderr-test: "alloc[0-9]+\+0x[a-z0-9]+" -> "ALLOC"
//@ normalize-stderr: "alloc[0-9]+\+0x[a-z0-9]+" -> "ALLOC"

const C: () = unsafe {
let foo = Some(&42 as *const i32);
4 changes: 2 additions & 2 deletions tests/ui/consts/miri_unleashed/const_refers_to_static.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//@ compile-flags: -Zunleash-the-miri-inside-of-you
//@ normalize-stderr-test: "(the raw bytes of the constant) \(size: [0-9]*, align: [0-9]*\)" -> "$1 (size: $$SIZE, align: $$ALIGN)"
//@ normalize-stderr-test: "([0-9a-f][0-9a-f] |╾─*ALLOC[0-9]+(\+[a-z0-9]+)?(<imm>)?─*╼ )+ *│.*" -> "HEX_DUMP"
//@ normalize-stderr: "(the raw bytes of the constant) \(size: [0-9]*, align: [0-9]*\)" -> "$1 (size: $$SIZE, align: $$ALIGN)"
//@ normalize-stderr: "([0-9a-f][0-9a-f] |╾─*ALLOC[0-9]+(\+[a-z0-9]+)?(<imm>)?─*╼ )+ *│.*" -> "HEX_DUMP"

use std::sync::atomic::AtomicUsize;
use std::sync::atomic::Ordering;
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//@ compile-flags: -Zunleash-the-miri-inside-of-you
//@ aux-build:static_cross_crate.rs
//@ normalize-stderr-test: "(the raw bytes of the constant) \(size: [0-9]*, align: [0-9]*\)" -> "$1 (size: $$SIZE, align: $$ALIGN)"
//@ normalize-stderr-test: "([0-9a-f][0-9a-f] |╾─*ALLOC[0-9]+(\+[a-z0-9]+)?(<imm>)?─*╼ )+ *│.*" -> "HEX_DUMP"
//@ normalize-stderr: "(the raw bytes of the constant) \(size: [0-9]*, align: [0-9]*\)" -> "$1 (size: $$SIZE, align: $$ALIGN)"
//@ normalize-stderr: "([0-9a-f][0-9a-f] |╾─*ALLOC[0-9]+(\+[a-z0-9]+)?(<imm>)?─*╼ )+ *│.*" -> "HEX_DUMP"
#![feature(half_open_range_patterns_in_slices)]
#![allow(static_mut_refs)]

4 changes: 2 additions & 2 deletions tests/ui/consts/miri_unleashed/mutable_references.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//@ compile-flags: -Zunleash-the-miri-inside-of-you
//@ normalize-stderr-test: "(the raw bytes of the constant) \(size: [0-9]*, align: [0-9]*\)" -> "$1 (size: $$SIZE, align: $$ALIGN)"
//@ normalize-stderr-test: "([0-9a-f][0-9a-f] |╾─*ALLOC[0-9]+(\+[a-z0-9]+)?(<imm>)?─*╼ )+ *│.*" -> "HEX_DUMP"
//@ normalize-stderr: "(the raw bytes of the constant) \(size: [0-9]*, align: [0-9]*\)" -> "$1 (size: $$SIZE, align: $$ALIGN)"
//@ normalize-stderr: "([0-9a-f][0-9a-f] |╾─*ALLOC[0-9]+(\+[a-z0-9]+)?(<imm>)?─*╼ )+ *│.*" -> "HEX_DUMP"

#![allow(static_mut_refs)]
use std::cell::UnsafeCell;
2 changes: 1 addition & 1 deletion tests/ui/consts/offset_from_ub.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ normalize-stderr-test: "\d+ bytes" -> "$$BYTES bytes"
//@ normalize-stderr: "\d+ bytes" -> "$$BYTES bytes"
#![feature(const_ptr_sub_ptr)]
#![feature(core_intrinsics)]

6 changes: 3 additions & 3 deletions tests/ui/consts/offset_ub.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use std::ptr;

//@ normalize-stderr-test: "0xf+" -> "0xf..f"
//@ normalize-stderr-test: "0x7f+" -> "0x7f..f"
//@ normalize-stderr-test: "\d+ bytes" -> "$$BYTES bytes"
//@ normalize-stderr: "0xf+" -> "0xf..f"
//@ normalize-stderr: "0x7f+" -> "0x7f..f"
//@ normalize-stderr: "\d+ bytes" -> "$$BYTES bytes"


pub const BEFORE_START: *const u8 = unsafe { (&0u8 as *const u8).offset(-1) }; //~NOTE
4 changes: 2 additions & 2 deletions tests/ui/consts/overflowing-consts.rs
Original file line number Diff line number Diff line change
@@ -6,8 +6,8 @@
//@ [opt]compile-flags: -O
//@ [opt_with_overflow_checks]compile-flags: -C overflow-checks=on -O
//@ ignore-pass (test tests codegen-time behaviour)
//@ normalize-stderr-test: "shift left by `(64|32)_usize`, which" -> "shift left by `%BITS%`, which"
//@ normalize-stderr-test: "shift right by `(64|32)_usize`, which" -> "shift right by `%BITS%`, which"
//@ normalize-stderr: "shift left by `(64|32)_usize`, which" -> "shift left by `%BITS%`, which"
//@ normalize-stderr: "shift right by `(64|32)_usize`, which" -> "shift right by `%BITS%`, which"


#[cfg(target_pointer_width = "32")]
4 changes: 2 additions & 2 deletions tests/ui/consts/validate_never_arrays.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Strip out raw byte dumps to make comparison platform-independent:
//@ normalize-stderr-test: "(the raw bytes of the constant) \(size: [0-9]*, align: [0-9]*\)" -> "$1 (size: $$SIZE, align: $$ALIGN)"
//@ normalize-stderr-test: "([0-9a-f][0-9a-f] |╾─*ALLOC[0-9]+(\+[a-z0-9]+)?(<imm>)?─*╼ )+ *│.*" -> "HEX_DUMP"
//@ normalize-stderr: "(the raw bytes of the constant) \(size: [0-9]*, align: [0-9]*\)" -> "$1 (size: $$SIZE, align: $$ALIGN)"
//@ normalize-stderr: "([0-9a-f][0-9a-f] |╾─*ALLOC[0-9]+(\+[a-z0-9]+)?(<imm>)?─*╼ )+ *│.*" -> "HEX_DUMP"
#![feature(never_type)]

const _: &[!; 1] = unsafe { &*(1_usize as *const [!; 1]) }; //~ ERROR undefined behavior
2 changes: 1 addition & 1 deletion tests/ui/coroutine/static-not-unpin.rs
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@

#![feature(coroutines, stmt_expr_attributes)]

//@ normalize-stderr-test: "std::pin::Unpin" -> "std::marker::Unpin"
//@ normalize-stderr: "std::pin::Unpin" -> "std::marker::Unpin"

use std::marker::Unpin;

6 changes: 3 additions & 3 deletions tests/ui/crate-loading/crateresolve1.rs
Original file line number Diff line number Diff line change
@@ -2,9 +2,9 @@
//@ aux-build:crateresolve1-2.rs
//@ aux-build:crateresolve1-3.rs

//@ normalize-stderr-test: "\.nll/" -> "/"
//@ normalize-stderr-test: "\\\?\\" -> ""
//@ normalize-stderr-test: "(lib)?crateresolve1-([123])\.[a-z]+" -> "libcrateresolve1-$2.somelib"
//@ normalize-stderr: "\.nll/" -> "/"
//@ normalize-stderr: "\\\?\\" -> ""
//@ normalize-stderr: "(lib)?crateresolve1-([123])\.[a-z]+" -> "libcrateresolve1-$2.somelib"

// NOTE: This test is duplicated at `tests/ui/error-codes/E0464.rs`.

4 changes: 2 additions & 2 deletions tests/ui/crate-loading/crateresolve2.rs
Original file line number Diff line number Diff line change
@@ -4,8 +4,8 @@
//@ aux-build:crateresolve2-2.rs
//@ aux-build:crateresolve2-3.rs

//@ normalize-stderr-test: "\.nll/" -> "/"
//@ normalize-stderr-test: "\\\?\\" -> ""
//@ normalize-stderr: "\.nll/" -> "/"
//@ normalize-stderr: "\\\?\\" -> ""

extern crate crateresolve2;
//~^ ERROR multiple candidates for `rmeta` dependency `crateresolve2` found
2 changes: 1 addition & 1 deletion tests/ui/crate-loading/invalid-rlib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//@ compile-flags: --crate-type lib --extern foo={{src-base}}/crate-loading/auxiliary/libfoo.rlib
//@ normalize-stderr-test: "failed to mmap file '.*auxiliary/libfoo.rlib':.*" -> "failed to mmap file 'auxiliary/libfoo.rlib'"
//@ normalize-stderr: "failed to mmap file '.*auxiliary/libfoo.rlib':.*" -> "failed to mmap file 'auxiliary/libfoo.rlib'"
// don't emit warn logging, it's basically the same as the errors and it's annoying to normalize
//@ rustc-env:RUSTC_LOG=error
//@ edition:2018
2 changes: 0 additions & 2 deletions tests/ui/debuginfo/debuginfo-type-name-layout-ice-94961-1.rs
Original file line number Diff line number Diff line change
@@ -4,8 +4,6 @@
//@ compile-flags:-C debuginfo=2
//@ build-fail
//@ error-pattern: too big for the target architecture
//@ normalize-stderr-64bit: "18446744073709551615" -> "SIZE"
//@ normalize-stderr-32bit: "4294967295" -> "SIZE"
Comment on lines -7 to -8
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fun fact, this hasn't needed normalization since #106873.


#![crate_type = "rlib"]

2 changes: 0 additions & 2 deletions tests/ui/debuginfo/debuginfo-type-name-layout-ice-94961-2.rs
Original file line number Diff line number Diff line change
@@ -6,8 +6,6 @@
//@ compile-flags:-C debuginfo=2
//@ build-fail
//@ error-pattern: too big for the target architecture
//@ normalize-stderr-64bit: "18446744073709551615" -> "SIZE"
//@ normalize-stderr-32bit: "4294967295" -> "SIZE"

#![crate_type = "rlib"]

2 changes: 1 addition & 1 deletion tests/ui/diagnostic-width/E0271.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//@ revisions: ascii unicode
//@[ascii] compile-flags: --diagnostic-width=40
//@[unicode] compile-flags: -Zunstable-options --error-format=human-unicode --diagnostic-width=40
//@ normalize-stderr-test: "long-type-\d+" -> "long-type-hash"
//@ normalize-stderr: "long-type-\d+" -> "long-type-hash"
trait Future {
type Error;
}
2 changes: 1 addition & 1 deletion tests/ui/diagnostic-width/long-E0308.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//@ revisions: ascii unicode
//@[ascii] compile-flags: --diagnostic-width=60 -Zwrite-long-types-to-disk=yes
//@[unicode] compile-flags: -Zunstable-options --json=diagnostic-unicode --diagnostic-width=60 -Zwrite-long-types-to-disk=yes
//@ normalize-stderr-test: "long-type-\d+" -> "long-type-hash"
//@ normalize-stderr: "long-type-\d+" -> "long-type-hash"

mod a {
// Force the "short path for unique types" machinery to trip up
2 changes: 1 addition & 1 deletion tests/ui/duplicate_entry_error.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ normalize-stderr-test: "loaded from .*libstd-.*.rlib" -> "loaded from SYSROOT/libstd-*.rlib"
//@ normalize-stderr: "loaded from .*libstd-.*.rlib" -> "loaded from SYSROOT/libstd-*.rlib"
// note-pattern: first defined in crate `std`.

// Test for issue #31788 and E0152
4 changes: 2 additions & 2 deletions tests/ui/error-codes/E0017.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//@ normalize-stderr-test: "\(size: ., align: .\)" -> ""
//@ normalize-stderr-test: " +│ ╾─+╼" -> ""
//@ normalize-stderr: "\(size: ., align: .\)" -> ""
//@ normalize-stderr: " +│ ╾─+╼" -> ""

static X: i32 = 1;
const C: i32 = 2;
2 changes: 1 addition & 1 deletion tests/ui/error-codes/E0152.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ normalize-stderr-test: "loaded from .*liballoc-.*.rlib" -> "loaded from SYSROOT/liballoc-*.rlib"
//@ normalize-stderr: "loaded from .*liballoc-.*.rlib" -> "loaded from SYSROOT/liballoc-*.rlib"
#![feature(lang_items)]

#[lang = "owned_box"]
2 changes: 1 addition & 1 deletion tests/ui/error-codes/E0275.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ normalize-stderr-test: "long-type-\d+" -> "long-type-hash"
//@ normalize-stderr: "long-type-\d+" -> "long-type-hash"
trait Foo {}

struct Bar<T>(T);
6 changes: 3 additions & 3 deletions tests/ui/error-codes/E0462.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//@ aux-build:found-staticlib.rs

//@ normalize-stderr-test: "\.nll/" -> "/"
//@ normalize-stderr-test: "\\\?\\" -> ""
//@ normalize-stderr-test: "(lib)?found_staticlib\.[a-z]+" -> "libfound_staticlib.somelib"
//@ normalize-stderr: "\.nll/" -> "/"
//@ normalize-stderr: "\\\?\\" -> ""
//@ normalize-stderr: "(lib)?found_staticlib\.[a-z]+" -> "libfound_staticlib.somelib"

extern crate found_staticlib; //~ ERROR E0462

6 changes: 3 additions & 3 deletions tests/ui/error-codes/E0464.rs
Original file line number Diff line number Diff line change
@@ -2,9 +2,9 @@
//@ aux-build:crateresolve1-2.rs
//@ aux-build:crateresolve1-3.rs

//@ normalize-stderr-test: "\.nll/" -> "/"
//@ normalize-stderr-test: "\\\?\\" -> ""
//@ normalize-stderr-test: "(lib)?crateresolve1-([123])\.[a-z]+" -> "libcrateresolve1-$2.somelib"
//@ normalize-stderr: "\.nll/" -> "/"
//@ normalize-stderr: "\\\?\\" -> ""
//@ normalize-stderr: "(lib)?crateresolve1-([123])\.[a-z]+" -> "libcrateresolve1-$2.somelib"

// NOTE: This test is duplicated from `tests/ui/crate-loading/crateresolve1.rs`.

6 changes: 3 additions & 3 deletions tests/ui/error-codes/E0523.rs
Original file line number Diff line number Diff line change
@@ -2,9 +2,9 @@
//@ aux-build:crateresolve1-2.rs
//@ aux-build:crateresolve1-3.rs

//@ normalize-stderr-test: "\.nll/" -> "/"
//@ normalize-stderr-test: "\\\?\\" -> ""
//@ normalize-stderr-test: "(lib)?crateresolve1-([123])\.[a-z]+" -> "libcrateresolve1-$2.somelib"
//@ normalize-stderr: "\.nll/" -> "/"
//@ normalize-stderr: "\\\?\\" -> ""
//@ normalize-stderr: "(lib)?crateresolve1-([123])\.[a-z]+" -> "libcrateresolve1-$2.somelib"

// NOTE: This test is duplicated from `tests/ui/crate-loading/crateresolve1.rs`.

2 changes: 1 addition & 1 deletion tests/ui/errors/remap-path-prefix-sysroot.rs
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@
// The $SRC_DIR*.rs:LL:COL normalisation doesn't kick in automatically
// as the remapped revision will not begin with $SRC_DIR_REAL,
// so we have to do it ourselves.
//@ normalize-stderr-test: ".rs:\d+:\d+" -> ".rs:LL:COL"
//@ normalize-stderr: ".rs:\d+:\d+" -> ".rs:LL:COL"

use std::thread;
struct Worker {
2 changes: 1 addition & 1 deletion tests/ui/errors/remap-path-prefix.rs
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
// no-remap-src-base: Manually remap, so the remapped path remains in .stderr file.

// The remapped paths are not normalized by compiletest.
//@ normalize-stderr-test: "\\(errors)" -> "/$1"
//@ normalize-stderr: "\\(errors)" -> "/$1"

// The remapped paths aren't recognized by compiletest, so we
// cannot use line-specific patterns.
4 changes: 2 additions & 2 deletions tests/ui/extern/extern-C-non-FFI-safe-arg-ice-52334.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// test for ICE when casting extern "C" fn when it has a non-FFI-safe argument
// issue: rust-lang/rust#52334
//@ check-pass
//@ normalize-stderr-test: "\[i8\]" -> "[i8 or u8 (arch dependant)]"
//@ normalize-stderr-test: "\[u8\]" -> "[i8 or u8 (arch dependant)]"
//@ normalize-stderr: "\[i8\]" -> "[i8 or u8 (arch dependant)]"
//@ normalize-stderr: "\[u8\]" -> "[i8 or u8 (arch dependant)]"

type Foo = extern "C" fn(::std::ffi::CStr);
//~^ WARN `extern` fn uses type
2 changes: 1 addition & 1 deletion tests/ui/extern/extern-types-field-offset.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//@ run-fail
//@ check-run-results
//@ exec-env:RUST_BACKTRACE=0
//@ normalize-stderr-test: "(core/src/panicking\.rs):[0-9]+:[0-9]+" -> "$1:$$LINE:$$COL"
//@ normalize-stderr: "(core/src/panicking\.rs):[0-9]+:[0-9]+" -> "$1:$$LINE:$$COL"
#![feature(extern_types)]

extern "C" {
2 changes: 1 addition & 1 deletion tests/ui/extern/extern-types-size_of_val.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//@ run-fail
//@ check-run-results
//@ exec-env:RUST_BACKTRACE=0
//@ normalize-stderr-test: "(core/src/panicking\.rs):[0-9]+:[0-9]+" -> "$1:$$LINE:$$COL"
//@ normalize-stderr: "(core/src/panicking\.rs):[0-9]+:[0-9]+" -> "$1:$$LINE:$$COL"
//@ revisions: size align
#![feature(extern_types)]

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ normalize-stderr-test: "long-type-\d+" -> "long-type-hash"
//@ normalize-stderr: "long-type-\d+" -> "long-type-hash"

fn id(
f: &dyn Fn(u32),
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ normalize-stderr-test: "long-type-\d+" -> "long-type-hash"
//@ normalize-stderr: "long-type-\d+" -> "long-type-hash"

// rust-lang/rust#30786: the use of `for<'b> &'b mut A: Stream<Item=T>`
// should act as assertion that item does not borrow from its stream;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ normalize-stderr-test: "long-type-\d+" -> "long-type-hash"
//@ normalize-stderr: "long-type-\d+" -> "long-type-hash"

// rust-lang/rust#30786: the use of `for<'b> &'b mut A: Stream<Item=T`
// should act as assertion that item does not borrow from its stream;
2 changes: 1 addition & 1 deletion tests/ui/hygiene/panic-location.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//@ run-fail
//@ check-run-results
//@ exec-env:RUST_BACKTRACE=0
//@ normalize-stderr-test: ".rs:\d+:\d+" -> ".rs:LL:CC"
//@ normalize-stderr: ".rs:\d+:\d+" -> ".rs:LL:CC"
//
// Regression test for issue #70963
// The reported panic location should not be `<::core::macros::panic macros>`.
2 changes: 1 addition & 1 deletion tests/ui/hygiene/unpretty-debug.rs
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
//@ compile-flags: -Zunpretty=expanded,hygiene

// Don't break whenever Symbol numbering changes
//@ normalize-stdout-test: "\d+#" -> "0#"
//@ normalize-stdout: "\d+#" -> "0#"

// minimal junk
#![feature(no_core)]
2 changes: 1 addition & 1 deletion tests/ui/hygiene/unpretty-debug.stdout
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
//@ compile-flags: -Zunpretty=expanded,hygiene

// Don't break whenever Symbol numbering changes
//@ normalize-stdout-test: "\d+#" -> "0#"
//@ normalize-stdout: "\d+#" -> "0#"

// minimal junk
#![feature /* 0#0 */(no_core)]
2 changes: 1 addition & 1 deletion tests/ui/impl-trait/erased-regions-in-hidden-ty.rs
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
//@ ignore-compare-mode-next-solver (explicit revisions)
//@ compile-flags: -Zverbose-internals
//@[next] compile-flags: -Znext-solver
//@ normalize-stderr-test: "DefId\([^\)]+\)" -> "DefId(..)"
//@ normalize-stderr: "DefId\([^\)]+\)" -> "DefId(..)"

#![feature(rustc_attrs)]
#![rustc_hidden_type_of_opaques]
2 changes: 1 addition & 1 deletion tests/ui/include-macros/parent_dir.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ normalize-stderr-test: "`: .*" -> "`: $$FILE_NOT_FOUND_MSG"
//@ normalize-stderr: "`: .*" -> "`: $$FILE_NOT_FOUND_MSG"

fn main() {
let _ = include_str!("include-macros/file.txt"); //~ ERROR couldn't read
2 changes: 1 addition & 1 deletion tests/ui/infinite/infinite-instantiation.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//@ build-fail
//@ normalize-stderr-test: ".nll/" -> "/"
//@ normalize-stderr: ".nll/" -> "/"

trait ToOpt: Sized {
fn to_option(&self) -> Option<Self>;
6 changes: 3 additions & 3 deletions tests/ui/intrinsics/not-overridden.rs
Original file line number Diff line number Diff line change
@@ -3,9 +3,9 @@
#![feature(intrinsics)]
//@ build-fail
//@ failure-status:101
//@ normalize-stderr-test: ".*note: .*\n\n" -> ""
//@ normalize-stderr-test: "thread 'rustc' panicked.*:\n.*\n" -> ""
//@ normalize-stderr-test: "internal compiler error:.*: intrinsic const_deallocate " -> ""
//@ normalize-stderr: ".*note: .*\n\n" -> ""
//@ normalize-stderr: "thread 'rustc' panicked.*:\n.*\n" -> ""
//@ normalize-stderr: "internal compiler error:.*: intrinsic const_deallocate " -> ""
//@ rustc-env:RUST_BACKTRACE=0

#[rustc_intrinsic]
4 changes: 2 additions & 2 deletions tests/ui/invalid/invalid-debugger-visualizer-option.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//@ normalize-stderr-test: "foo.random:.*\(" -> "foo.random: $$FILE_NOT_FOUND_MSG ("
//@ normalize-stderr-test: "os error \d+" -> "os error $$FILE_NOT_FOUND_CODE"
//@ normalize-stderr: "foo.random:.*\(" -> "foo.random: $$FILE_NOT_FOUND_MSG ("
//@ normalize-stderr: "os error \d+" -> "os error $$FILE_NOT_FOUND_CODE"

#![debugger_visualizer(random_file = "../foo.random")] //~ ERROR invalid argument
#![debugger_visualizer(natvis_file = "../foo.random")] //~ ERROR
4 changes: 2 additions & 2 deletions tests/ui/io-checks/non-ice-error-on-worker-io-fail.rs
Original file line number Diff line number Diff line change
@@ -19,10 +19,10 @@
//@ error-pattern: error

// On Mac OS X, we get an error like the below
//@ normalize-stderr-test: "failed to write bytecode to ./does-not-exist/output.non_ice_error_on_worker_io_fail.*" -> "io error modifying ./does-not-exist/"
//@ normalize-stderr: "failed to write bytecode to ./does-not-exist/output.non_ice_error_on_worker_io_fail.*" -> "io error modifying ./does-not-exist/"

// On Linux, we get an error like the below
//@ normalize-stderr-test: "couldn't create a temp dir.*" -> "io error modifying ./does-not-exist/"
//@ normalize-stderr: "couldn't create a temp dir.*" -> "io error modifying ./does-not-exist/"

//@ ignore-windows - this is a unix-specific test
//@ ignore-emscripten - the file-system issues do not replicate here
2 changes: 1 addition & 1 deletion tests/ui/issues/issue-20413.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ normalize-stderr-test: "long-type-\d+" -> "long-type-hash"
//@ normalize-stderr: "long-type-\d+" -> "long-type-hash"
trait Foo {
fn answer(self);
}
2 changes: 1 addition & 1 deletion tests/ui/issues/issue-21763.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Regression test for HashMap only impl'ing Send/Sync if its contents do

//@ normalize-stderr-test: "\S+[\\/]hashbrown\S+" -> "$$HASHBROWN_SRC_LOCATION"
//@ normalize-stderr: "\S+[\\/]hashbrown\S+" -> "$$HASHBROWN_SRC_LOCATION"

use std::collections::HashMap;
use std::rc::Rc;
2 changes: 1 addition & 1 deletion tests/ui/issues/issue-28625.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ normalize-stderr-test: "\d+ bits" -> "N bits"
//@ normalize-stderr: "\d+ bits" -> "N bits"

trait Bar {
type Bar;
2 changes: 1 addition & 1 deletion tests/ui/issues/issue-32377.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ normalize-stderr-test: "\d+ bits" -> "N bits"
//@ normalize-stderr: "\d+ bits" -> "N bits"

use std::mem;
use std::marker::PhantomData;
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//@ build-fail
//@ normalize-stderr-test: ".nll/" -> "/"
//@ normalize-stderr: ".nll/" -> "/"

trait Mirror {
type Image;
2 changes: 1 addition & 1 deletion tests/ui/issues/issue-67552.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//@ build-fail
//@ compile-flags: -Copt-level=0
//@ normalize-stderr-test: ".nll/" -> "/"
//@ normalize-stderr: ".nll/" -> "/"

fn main() {
rec(Empty);
2 changes: 1 addition & 1 deletion tests/ui/issues/issue-8727.rs
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
// recursions.

//@ build-fail
//@ normalize-stderr-test: ".nll/" -> "/"
//@ normalize-stderr: ".nll/" -> "/"

fn generic<T>() { //~ WARN function cannot return without recursing
generic::<Option<T>>();
2 changes: 1 addition & 1 deletion tests/ui/lang-items/duplicate.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ normalize-stderr-test: "loaded from .*libcore-.*.rlib" -> "loaded from SYSROOT/libcore-*.rlib"
//@ normalize-stderr: "loaded from .*libcore-.*.rlib" -> "loaded from SYSROOT/libcore-*.rlib"
#![feature(lang_items)]

#[lang = "sized"]
2 changes: 1 addition & 1 deletion tests/ui/layout/debug.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ normalize-stderr-test: "pref: Align\([1-8] bytes\)" -> "pref: $$SOME_ALIGN"
//@ normalize-stderr: "pref: Align\([1-8] bytes\)" -> "pref: $$SOME_ALIGN"
#![feature(never_type, rustc_attrs, type_alias_impl_trait, repr_simd)]
#![crate_type = "lib"]

6 changes: 3 additions & 3 deletions tests/ui/layout/enum-scalar-pair-int-ptr.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//@ normalize-stderr-test: "pref: Align\([1-8] bytes\)" -> "pref: $$PREF_ALIGN"
//@ normalize-stderr-test: "Int\(I[0-9]+," -> "Int(I?,"
//@ normalize-stderr-test: "valid_range: 0..=[0-9]+" -> "valid_range: $$VALID_RANGE"
//@ normalize-stderr: "pref: Align\([1-8] bytes\)" -> "pref: $$PREF_ALIGN"
//@ normalize-stderr: "Int\(I[0-9]+," -> "Int(I?,"
//@ normalize-stderr: "valid_range: 0..=[0-9]+" -> "valid_range: $$VALID_RANGE"

//! Enum layout tests related to scalar pairs with an int/ptr common primitive.

2 changes: 1 addition & 1 deletion tests/ui/layout/enum.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ normalize-stderr-test: "pref: Align\([1-8] bytes\)" -> "pref: $$PREF_ALIGN"
//@ normalize-stderr: "pref: Align\([1-8] bytes\)" -> "pref: $$PREF_ALIGN"
//! Various enum layout tests.

#![feature(rustc_attrs)]
2 changes: 1 addition & 1 deletion tests/ui/layout/ice-type-error-in-tail-124031.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ normalize-stderr-test: "\d+ bits" -> "$$BITS bits"
//@ normalize-stderr: "\d+ bits" -> "$$BITS bits"

// Regression test for issue #124031
// Checks that we don't ICE when the tail
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ normalize-stderr-test: "pref: Align\([1-8] bytes\)" -> "pref: $$PREF_ALIGN"
//@ normalize-stderr: "pref: Align\([1-8] bytes\)" -> "pref: $$PREF_ALIGN"
#![crate_type = "lib"]
#![feature(rustc_attrs)]

2 changes: 1 addition & 1 deletion tests/ui/layout/issue-96185-overaligned-enum.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ normalize-stderr-test: "pref: Align\([1-8] bytes\)" -> "pref: $$PREF_ALIGN"
//@ normalize-stderr: "pref: Align\([1-8] bytes\)" -> "pref: $$PREF_ALIGN"
#![crate_type = "lib"]
#![feature(rustc_attrs)]

2 changes: 1 addition & 1 deletion tests/ui/layout/struct.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ normalize-stderr-test: "pref: Align\([1-8] bytes\)" -> "pref: $$PREF_ALIGN"
//@ normalize-stderr: "pref: Align\([1-8] bytes\)" -> "pref: $$PREF_ALIGN"
//! Various struct layout tests.

#![feature(rustc_attrs)]
4 changes: 2 additions & 2 deletions tests/ui/layout/valid_range_oob.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//@ failure-status: 101
//@ normalize-stderr-test: "note: .*\n\n" -> ""
//@ normalize-stderr-test: "thread 'rustc' panicked.*\n" -> ""
//@ normalize-stderr: "note: .*\n\n" -> ""
//@ normalize-stderr: "thread 'rustc' panicked.*\n" -> ""
//@ rustc-env:RUST_BACKTRACE=0

#![feature(rustc_attrs)]
2 changes: 1 addition & 1 deletion tests/ui/layout/zero-sized-array-enum-niche.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ normalize-stderr-test: "pref: Align\([1-8] bytes\)" -> "pref: $$PREF_ALIGN"
//@ normalize-stderr: "pref: Align\([1-8] bytes\)" -> "pref: $$PREF_ALIGN"
#![crate_type = "lib"]
#![feature(rustc_attrs)]

4 changes: 2 additions & 2 deletions tests/ui/limits/huge-enum.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//@ build-fail
//@ normalize-stderr-test: "std::option::Option<\[u32; \d+\]>" -> "TYPE"
//@ normalize-stderr-test: "\[u32; \d+\]" -> "TYPE"
//@ normalize-stderr: "std::option::Option<\[u32; \d+\]>" -> "TYPE"
//@ normalize-stderr: "\[u32; \d+\]" -> "TYPE"

#[cfg(target_pointer_width = "32")]
type BIG = Option<[u32; (1<<29)-1]>;
7 changes: 3 additions & 4 deletions tests/ui/limits/huge-struct.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
// ignore-tidy-linelength
//@ build-fail
//@ normalize-stderr-test: "S32" -> "SXX"
//@ normalize-stderr-test: "S1M" -> "SXX"
//@ normalize-stderr-32bit: "values of the type `[^`]+` are too big" -> "values of the type $$REALLY_TOO_BIG are too big"
//@ normalize-stderr-64bit: "values of the type `[^`]+` are too big" -> "values of the type $$REALLY_TOO_BIG are too big"
//@ normalize-stderr: "S32" -> "SXX"
//@ normalize-stderr: "S1M" -> "SXX"
//@ normalize-stderr: "values of the type `[^`]+` are too big" -> "values of the type $$REALLY_TOO_BIG are too big"

struct S32<T> {
v0: T,
2 changes: 1 addition & 1 deletion tests/ui/limits/huge-struct.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: values of the type $REALLY_TOO_BIG are too big for the target architecture
--> $DIR/huge-struct.rs:48:9
--> $DIR/huge-struct.rs:47:9
|
LL | let fat: Option<SXX<SXX<SXX<u32>>>> = None;
| ^^^
2 changes: 1 addition & 1 deletion tests/ui/limits/issue-17913.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//@ build-fail
//@ normalize-stderr-test: "\[&usize; \d+\]" -> "[&usize; usize::MAX]"
//@ normalize-stderr: "\[&usize; \d+\]" -> "[&usize; usize::MAX]"
//@ error-pattern: too big for the target architecture

#[cfg(target_pointer_width = "64")]
2 changes: 0 additions & 2 deletions tests/ui/limits/issue-55878.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
//@ build-fail
//@ normalize-stderr-64bit: "18446744073709551615" -> "SIZE"
//@ normalize-stderr-32bit: "4294967295" -> "SIZE"

//@ error-pattern: are too big for the target architecture
fn main() {
2 changes: 1 addition & 1 deletion tests/ui/limits/issue-55878.stderr
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ error[E0080]: evaluation of constant value failed
note: inside `std::mem::size_of::<[u8; usize::MAX]>`
--> $SRC_DIR/core/src/mem/mod.rs:LL:COL
note: inside `main`
--> $DIR/issue-55878.rs:7:26
--> $DIR/issue-55878.rs:5:26
|
LL | println!("Size: {}", std::mem::size_of::<[u8; u64::MAX as usize]>());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2 changes: 1 addition & 1 deletion tests/ui/link-native-libs/msvc-non-utf8-output.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//@ build-fail
//@ compile-flags:-C link-arg=⦺ⅈ⽯⭏⽽◃⡽⚞
//@ only-msvc
//@ normalize-stderr-test: "(?:.|\n)*(⦺ⅈ⽯⭏⽽◃⡽⚞)(?:.|\n)*" -> "$1"
//@ normalize-stderr: "(?:.|\n)*(⦺ⅈ⽯⭏⽽◃⡽⚞)(?:.|\n)*" -> "$1"
pub fn main() {}
4 changes: 2 additions & 2 deletions tests/ui/lint/lint-overflowing-ops.rs
Original file line number Diff line number Diff line change
@@ -11,8 +11,8 @@
//@ [opt_with_overflow_checks]compile-flags: -C overflow-checks=on -O -Z deduplicate-diagnostics=yes
//@ build-fail
//@ ignore-pass (test tests codegen-time behaviour)
//@ normalize-stderr-test: "shift left by `(64|32)_usize`, which" -> "shift left by `%BITS%`, which"
//@ normalize-stderr-test: "shift right by `(64|32)_usize`, which" -> "shift right by `%BITS%`, which"
//@ normalize-stderr: "shift left by `(64|32)_usize`, which" -> "shift left by `%BITS%`, which"
//@ normalize-stderr: "shift right by `(64|32)_usize`, which" -> "shift right by `%BITS%`, which"

#![deny(arithmetic_overflow)]

2 changes: 1 addition & 1 deletion tests/ui/lto/lto-duplicate-symbols.rs
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
//@ error-pattern:Linking globals named 'foo': symbol multiply defined!
//@ compile-flags: -C lto
//@ no-prefer-dynamic
//@ normalize-stderr-test: "lto-duplicate-symbols2\.lto_duplicate_symbols2\.[0-9a-zA-Z]+-cgu" -> "lto-duplicate-symbols2.lto_duplicate_symbols2.HASH-cgu"
//@ normalize-stderr: "lto-duplicate-symbols2\.lto_duplicate_symbols2\.[0-9a-zA-Z]+-cgu" -> "lto-duplicate-symbols2.lto_duplicate_symbols2.HASH-cgu"
extern crate lto_duplicate_symbols1;
extern crate lto_duplicate_symbols2;

2 changes: 1 addition & 1 deletion tests/ui/macros/macros-nonfatal-errors.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ normalize-stderr-test: "`: .*" -> "`: $$FILE_NOT_FOUND_MSG"
//@ normalize-stderr: "`: .*" -> "`: $$FILE_NOT_FOUND_MSG"

// test that errors in a (selection) of macros don't kill compilation
// immediately, so that we get more errors listed at a time.
2 changes: 1 addition & 1 deletion tests/ui/methods/inherent-bound-in-probe.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ normalize-stderr-test: "long-type-\d+" -> "long-type-hash"
//@ normalize-stderr: "long-type-\d+" -> "long-type-hash"

// Fixes #110131
//
8 changes: 4 additions & 4 deletions tests/ui/mir/lint/storage-live.rs
Original file line number Diff line number Diff line change
@@ -2,10 +2,10 @@
//@ failure-status: 101
//@ error-pattern: broken MIR in
//@ error-pattern: StorageLive(_1) which already has storage here
//@ normalize-stderr-test: "note: .*\n\n" -> ""
//@ normalize-stderr-test: "thread 'rustc' panicked.*\n" -> ""
//@ normalize-stderr-test: "storage_live\[....\]" -> "storage_live[HASH]"
//@ normalize-stderr-test: "(delayed at [^:]+):\d+:\d+ - " -> "$1:LL:CC - "
//@ normalize-stderr: "note: .*\n\n" -> ""
//@ normalize-stderr: "thread 'rustc' panicked.*\n" -> ""
//@ normalize-stderr: "storage_live\[....\]" -> "storage_live[HASH]"
//@ normalize-stderr: "(delayed at [^:]+):\d+:\d+ - " -> "$1:LL:CC - "
//@ rustc-env:RUST_BACKTRACE=0

#![feature(custom_mir, core_intrinsics)]
4 changes: 2 additions & 2 deletions tests/ui/modules/path-no-file-name.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//@ normalize-stderr-test: "\.:.*\(" -> ".: $$ACCESS_DENIED_MSG ("
//@ normalize-stderr-test: "os error \d+" -> "os error $$ACCESS_DENIED_CODE"
//@ normalize-stderr: "\.:.*\(" -> ".: $$ACCESS_DENIED_MSG ("
//@ normalize-stderr: "os error \d+" -> "os error $$ACCESS_DENIED_CODE"

#[path = "."]
mod m; //~ ERROR couldn't read
2 changes: 1 addition & 1 deletion tests/ui/packed/packed-struct-transmute.rs
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
// the error points to the start of the file, not the line with the
// transmute

//@ normalize-stderr-test: "\d+ bits" -> "N bits"
//@ normalize-stderr: "\d+ bits" -> "N bits"
//@ error-pattern: cannot transmute between types of different sizes, or dependently-sized types

use std::mem;
2 changes: 1 addition & 1 deletion tests/ui/panic-handler/panic-handler-std.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ normalize-stderr-test: "loaded from .*libstd-.*.rlib" -> "loaded from SYSROOT/libstd-*.rlib"
//@ normalize-stderr: "loaded from .*libstd-.*.rlib" -> "loaded from SYSROOT/libstd-*.rlib"
//@ error-pattern: found duplicate lang item `panic_impl`

extern crate core;
12 changes: 6 additions & 6 deletions tests/ui/panics/default-backtrace-ice.rs
Original file line number Diff line number Diff line change
@@ -5,12 +5,12 @@
//@ error-pattern:__rust_begin_short_backtrace
//@ failure-status:101
//@ ignore-msvc
//@ normalize-stderr-test: "note: .*" -> ""
//@ normalize-stderr-test: "thread 'rustc' .*" -> ""
//@ normalize-stderr-test: " +\d+:.*__rust_begin_short_backtrace.*" -> "(begin_short_backtrace)"
//@ normalize-stderr-test: " +\d+:.*__rust_end_short_backtrace.*" -> "(end_short_backtrace)"
//@ normalize-stderr-test: " +\d+:.*\n" -> ""
//@ normalize-stderr-test: " +at .*\n" -> ""
//@ normalize-stderr: "note: .*" -> ""
//@ normalize-stderr: "thread 'rustc' .*" -> ""
//@ normalize-stderr: " +\d+:.*__rust_begin_short_backtrace.*" -> "(begin_short_backtrace)"
//@ normalize-stderr: " +\d+:.*__rust_end_short_backtrace.*" -> "(end_short_backtrace)"
//@ normalize-stderr: " +\d+:.*\n" -> ""
//@ normalize-stderr: " +at .*\n" -> ""
//
// This test makes sure that full backtraces are used for ICEs when
// RUST_BACKTRACE is not set. It does this by checking for the presence of
6 changes: 3 additions & 3 deletions tests/ui/panics/issue-47429-short-backtraces.rs
Original file line number Diff line number Diff line change
@@ -8,11 +8,11 @@

// This is needed to avoid test output differences across std being built with v0 symbols vs legacy
// symbols.
//@ normalize-stderr-test: "begin_panic::<&str>" -> "begin_panic"
//@ normalize-stderr: "begin_panic::<&str>" -> "begin_panic"
// This variant occurs on macOS with `rust.debuginfo-level = "line-tables-only"` (#133997)
//@ normalize-stderr-test: " begin_panic<&str>" -> " std::panicking::begin_panic"
//@ normalize-stderr: " begin_panic<&str>" -> " std::panicking::begin_panic"
// And this is for differences between std with and without debuginfo.
//@ normalize-stderr-test: "\n +at [^\n]+" -> ""
//@ normalize-stderr: "\n +at [^\n]+" -> ""

//@ ignore-msvc see #62897 and `backtrace-debuginfo.rs` test
//@ ignore-android FIXME #17520
6 changes: 3 additions & 3 deletions tests/ui/panics/panic-in-cleanup.rs
Original file line number Diff line number Diff line change
@@ -2,9 +2,9 @@
//@ exec-env:RUST_BACKTRACE=0
//@ check-run-results
//@ error-pattern: panic in a destructor during cleanup
//@ normalize-stderr-test: "\n +[0-9]+:[^\n]+" -> ""
//@ normalize-stderr-test: "\n +at [^\n]+" -> ""
//@ normalize-stderr-test: "(core/src/panicking\.rs):[0-9]+:[0-9]+" -> "$1:$$LINE:$$COL"
//@ normalize-stderr: "\n +[0-9]+:[^\n]+" -> ""
//@ normalize-stderr: "\n +at [^\n]+" -> ""
//@ normalize-stderr: "(core/src/panicking\.rs):[0-9]+:[0-9]+" -> "$1:$$LINE:$$COL"
//@ needs-unwind
//@ ignore-emscripten "RuntimeError" junk in output
//@ ignore-msvc SEH doesn't do panic-during-cleanup the same way as everyone else
6 changes: 3 additions & 3 deletions tests/ui/panics/panic-in-ffi.rs
Original file line number Diff line number Diff line change
@@ -3,9 +3,9 @@
//@ check-run-results
//@ error-pattern: panic in a function that cannot unwind
//@ error-pattern: Noisy Drop
//@ normalize-stderr-test: "\n +[0-9]+:[^\n]+" -> ""
//@ normalize-stderr-test: "\n +at [^\n]+" -> ""
//@ normalize-stderr-test: "(core/src/panicking\.rs):[0-9]+:[0-9]+" -> "$1:$$LINE:$$COL"
//@ normalize-stderr: "\n +[0-9]+:[^\n]+" -> ""
//@ normalize-stderr: "\n +at [^\n]+" -> ""
//@ normalize-stderr: "(core/src/panicking\.rs):[0-9]+:[0-9]+" -> "$1:$$LINE:$$COL"
//@ needs-unwind
//@ ignore-emscripten "RuntimeError" junk in output

6 changes: 3 additions & 3 deletions tests/ui/panics/panic-in-message-fmt.rs
Original file line number Diff line number Diff line change
@@ -4,9 +4,9 @@
//@ exec-env:RUST_BACKTRACE=0
//@ check-run-results
//@ error-pattern: panicked while processing panic
//@ normalize-stderr-test: "\n +[0-9]+:[^\n]+" -> ""
//@ normalize-stderr-test: "\n +at [^\n]+" -> ""
//@ normalize-stderr-test: "(core/src/panicking\.rs):[0-9]+:[0-9]+" -> "$1:$$LINE:$$COL"
//@ normalize-stderr: "\n +[0-9]+:[^\n]+" -> ""
//@ normalize-stderr: "\n +at [^\n]+" -> ""
//@ normalize-stderr: "(core/src/panicking\.rs):[0-9]+:[0-9]+" -> "$1:$$LINE:$$COL"
//@ ignore-emscripten "RuntimeError" junk in output

use std::fmt::{Display, self};
2 changes: 1 addition & 1 deletion tests/ui/panics/panic-short-backtrace-windows-x86_64.rs
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@
// We need to normalize out frame 5 because without debug info, dbghelp.dll doesn't know where CGU
// internal functions like `main` start or end and so it will return whatever symbol happens
// to be located near the address.
//@ normalize-stderr-test: "5: .*" -> "5: some Rust fn"
//@ normalize-stderr: "5: .*" -> "5: some Rust fn"

// Backtraces are pretty broken in general on i686-pc-windows-msvc (#62897).
//@ only-x86_64-pc-windows-msvc
6 changes: 3 additions & 3 deletions tests/ui/panics/runtime-switch.rs
Original file line number Diff line number Diff line change
@@ -8,11 +8,11 @@

// This is needed to avoid test output differences across std being built with v0 symbols vs legacy
// symbols.
//@ normalize-stderr-test: "begin_panic::<&str>" -> "begin_panic"
//@ normalize-stderr: "begin_panic::<&str>" -> "begin_panic"
// This variant occurs on macOS with `rust.debuginfo-level = "line-tables-only"` (#133997)
//@ normalize-stderr-test: " begin_panic<&str>" -> " std::panicking::begin_panic"
//@ normalize-stderr: " begin_panic<&str>" -> " std::panicking::begin_panic"
// And this is for differences between std with and without debuginfo.
//@ normalize-stderr-test: "\n +at [^\n]+" -> ""
//@ normalize-stderr: "\n +at [^\n]+" -> ""

//@ ignore-msvc see #62897 and `backtrace-debuginfo.rs` test
//@ ignore-android FIXME #17520
6 changes: 3 additions & 3 deletions tests/ui/panics/short-ice-remove-middle-frames-2.rs
Original file line number Diff line number Diff line change
@@ -11,11 +11,11 @@
//@ ignore-msvc the `__rust_{begin,end}_short_backtrace` symbols aren't reliable.
// This is needed to avoid test output differences across std being built with v0 symbols vs legacy
// symbols.
//@ normalize-stderr-test: "begin_panic::<&str>" -> "begin_panic"
//@ normalize-stderr: "begin_panic::<&str>" -> "begin_panic"
// This variant occurs on macOS with `rust.debuginfo-level = "line-tables-only"` (#133997)
//@ normalize-stderr-test: " begin_panic<&str>" -> " std::panicking::begin_panic"
//@ normalize-stderr: " begin_panic<&str>" -> " std::panicking::begin_panic"
// And this is for differences between std with and without debuginfo.
//@ normalize-stderr-test: "\n +at [^\n]+" -> ""
//@ normalize-stderr: "\n +at [^\n]+" -> ""

/// This test case make sure that we can have multiple pairs of `__rust_{begin,end}_short_backtrace`

6 changes: 3 additions & 3 deletions tests/ui/panics/short-ice-remove-middle-frames.rs
Original file line number Diff line number Diff line change
@@ -12,11 +12,11 @@

// This is needed to avoid test output differences across std being built with v0 symbols vs legacy
// symbols.
//@ normalize-stderr-test: "begin_panic::<&str>" -> "begin_panic"
//@ normalize-stderr: "begin_panic::<&str>" -> "begin_panic"
// This variant occurs on macOS with `rust.debuginfo-level = "line-tables-only"` (#133997)
//@ normalize-stderr-test: " begin_panic<&str>" -> " std::panicking::begin_panic"
//@ normalize-stderr: " begin_panic<&str>" -> " std::panicking::begin_panic"
// And this is for differences between std with and without debuginfo.
//@ normalize-stderr-test: "\n +at [^\n]+" -> ""
//@ normalize-stderr: "\n +at [^\n]+" -> ""

#[inline(never)]
fn __rust_begin_short_backtrace<T, F: FnOnce() -> T>(f: F) -> T {
4 changes: 2 additions & 2 deletions tests/ui/parser/issues/issue-5806.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//@ normalize-stderr-test: "parser:.*\(" -> "parser: $$ACCESS_DENIED_MSG ("
//@ normalize-stderr-test: "os error \d+" -> "os error $$ACCESS_DENIED_CODE"
//@ normalize-stderr: "parser:.*\(" -> "parser: $$ACCESS_DENIED_MSG ("
//@ normalize-stderr: "os error \d+" -> "os error $$ACCESS_DENIED_CODE"

#[path = "../parser"]
mod foo; //~ ERROR couldn't read
2 changes: 1 addition & 1 deletion tests/ui/parser/mod_file_with_path_attr.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ normalize-stderr-test: "not_a_real_file.rs:.*\(" -> "not_a_real_file.rs: $$FILE_NOT_FOUND_MSG ("
//@ normalize-stderr: "not_a_real_file.rs:.*\(" -> "not_a_real_file.rs: $$FILE_NOT_FOUND_MSG ("

#[path = "not_a_real_file.rs"]
mod m; //~ ERROR not_a_real_file.rs
6 changes: 3 additions & 3 deletions tests/ui/print-request/macos-target.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//@ only-apple
//@ compile-flags: --print deployment-target
//@ normalize-stdout-test: "\w*_DEPLOYMENT_TARGET" -> "$$OS_DEPLOYMENT_TARGET"
//@ normalize-stdout-test: "\d+\." -> "$$CURRENT_MAJOR_VERSION."
//@ normalize-stdout-test: "\d+" -> "$$CURRENT_MINOR_VERSION"
//@ normalize-stdout: "\w*_DEPLOYMENT_TARGET" -> "$$OS_DEPLOYMENT_TARGET"
//@ normalize-stdout: "\d+\." -> "$$CURRENT_MAJOR_VERSION."
//@ normalize-stdout: "\d+" -> "$$CURRENT_MINOR_VERSION"
//@ check-pass

fn main() {}
4 changes: 2 additions & 2 deletions tests/ui/proc-macro/load-panic-backtrace.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//@ proc-macro: test-macros.rs
//@ compile-flags: -Z proc-macro-backtrace
//@ rustc-env:RUST_BACKTRACE=0
//@ normalize-stderr-test: "thread '.*' panicked " -> ""
//@ normalize-stderr-test: "note:.*RUST_BACKTRACE=1.*\n" -> ""
//@ normalize-stderr: "thread '.*' panicked " -> ""
//@ normalize-stderr: "note:.*RUST_BACKTRACE=1.*\n" -> ""
//@ needs-unwind proc macro panics to report errors

#[macro_use]
6 changes: 3 additions & 3 deletions tests/ui/proc-macro/meta-macro-hygiene.rs
Original file line number Diff line number Diff line change
@@ -4,9 +4,9 @@
//@ compile-flags: -Z span-debug -Z macro-backtrace -Z unpretty=expanded,hygiene -Z trim-diagnostic-paths=no
//@ check-pass
// ignore-tidy-linelength
//@ normalize-stdout-test: "\d+#" -> "0#"
//@ normalize-stdout-test: "expn\d{3,}" -> "expnNNN"
//@ normalize-stdout-test: "extern crate compiler_builtins /\* \d+ \*/" -> "extern crate compiler_builtins /* NNN */"
//@ normalize-stdout: "\d+#" -> "0#"
//@ normalize-stdout: "expn\d{3,}" -> "expnNNN"
//@ normalize-stdout: "extern crate compiler_builtins /\* \d+ \*/" -> "extern crate compiler_builtins /* NNN */"
//
// We don't care about symbol ids, so we set them all to 0
// in the stdout
6 changes: 3 additions & 3 deletions tests/ui/proc-macro/meta-macro-hygiene.stdout
Original file line number Diff line number Diff line change
@@ -8,9 +8,9 @@ Respanned: TokenStream [Ident { ident: "$crate", span: $DIR/auxiliary/make-macro
//@ compile-flags: -Z span-debug -Z macro-backtrace -Z unpretty=expanded,hygiene -Z trim-diagnostic-paths=no
//@ check-pass
// ignore-tidy-linelength
//@ normalize-stdout-test: "\d+#" -> "0#"
//@ normalize-stdout-test: "expn\d{3,}" -> "expnNNN"
//@ normalize-stdout-test: "extern crate compiler_builtins /\* \d+ \*/" -> "extern crate compiler_builtins /* NNN */"
//@ normalize-stdout: "\d+#" -> "0#"
//@ normalize-stdout: "expn\d{3,}" -> "expnNNN"
//@ normalize-stdout: "extern crate compiler_builtins /\* \d+ \*/" -> "extern crate compiler_builtins /* NNN */"
//
// We don't care about symbol ids, so we set them all to 0
// in the stdout
6 changes: 3 additions & 3 deletions tests/ui/proc-macro/nonterminal-token-hygiene.rs
Original file line number Diff line number Diff line change
@@ -4,9 +4,9 @@
//@ compile-flags: -Z span-debug -Z macro-backtrace -Z unpretty=expanded,hygiene
//@ compile-flags: -Z trim-diagnostic-paths=no
// ignore-tidy-linelength
//@ normalize-stdout-test: "\d+#" -> "0#"
//@ normalize-stdout-test: "expn\d{3,}" -> "expnNNN"
//@ normalize-stdout-test: "extern crate compiler_builtins /\* \d+ \*/" -> "extern crate compiler_builtins /* NNN */"
//@ normalize-stdout: "\d+#" -> "0#"
//@ normalize-stdout: "expn\d{3,}" -> "expnNNN"
//@ normalize-stdout: "extern crate compiler_builtins /\* \d+ \*/" -> "extern crate compiler_builtins /* NNN */"
//@ proc-macro: test-macros.rs

#![feature(decl_macro)]
6 changes: 3 additions & 3 deletions tests/ui/proc-macro/nonterminal-token-hygiene.stdout
Original file line number Diff line number Diff line change
@@ -28,9 +28,9 @@ PRINT-BANG INPUT (DEBUG): TokenStream [
//@ compile-flags: -Z span-debug -Z macro-backtrace -Z unpretty=expanded,hygiene
//@ compile-flags: -Z trim-diagnostic-paths=no
// ignore-tidy-linelength
//@ normalize-stdout-test: "\d+#" -> "0#"
//@ normalize-stdout-test: "expn\d{3,}" -> "expnNNN"
//@ normalize-stdout-test: "extern crate compiler_builtins /\* \d+ \*/" -> "extern crate compiler_builtins /* NNN */"
//@ normalize-stdout: "\d+#" -> "0#"
//@ normalize-stdout: "expn\d{3,}" -> "expnNNN"
//@ normalize-stdout: "extern crate compiler_builtins /\* \d+ \*/" -> "extern crate compiler_builtins /* NNN */"
//@ proc-macro: test-macros.rs

#![feature /* 0#0 */(decl_macro)]
2 changes: 1 addition & 1 deletion tests/ui/process/println-with-broken-pipe.rs
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
//@ ignore-fuchsia
//@ ignore-horizon
//@ ignore-android
//@ normalize-stderr-test: ".rs:\d+:\d+" -> ".rs:LL:CC"
//@ normalize-stderr: ".rs:\d+:\d+" -> ".rs:LL:CC"
//@ compile-flags: -Zon-broken-pipe=error

// Test what the error message looks like when `println!()` panics because of
2 changes: 1 addition & 1 deletion tests/ui/recursion/issue-23122-2.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ normalize-stderr-test: "long-type-\d+" -> "long-type-hash"
//@ normalize-stderr: "long-type-\d+" -> "long-type-hash"
trait Next {
type Next: Next;
}
2 changes: 1 addition & 1 deletion tests/ui/recursion/issue-83150.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//~ ERROR overflow evaluating the requirement `Map<&mut std::ops::Range<u8>, {closure@$DIR/issue-83150.rs:13:24: 13:27}>: Iterator`
//@ build-fail
//@ compile-flags: -Copt-level=0
//@ normalize-stderr-test: "long-type-\d+" -> "long-type-hash"
//@ normalize-stderr: "long-type-\d+" -> "long-type-hash"

fn main() {
let mut iter = 0u8..1;
2 changes: 1 addition & 1 deletion tests/ui/recursion/recursion.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//@ build-fail
//@ compile-flags:-C overflow-checks=off
//@ normalize-stderr-test: ".nll/" -> "/"
//@ normalize-stderr: ".nll/" -> "/"

enum Nil {NilValue}
struct Cons<T> {head:isize, tail:T}
2 changes: 1 addition & 1 deletion tests/ui/regions/issue-102374.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ normalize-stderr-test: "long-type-\d+" -> "long-type-hash"
//@ normalize-stderr: "long-type-\d+" -> "long-type-hash"
use std::cell::Cell;

#[rustfmt::skip]
2 changes: 1 addition & 1 deletion tests/ui/repr/repr-c-dead-variants.rs
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@

// See also: repr-c-int-dead-variants.rs

//@ normalize-stderr-test: "pref: Align\([1-8] bytes\)" -> "pref: $$SOME_ALIGN"
//@ normalize-stderr: "pref: Align\([1-8] bytes\)" -> "pref: $$SOME_ALIGN"

// This test depends on the value of the `c_enum_min_bits` target option.
// As there's no way to actually check it from UI test, we only run this test on a subset of archs.
2 changes: 1 addition & 1 deletion tests/ui/repr/repr-c-int-dead-variants.rs
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@

// See also: repr-c-dead-variants.rs

//@ normalize-stderr-test: "pref: Align\([1-8] bytes\)" -> "pref: $$SOME_ALIGN"
//@ normalize-stderr: "pref: Align\([1-8] bytes\)" -> "pref: $$SOME_ALIGN"

// A simple uninhabited type.
enum Void {}
6 changes: 3 additions & 3 deletions tests/ui/resolve/multiple_definitions_attribute_merging.rs
Original file line number Diff line number Diff line change
@@ -4,9 +4,9 @@

//@known-bug: #120873
//@ failure-status: 101
//@ normalize-stderr-test: "note: .*\n\n" -> ""
//@ normalize-stderr-test: "thread 'rustc' panicked.*\n" -> ""
//@ normalize-stderr-test: "(error: internal compiler error: [^:]+):\d+:\d+: " -> "$1:LL:CC: "
//@ normalize-stderr: "note: .*\n\n" -> ""
//@ normalize-stderr: "thread 'rustc' panicked.*\n" -> ""
//@ normalize-stderr: "(error: internal compiler error: [^:]+):\d+:\d+: " -> "$1:LL:CC: "
//@ rustc-env:RUST_BACKTRACE=0

#[repr(packed)]
6 changes: 3 additions & 3 deletions tests/ui/resolve/proc_macro_generated_packed.rs
Original file line number Diff line number Diff line change
@@ -4,9 +4,9 @@
//@proc-macro: proc_macro_generate_packed.rs
//@known-bug: #120873
//@ failure-status: 101
//@ normalize-stderr-test: "note: .*\n\n" -> ""
//@ normalize-stderr-test: "thread 'rustc' panicked.*\n" -> ""
//@ normalize-stderr-test: "(error: internal compiler error: [^:]+):\d+:\d+: " -> "$1:LL:CC: "
//@ normalize-stderr: "note: .*\n\n" -> ""
//@ normalize-stderr: "thread 'rustc' panicked.*\n" -> ""
//@ normalize-stderr: "(error: internal compiler error: [^:]+):\d+:\d+: " -> "$1:LL:CC: "
//@ rustc-env:RUST_BACKTRACE=0

extern crate proc_macro_generate_packed;
12 changes: 6 additions & 6 deletions tests/ui/rfcs/rfc-2627-raw-dylib/dlltool-failed.rs
Original file line number Diff line number Diff line change
@@ -2,12 +2,12 @@

//@ needs-dlltool
//@ compile-flags: --crate-type lib --emit link
//@ normalize-stderr-test: "[^ ']*/dlltool.exe" -> "$$DLLTOOL"
//@ normalize-stderr-test: "[^ ]*/foo.dll_imports.def" -> "$$DEF_FILE"
//@ normalize-stderr-test: "[^ ]*/foo.dll_imports.lib" -> "$$LIB_FILE"
//@ normalize-stderr-test: "-m [^ ]*" -> "$$TARGET_MACHINE"
//@ normalize-stderr-test: "-f [^ ]*" -> "$$ASM_FLAGS"
//@ normalize-stderr-test: "--temp-prefix [^ ]*/foo.dll" -> "$$TEMP_PREFIX"
//@ normalize-stderr: "[^ ']*/dlltool.exe" -> "$$DLLTOOL"
//@ normalize-stderr: "[^ ]*/foo.dll_imports.def" -> "$$DEF_FILE"
//@ normalize-stderr: "[^ ]*/foo.dll_imports.lib" -> "$$LIB_FILE"
//@ normalize-stderr: "-m [^ ]*" -> "$$TARGET_MACHINE"
//@ normalize-stderr: "-f [^ ]*" -> "$$ASM_FLAGS"
//@ normalize-stderr: "--temp-prefix [^ ]*/foo.dll" -> "$$TEMP_PREFIX"
#[link(name = "foo", kind = "raw-dylib")]
extern "C" {
// `@1` is an invalid name to export, as it usually indicates that something
4 changes: 2 additions & 2 deletions tests/ui/statics/mutable_memory_validation.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//issue: rust-lang/rust#122548

// Strip out raw byte dumps to make comparison platform-independent:
//@ normalize-stderr-test: "(the raw bytes of the constant) \(size: [0-9]*, align: [0-9]*\)" -> "$1 (size: $$SIZE, align: $$ALIGN)"
//@ normalize-stderr-test: "([0-9a-f][0-9a-f] |╾─*A(LLOC)?[0-9]+(\+[a-z0-9]+)?(<imm>)?─*╼ )+ *│.*" -> "HEX_DUMP"
//@ normalize-stderr: "(the raw bytes of the constant) \(size: [0-9]*, align: [0-9]*\)" -> "$1 (size: $$SIZE, align: $$ALIGN)"
//@ normalize-stderr: "([0-9a-f][0-9a-f] |╾─*A(LLOC)?[0-9]+(\+[a-z0-9]+)?(<imm>)?─*╼ )+ *│.*" -> "HEX_DUMP"

use std::cell::UnsafeCell;

2 changes: 1 addition & 1 deletion tests/ui/svh/changing-crates.rs
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
//@ aux-build:changing-crates-a1.rs
//@ aux-build:changing-crates-b.rs
//@ aux-build:changing-crates-a2.rs
//@ normalize-stderr-test: "(crate `(\w+)`:) .*" -> "$1 $$PATH_$2"
//@ normalize-stderr: "(crate `(\w+)`:) .*" -> "$1 $$PATH_$2"

extern crate a;
extern crate b; //~ ERROR: found possibly newer version of crate `a` which `b` depends on
2 changes: 1 addition & 1 deletion tests/ui/svh/svh-change-lit.rs
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
//@ aux-build:svh-a-base.rs
//@ aux-build:svh-b.rs
//@ aux-build:svh-a-change-lit.rs
//@ normalize-stderr-test: "(crate `(\w+)`:) .*" -> "$1 $$PATH_$2"
//@ normalize-stderr: "(crate `(\w+)`:) .*" -> "$1 $$PATH_$2"

extern crate a;
extern crate b; //~ ERROR: found possibly newer version of crate `a` which `b` depends on
2 changes: 1 addition & 1 deletion tests/ui/svh/svh-change-significant-cfg.rs
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
//@ aux-build:svh-a-base.rs
//@ aux-build:svh-b.rs
//@ aux-build:svh-a-change-significant-cfg.rs
//@ normalize-stderr-test: "(crate `(\w+)`:) .*" -> "$1 $$PATH_$2"
//@ normalize-stderr: "(crate `(\w+)`:) .*" -> "$1 $$PATH_$2"

extern crate a;
extern crate b; //~ ERROR: found possibly newer version of crate `a` which `b` depends on
2 changes: 1 addition & 1 deletion tests/ui/svh/svh-change-trait-bound.rs
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
//@ aux-build:svh-a-base.rs
//@ aux-build:svh-b.rs
//@ aux-build:svh-a-change-trait-bound.rs
//@ normalize-stderr-test: "(crate `(\w+)`:) .*" -> "$1 $$PATH_$2"
//@ normalize-stderr: "(crate `(\w+)`:) .*" -> "$1 $$PATH_$2"

extern crate a;
extern crate b; //~ ERROR: found possibly newer version of crate `a` which `b` depends on
2 changes: 1 addition & 1 deletion tests/ui/svh/svh-change-type-arg.rs
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
//@ aux-build:svh-a-base.rs
//@ aux-build:svh-b.rs
//@ aux-build:svh-a-change-type-arg.rs
//@ normalize-stderr-test: "(crate `(\w+)`:) .*" -> "$1 $$PATH_$2"
//@ normalize-stderr: "(crate `(\w+)`:) .*" -> "$1 $$PATH_$2"

extern crate a;
extern crate b; //~ ERROR: found possibly newer version of crate `a` which `b` depends on
2 changes: 1 addition & 1 deletion tests/ui/svh/svh-change-type-ret.rs
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
//@ aux-build:svh-a-base.rs
//@ aux-build:svh-b.rs
//@ aux-build:svh-a-change-type-ret.rs
//@ normalize-stderr-test: "(crate `(\w+)`:) .*" -> "$1 $$PATH_$2"
//@ normalize-stderr: "(crate `(\w+)`:) .*" -> "$1 $$PATH_$2"

extern crate a;
extern crate b; //~ ERROR: found possibly newer version of crate `a` which `b` depends on
2 changes: 1 addition & 1 deletion tests/ui/svh/svh-change-type-static.rs
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
//@ aux-build:svh-a-base.rs
//@ aux-build:svh-b.rs
//@ aux-build:svh-a-change-type-static.rs
//@ normalize-stderr-test: "(crate `(\w+)`:) .*" -> "$1 $$PATH_$2"
//@ normalize-stderr: "(crate `(\w+)`:) .*" -> "$1 $$PATH_$2"

extern crate a;
extern crate b; //~ ERROR: found possibly newer version of crate `a` which `b` depends on
2 changes: 1 addition & 1 deletion tests/ui/svh/svh-use-trait.rs
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
//@ aux-build:svh-uta-base.rs
//@ aux-build:svh-utb.rs
//@ aux-build:svh-uta-change-use-trait.rs
//@ normalize-stderr-test: "(crate `(\w+)`:) .*" -> "$1 $$PATH_$2"
//@ normalize-stderr: "(crate `(\w+)`:) .*" -> "$1 $$PATH_$2"

//! "svh-uta-trait.rs" is checking that we detect a
//! change from `use foo::TraitB` to use `foo::TraitB` in the hash
4 changes: 2 additions & 2 deletions tests/ui/symbol-names/const-generics-demangling.rs
Original file line number Diff line number Diff line change
@@ -3,8 +3,8 @@
//@ compile-flags: --crate-name=c
//@[legacy]compile-flags: -C symbol-mangling-version=legacy -Z unstable-options
//@ [v0]compile-flags: -C symbol-mangling-version=v0
//@[legacy]normalize-stderr-test: "h[[:xdigit:]]{16}" -> "h[HASH]"
//@ [v0]normalize-stderr-test: "c\[.*?\]" -> "c[HASH]"
//@[legacy]normalize-stderr: "h[[:xdigit:]]{16}" -> "h[HASH]"
//@ [v0]normalize-stderr: "c\[.*?\]" -> "c[HASH]"
#![feature(rustc_attrs)]

pub struct Unsigned<const F: u8>;
2 changes: 1 addition & 1 deletion tests/ui/symbol-names/const-generics-str-demangling.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//@ build-fail
//@ compile-flags: -C symbol-mangling-version=v0 --crate-name=c
//@ normalize-stderr-test: "c\[.*?\]" -> "c[HASH]"
//@ normalize-stderr: "c\[.*?\]" -> "c[HASH]"
#![feature(adt_const_params, unsized_const_params, rustc_attrs)]
#![allow(incomplete_features)]

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//@ build-fail
//@ compile-flags: -C symbol-mangling-version=v0 --crate-name=c

//@ normalize-stderr-test: "c\[[0-9a-f]+\]" -> "c[HASH]"
//@ normalize-stderr: "c\[[0-9a-f]+\]" -> "c[HASH]"

#![feature(adt_const_params, unsized_const_params, decl_macro, rustc_attrs)]
#![allow(incomplete_features)]
2 changes: 1 addition & 1 deletion tests/ui/symbol-names/impl1.rs
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
//@ revisions: legacy v0
//@[legacy]compile-flags: -Z unstable-options -C symbol-mangling-version=legacy
//@[v0]compile-flags: -C symbol-mangling-version=v0
//@[legacy]normalize-stderr-test: "h[\w]{16}E?\)" -> "<SYMBOL_HASH>)"
//@[legacy]normalize-stderr: "h[\w]{16}E?\)" -> "<SYMBOL_HASH>)"

#![feature(auto_traits, rustc_attrs)]
#![allow(dead_code)]
2 changes: 1 addition & 1 deletion tests/ui/symbol-names/issue-75326.rs
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
//@ revisions: legacy v0
//@[legacy]compile-flags: -Z unstable-options -C symbol-mangling-version=legacy
//@[v0]compile-flags: -C symbol-mangling-version=v0
//@[legacy]normalize-stderr-test: "h[\w{16}]+" -> "SYMBOL_HASH"
//@[legacy]normalize-stderr: "h[\w{16}]+" -> "SYMBOL_HASH"

#![feature(rustc_attrs)]

2 changes: 1 addition & 1 deletion tests/ui/symbol-names/trait-objects.rs
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
//@ build-fail
//@ revisions: v0
//@[v0]compile-flags: -C symbol-mangling-version=v0
//@[v0]normalize-stderr-test: "core\[.*?\]" -> "core[HASH]"
//@[v0]normalize-stderr: "core\[.*?\]" -> "core[HASH]"

#![feature(rustc_attrs)]

4 changes: 2 additions & 2 deletions tests/ui/symbol-names/types.rs
Original file line number Diff line number Diff line change
@@ -4,8 +4,8 @@
//@ [legacy] compile-flags: -Csymbol-mangling-version=legacy
//@ [verbose-legacy] compile-flags: -Csymbol-mangling-version=legacy -Zverbose-internals
//@ [v0] compile-flags: -Csymbol-mangling-version=v0
//@ normalize-stderr-test: "h[[:xdigit:]]{16}" -> "h[HASH]"
//@ [v0] normalize-stderr-test: "\[[[:xdigit:]]{16}\]" -> "[HASH]"
//@ normalize-stderr: "h[[:xdigit:]]{16}" -> "h[HASH]"
//@ [v0] normalize-stderr: "\[[[:xdigit:]]{16}\]" -> "[HASH]"

#![feature(never_type)]
#![feature(rustc_attrs)]
2 changes: 1 addition & 1 deletion tests/ui/test-attrs/terse.rs
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
//@ run-flags: --test-threads=1 --quiet
//@ check-run-results
//@ exec-env:RUST_BACKTRACE=0
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ ignore-emscripten no threads support
//@ needs-unwind

2 changes: 1 addition & 1 deletion tests/ui/test-attrs/test-filter-multiple.rs
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
//@ compile-flags: --test
//@ run-flags: --test-threads=1 test1 test2
//@ check-run-results
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ needs-threads

#[test]
2 changes: 1 addition & 1 deletion tests/ui/test-attrs/test-panic-abort-nocapture.rs
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
//@ run-fail
//@ check-run-results
//@ exec-env:RUST_BACKTRACE=0
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"

//@ ignore-android #120567
//@ ignore-wasm no panic or subprocess support
2 changes: 1 addition & 1 deletion tests/ui/test-attrs/test-panic-abort.rs
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
//@ run-fail
//@ check-run-results
//@ exec-env:RUST_BACKTRACE=0
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"

//@ ignore-android #120567
//@ ignore-wasm no panic or subprocess support
2 changes: 1 addition & 1 deletion tests/ui/test-attrs/test-passed.rs
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
//@ run-flags: --test-threads=1
//@ run-pass
//@ check-run-results
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"

// Tests the output of the test harness with only passed tests.

2 changes: 1 addition & 1 deletion tests/ui/test-attrs/test-thread-capture.rs
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
//@ run-flags: --test-threads=1
//@ check-run-results
//@ exec-env:RUST_BACKTRACE=0
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ ignore-emscripten no threads support
//@ needs-unwind

2 changes: 1 addition & 1 deletion tests/ui/test-attrs/test-thread-nocapture.rs
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
//@ run-flags: --test-threads=1 --nocapture
//@ check-run-results
//@ exec-env:RUST_BACKTRACE=0
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ ignore-emscripten no threads support
//@ needs-unwind

2 changes: 1 addition & 1 deletion tests/ui/test-attrs/test-type.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//@ compile-flags: --test -Zpanic-abort-tests
//@ run-flags: --test-threads=1
//@ check-run-results
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ needs-threads
//@ run-pass

4 changes: 2 additions & 2 deletions tests/ui/test-attrs/tests-listing-format-json.rs
Original file line number Diff line number Diff line change
@@ -4,8 +4,8 @@
//@ run-pass
//@ check-run-results
//@ only-nightly
//@ normalize-stdout-test: "fake-test-src-base/test-attrs/" -> "$$DIR/"
//@ normalize-stdout-test: "fake-test-src-base\\test-attrs\\" -> "$$DIR/"
//@ normalize-stdout: "fake-test-src-base/test-attrs/" -> "$$DIR/"
//@ normalize-stdout: "fake-test-src-base\\test-attrs\\" -> "$$DIR/"

// Checks the listing of tests with --format json.

6 changes: 3 additions & 3 deletions tests/ui/track-diagnostics/track.rs
Original file line number Diff line number Diff line change
@@ -5,13 +5,13 @@

// 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: "note: rustc .+ running on .+" -> "note: rustc $$VERSION running on $$TARGET"
//@ normalize-stderr: ".rs:\d+:\d+" -> ".rs:LL:CC"
//@ normalize-stderr: "note: rustc .+ running on .+" -> "note: rustc $$VERSION running on $$TARGET"

// The test becomes too flaky if we care about exact args. If `-Z ui-testing`
// from compiletest and `-Z track-diagnostics` from `// compile-flags` at the
// top of this file are present, then assume all args are present.
//@ normalize-stderr-test: "note: compiler flags: .*-Z ui-testing.*-Z track-diagnostics" -> "note: compiler flags: ... -Z ui-testing ... -Z track-diagnostics"
//@ normalize-stderr: "note: compiler flags: .*-Z ui-testing.*-Z track-diagnostics" -> "note: compiler flags: ... -Z ui-testing ... -Z track-diagnostics"

fn main() {
break rust
2 changes: 1 addition & 1 deletion tests/ui/track-diagnostics/track2.rs
Original file line number Diff line number Diff line change
@@ -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: ".rs:\d+:\d+" -> ".rs:LL:CC"

fn main() {
let _moved @ _from = String::from("foo");
2 changes: 1 addition & 1 deletion tests/ui/track-diagnostics/track3.rs
Original file line number Diff line number Diff line change
@@ -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: ".rs:\d+:\d+" -> ".rs:LL:CC"

fn main() {
let _unimported = Blah { field: u8 };
2 changes: 1 addition & 1 deletion tests/ui/track-diagnostics/track4.rs
Original file line number Diff line number Diff line change
@@ -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: ".rs:\d+:\d+" -> ".rs:LL:CC"

pub onion {
Owo(u8),
2 changes: 1 addition & 1 deletion tests/ui/track-diagnostics/track5.rs
Original file line number Diff line number Diff line change
@@ -3,6 +3,6 @@

// 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: ".rs:\d+:\d+" -> ".rs:LL:CC"

}
2 changes: 1 addition & 1 deletion tests/ui/track-diagnostics/track6.rs
Original file line number Diff line number Diff line change
@@ -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: ".rs:\d+:\d+" -> ".rs:LL:CC"


pub trait Foo {
2 changes: 1 addition & 1 deletion tests/ui/traits/on_unimplemented_long_types.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//@ compile-flags: --diagnostic-width=60 -Z write-long-types-to-disk=yes
//@ normalize-stderr-test: "long-type-\d+" -> "long-type-hash"
//@ normalize-stderr: "long-type-\d+" -> "long-type-hash"

pub fn foo() -> impl std::fmt::Display {
//~^ ERROR doesn't implement `std::fmt::Display`
Original file line number Diff line number Diff line change
@@ -2,10 +2,10 @@
//@[next] compile-flags: -Znext-solver
//@[next] failure-status: 101
//@[next] known-bug: unknown
//@[next] normalize-stderr-test: "note: .*\n\n" -> ""
//@[next] normalize-stderr-test: "thread 'rustc' panicked.*\n.*\n" -> ""
//@[next] normalize-stderr-test: "(error: internal compiler error: [^:]+):\d+:\d+: " -> "$1:LL:CC: "
//@[next] normalize-stderr-test: "delayed at .*" -> ""
//@[next] normalize-stderr: "note: .*\n\n" -> ""
//@[next] normalize-stderr: "thread 'rustc' panicked.*\n.*\n" -> ""
//@[next] normalize-stderr: "(error: internal compiler error: [^:]+):\d+:\d+: " -> "$1:LL:CC: "
//@[next] normalize-stderr: "delayed at .*" -> ""
//@[next] rustc-env:RUST_BACKTRACE=0
//@ check-pass

2 changes: 1 addition & 1 deletion tests/ui/transmute/transmute-different-sizes.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ normalize-stderr-test: "\d+ bits" -> "N bits"
//@ normalize-stderr: "\d+ bits" -> "N bits"

// Tests that `transmute` cannot be called on types of different size.

2 changes: 1 addition & 1 deletion tests/ui/transmute/transmute-fat-pointers.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ normalize-stderr-test: "\d+ bits" -> "N bits"
//@ normalize-stderr: "\d+ bits" -> "N bits"

// Tests that are conservative around thin/fat pointer mismatches.

2 changes: 1 addition & 1 deletion tests/ui/transmute/transmute-impl.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ normalize-stderr-test: "\d+ bits" -> "N bits"
//@ normalize-stderr: "\d+ bits" -> "N bits"

// Tests that are conservative around thin/fat pointer mismatches.

4 changes: 2 additions & 2 deletions tests/ui/treat-err-as-bug/err.rs
Original file line number Diff line number Diff line change
@@ -2,8 +2,8 @@
//@ failure-status: 101
//@ error-pattern: aborting due to `-Z treat-err-as-bug=1`
//@ error-pattern: [eval_static_initializer] evaluating initializer of static `C`
//@ normalize-stderr-test: "note: .*\n\n" -> ""
//@ normalize-stderr-test: "thread 'rustc' panicked.*:\n.*\n" -> ""
//@ normalize-stderr: "note: .*\n\n" -> ""
//@ normalize-stderr: "thread 'rustc' panicked.*:\n.*\n" -> ""
//@ rustc-env:RUST_BACKTRACE=0

#![crate_type = "rlib"]
4 changes: 2 additions & 2 deletions tests/ui/treat-err-as-bug/span_delayed_bug.rs
Original file line number Diff line number Diff line change
@@ -2,8 +2,8 @@
//@ failure-status: 101
//@ error-pattern: aborting due to `-Z treat-err-as-bug=1`
//@ error-pattern: [trigger_delayed_bug] triggering a delayed bug for testing incremental
//@ normalize-stderr-test: "note: .*\n\n" -> ""
//@ normalize-stderr-test: "thread 'rustc' panicked.*:\n.*\n" -> ""
//@ normalize-stderr: "note: .*\n\n" -> ""
//@ normalize-stderr: "thread 'rustc' panicked.*:\n.*\n" -> ""
//@ rustc-env:RUST_BACKTRACE=0

#![feature(rustc_attrs)]
2 changes: 1 addition & 1 deletion tests/ui/type/pattern_types/range_patterns.rs
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
#![feature(pattern_type_macro)]
#![allow(incomplete_features)]

//@ normalize-stderr-test: "pref: Align\([1-8] bytes\)" -> "pref: $$SOME_ALIGN"
//@ normalize-stderr: "pref: Align\([1-8] bytes\)" -> "pref: $$SOME_ALIGN"

use std::pat::pattern_type;

4 changes: 2 additions & 2 deletions tests/ui/unknown-llvm-arg.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//@ compile-flags: -Cllvm-args=-not-a-real-llvm-arg
//@ normalize-stderr-test: "--help" -> "-help"
//@ normalize-stderr-test: "\n(\n|.)*" -> ""
//@ normalize-stderr: "--help" -> "-help"
//@ normalize-stderr: "\n(\n|.)*" -> ""

// I'm seeing "--help" locally, but "-help" in CI, so I'm normalizing it to just "-help".

2 changes: 1 addition & 1 deletion tests/ui/unpretty/avoid-crash.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ normalize-stderr-test: "error `.*`" -> "$$ERROR_MESSAGE"
//@ normalize-stderr: "error `.*`" -> "$$ERROR_MESSAGE"
//@ compile-flags: -o. -Zunpretty=ast-tree

fn main() {}
2 changes: 1 addition & 1 deletion tests/ui/unpretty/staged-api-invalid-path-108697.rs
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
// ICE: tcx.resolutions(()) is not supported for local crate -Zunpretty=mir
// on invalid module path with staged_api
//@ compile-flags: -Zunpretty=mir
//@ normalize-stderr-test: "The system cannot find the file specified." -> "No such file or directory"
//@ normalize-stderr: "The system cannot find the file specified." -> "No such file or directory"
#![feature(staged_api)]
#[path = "lol"]
mod foo;