Rollup merge of #134759 - Zalathar:normalize, r=jieyouxu
compiletest: Remove the `-test` suffix from normalize directives This suffix was an artifact of using the same condition-checking engine as the `ignore-*` and `only-*` directives, but in practice we have only 2 tests that legitimately use a condition, and both of them only care about 32-bit vs 64-bit. This PR detaches `normalize-*` directives from the condition checker, and replaces it with a much simpler system of four explicit `NormalizeKind` values. It then takes advantage of that simplicity to get rid of the `-test` suffix. --- Addresses one of the points of #126372. The new name-checking code is a bit quaint, but I think it's a definite improvement over the status quo. --- The corresponding dev-guide update is https://github.com/rust-lang/rustc-dev-guide/pull/2172. r? jieyouxu
This commit is contained in:
commit
bc3e8917e3
246 changed files with 508 additions and 485 deletions
|
@ -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",
|
||||
|
|
|
@ -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(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(rule) = config.parse_custom_normalization(ln, "normalize-stderr") {
|
||||
self.normalize_stderr.push(rule);
|
||||
}
|
||||
|
||||
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
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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`.
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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))]
|
||||
|
|
|
@ -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))]
|
||||
|
|
|
@ -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,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))]
|
||||
|
|
|
@ -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!{}]
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
|
|
@ -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`.
|
||||
|
|
|
@ -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
|
||||
/// ```
|
||||
|
|
|
@ -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\
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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))))]
|
||||
|
|
|
@ -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))))]
|
||||
|
|
|
@ -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)]
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
/// ```
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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)]
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
/// ```
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
//! ```
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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!");
|
||||
|
|
|
@ -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))))]
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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,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,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)]
|
||||
|
|
|
@ -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)]
|
||||
|
|
|
@ -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)]
|
||||
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
/// ```
|
||||
|
|
|
@ -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
|
||||
|
||||
/// ```
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)]
|
||||
|
||||
|
|
|
@ -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!()`].
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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,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
|
||||
/// ```
|
||||
|
|
|
@ -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
|
||||
/// ```
|
||||
|
|
|
@ -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
|
||||
/// ```
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"]
|
||||
|
|
|
@ -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)]
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
|
|
@ -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)]
|
||||
|
|
|
@ -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"]
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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))]
|
||||
|
|
|
@ -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))]
|
||||
|
|
|
@ -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,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))]
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
//@ normalize-stderr-test: "DefId\(.+?\)" -> "DefId(..)"
|
||||
//@ normalize-stderr: "DefId\(.+?\)" -> "DefId(..)"
|
||||
|
||||
#![feature(rustc_attrs)]
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
//@ normalize-stderr-test: "DefId\(.+?\)" -> "DefId(..)"
|
||||
//@ normalize-stderr: "DefId\(.+?\)" -> "DefId(..)"
|
||||
#![feature(rustc_attrs)]
|
||||
|
||||
fn bar() {
|
||||
|
|
|
@ -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,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");
|
||||
|
|
|
@ -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,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]
|
||||
|
|
|
@ -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" -> ""
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)]
|
||||
|
|
|
@ -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)
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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)]
|
||||
|
||||
|
|
|
@ -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)]
|
||||
|
||||
|
|
|
@ -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)]
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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)]
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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)]
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue