compiletest: Require //~ annotations even if error-pattern is specified

This commit is contained in:
Vadim Petrochenkov 2025-03-29 02:41:32 +03:00
parent b6d74b5e15
commit 4d64990690
315 changed files with 656 additions and 530 deletions

View file

@ -335,6 +335,9 @@ But for strict testing, try to use the `ERROR` annotation as much as possible,
including `//~?` annotations for diagnostics without span.
For compile time diagnostics `error-pattern` should very rarely be necessary.
Per-line annotations (`//~`) are still checked in tests using `error-pattern`,
to opt out of these checks in exceptional cases use `//@ compile-flags: --error-format=human`.
### Error levels
The error levels that you can have are:

View file

@ -169,16 +169,9 @@ impl TestCx<'_> {
self.props.error_patterns
);
let check_patterns = should_run == WillExecute::No
&& (!self.props.error_patterns.is_empty()
|| !self.props.regex_error_patterns.is_empty());
if !explicit && self.config.compare_mode.is_none() {
let check_annotations = !check_patterns || !expected_errors.is_empty();
if check_annotations {
// "//~ERROR comments"
self.check_expected_errors(expected_errors, &proc_res);
}
} else if explicit && !expected_errors.is_empty() {
let msg = format!(
"line {}: cannot combine `--error-format` with {} annotations; use `error-pattern` instead",
@ -188,7 +181,10 @@ impl TestCx<'_> {
self.fatal(&msg);
}
let output_to_check = self.get_output(&proc_res);
if check_patterns {
if should_run == WillExecute::No
&& (!self.props.error_patterns.is_empty()
|| !self.props.regex_error_patterns.is_empty())
{
// "// error-pattern" comments
self.check_all_error_patterns(&output_to_check, &proc_res, pm);
}

View file

@ -1,6 +1,7 @@
// test the behavior of the --no-run flag without the --test flag
//@ compile-flags:-Z unstable-options --no-run --test-args=--test-threads=1
//@ error-pattern: the `--test` flag must be passed
pub fn f() {}
//~? ERROR the `--test` flag must be passed to enable `--no-run`

View file

@ -1,3 +1,4 @@
//@ compile-flags:--theme {{src-base}}/invalid-theme-name.rs
//@ error-pattern: invalid argument
//@ error-pattern: must have a .css extension
//~? ERROR invalid argument: "$DIR/invalid-theme-name.rs"

View file

@ -1,3 +1,4 @@
//@ check-pass
//@ compile-flags: --passes list
//@ error-pattern: the `passes` flag no longer functions
//~? WARN the `passes` flag no longer functions

View file

@ -1,6 +1,7 @@
//@ error-pattern: no documentation found
//@ normalize-stderr: "nightly|beta|1\.[0-9][0-9]\.[0-9]" -> "$$CHANNEL"
#![deny(rustdoc::missing_crate_level_docs)]
//^~ NOTE defined here
pub fn foo() {}
//~? ERROR no documentation found for this crate's top-level module

View file

@ -3,7 +3,7 @@ error: no documentation found for this crate's top-level module
= help: The following guide may be of use:
https://doc.rust-lang.org/$CHANNEL/rustdoc/how-to-write-documentation.html
note: the lint level is defined here
--> $DIR/no-crate-level-doc-lint.rs:3:9
--> $DIR/no-crate-level-doc-lint.rs:2:9
|
LL | #![deny(rustdoc::missing_crate_level_docs)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View file

@ -8,4 +8,4 @@
struct A;
struct B;
pub const S: A = B;
pub const S: A = B; //~ ERROR mismatched types

View file

@ -1,6 +1,6 @@
// 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
//@ compile-flags: --emit link --error-format=human
//@ normalize-stderr: ".*crate .* required.*\n\n" -> ""
//@ normalize-stderr: "aborting due to [0-9]+" -> "aborting due to NUMBER"

View file

@ -23,3 +23,5 @@
#[lang = "sized"]
trait Sized {}
//~? ERROR the `-Zfixed-x18` flag is not supported on the `

View file

@ -1,5 +1,4 @@
//@ compile-flags: --target aarch64-unknown-none -Zsanitizer=shadow-call-stack
//@ error-pattern: shadow-call-stack sanitizer is not supported for this target
//@ dont-check-compiler-stderr
//@ needs-llvm-components: aarch64
@ -13,3 +12,5 @@ trait Sized {}
#[no_mangle]
pub fn foo() {}
//~? ERROR shadow-call-stack sanitizer is not supported for this target

View file

@ -1,6 +1,5 @@
//@ aux-build:system-allocator.rs
//@ no-prefer-dynamic
//@ error-pattern: the `#[global_allocator]` in
extern crate system_allocator;
@ -10,3 +9,5 @@ use std::alloc::System;
static A: System = System;
fn main() {}
//~? ERROR the `#[global_allocator]` in this crate conflicts with global allocator in: system_allocator

View file

@ -1,10 +1,10 @@
//@ aux-build:system-allocator.rs
//@ aux-build:system-allocator2.rs
//@ no-prefer-dynamic
//@ error-pattern: the `#[global_allocator]` in
extern crate system_allocator;
extern crate system_allocator2;
fn main() {}
//~? ERROR the `#[global_allocator]` in system_allocator conflicts with global allocator in: system_allocator2

View file

@ -3,7 +3,6 @@
//@ compile-flags: --crate-type=cdylib --target=amdgcn-amd-amdhsa
//@ needs-llvm-components: amdgpu
//@ needs-rust-lld
//@[nocpu] error-pattern: target requires explicitly specifying a cpu
//@[nocpu] build-fail
//@[cpu] compile-flags: -Ctarget-cpu=gfx900
//@[cpu] build-pass
@ -15,3 +14,5 @@
trait Sized {}
pub fn foo() {}
//[nocpu]~? ERROR target requires explicitly specifying a cpu with `-C target-cpu`

View file

@ -1,5 +1,5 @@
//@ error-pattern: aborting due to 1 previous error
fn main() {
2 + +2;
2 + +2; //~ ERROR leading `+` is not supported
}

View file

@ -3,7 +3,6 @@
//!
//! See <https://doc.rust-lang.org/reference/attributes.html>.
//@ error-pattern: expected item
#![attr = "val"]
#[attr = "val"] // Unterminated
//~^ ERROR expected item after attributes

View file

@ -1,5 +1,5 @@
error: expected item after attributes
--> $DIR/attr-bad-crate-attr.rs:9:1
--> $DIR/attr-bad-crate-attr.rs:7:1
|
LL | #[attr = "val"] // Unterminated
| ^^^^^^^^^^^^^^^

View file

@ -1,4 +1,7 @@
// Show diagnostics for invalid tokens
//@ compile-flags: -Zcrate-attr=`%~@$#
//@ error-pattern:unknown start of token
fn main() {}
//~? ERROR unknown start of token: `
//~? ERROR expected identifier, found `%`

View file

@ -1,3 +1,5 @@
//@ compile-flags: '-Zcrate-attr=feature(yeet_expr)]fn main(){}#[inline'
//@ error-pattern:unexpected closing delimiter
fn foo() {}
//~? ERROR unexpected closing delimiter: `]`

View file

@ -1,4 +1,5 @@
//@ compile-flags: -Zcrate-attr=#![feature(foo)]
//@ error-pattern:expected identifier
fn main() {}
//~? ERROR expected identifier, found `#`

View file

@ -1,3 +1,5 @@
//@ compile-flags: -Zcrate-attr=feature(foo),feature(bar)
//@ error-pattern:invalid crate attr
fn main() {}
//~? ERROR invalid crate attribute

View file

@ -1,4 +1,6 @@
// Show diagnostics for unbalanced parens.
//@ compile-flags: -Zcrate-attr=(
//@ error-pattern:unclosed delimiter
fn main() {}
//~? ERROR this file contains an unclosed delimiter

View file

@ -1,3 +1,2 @@
//@ error-pattern:no implementation for `String ^ String`
fn main() { let x = "a".to_string() ^ "b".to_string(); }
//~^ ERROR no implementation for `String ^ String`

View file

@ -1,5 +1,5 @@
error[E0369]: no implementation for `String ^ String`
--> $DIR/binop-bitxor-str.rs:3:37
--> $DIR/binop-bitxor-str.rs:1:37
|
LL | fn main() { let x = "a".to_string() ^ "b".to_string(); }
| --------------- ^ --------------- String

View file

@ -1,3 +1 @@
//@ error-pattern:cannot multiply `bool` by `bool`
fn main() { let x = true * false; }
fn main() { let x = true * false; } //~ ERROR cannot multiply `bool` by `bool`

View file

@ -1,5 +1,5 @@
error[E0369]: cannot multiply `bool` by `bool`
--> $DIR/binop-mul-bool.rs:3:26
--> $DIR/binop-mul-bool.rs:1:26
|
LL | fn main() { let x = true * false; }
| ---- ^ ----- bool

View file

@ -1,12 +1,18 @@
// Regression test for the ICE described in issue #86053.
//@ error-pattern:unexpected `self` parameter in function
//@ error-pattern:`...` must be the last argument of a C-variadic function
//@ error-pattern:cannot find type `F` in this scope
#![feature(c_variadic)]
#![crate_type="lib"]
fn ordering4 < 'a , 'b > ( a : , self , self , self ,
//~^ ERROR expected type, found `,`
//~| ERROR unexpected `self` parameter in function
//~| ERROR unexpected `self` parameter in function
//~| ERROR unexpected `self` parameter in function
self , ... , self , self , ... ) where F : FnOnce ( & 'a & 'b usize ) {
//~^ ERROR unexpected `self` parameter in function
//~| ERROR unexpected `self` parameter in function
//~| ERROR unexpected `self` parameter in function
//~| ERROR `...` must be the last argument of a C-variadic function
//~| ERROR only foreign, `unsafe extern "C"`, or `unsafe extern "C-unwind"` functions may have a C-variadic arg
//~| ERROR cannot find type `F` in this scope
}

View file

@ -1,23 +1,23 @@
error: expected type, found `,`
--> $DIR/issue-86053-1.rs:10:47
--> $DIR/issue-86053-1.rs:6:47
|
LL | fn ordering4 < 'a , 'b > ( a : , self , self , self ,
| ^ expected type
error: unexpected `self` parameter in function
--> $DIR/issue-86053-1.rs:10:51
--> $DIR/issue-86053-1.rs:6:51
|
LL | fn ordering4 < 'a , 'b > ( a : , self , self , self ,
| ^^^^ must be the first parameter of an associated function
error: unexpected `self` parameter in function
--> $DIR/issue-86053-1.rs:10:58
--> $DIR/issue-86053-1.rs:6:58
|
LL | fn ordering4 < 'a , 'b > ( a : , self , self , self ,
| ^^^^ must be the first parameter of an associated function
error: unexpected `self` parameter in function
--> $DIR/issue-86053-1.rs:10:67
--> $DIR/issue-86053-1.rs:6:67
|
LL | fn ordering4 < 'a , 'b > ( a : , self , self , self ,
| ^^^^ must be the first parameter of an associated function

View file

@ -1,6 +1,4 @@
//@ error-pattern: can't capture dynamic environment in a fn item
fn main() {
let bar: isize = 5;
fn foo() -> isize { return bar; }
fn foo() -> isize { return bar; } //~ ERROR can't capture dynamic environment in a fn item
}

View file

@ -1,5 +1,5 @@
error[E0434]: can't capture dynamic environment in a fn item
--> $DIR/capture1.rs:5:32
--> $DIR/capture1.rs:3:32
|
LL | fn foo() -> isize { return bar; }
| ^^^

View file

@ -1,2 +1 @@
//@ error-pattern: non-primitive cast: `()` as `u32`
fn main() { let u = (assert!(true) as u32); }
fn main() { let u = (assert!(true) as u32); } //~ ERROR non-primitive cast: `()` as `u32`

View file

@ -1,5 +1,5 @@
error[E0605]: non-primitive cast: `()` as `u32`
--> $DIR/cast-from-nil.rs:2:21
--> $DIR/cast-from-nil.rs:1:21
|
LL | fn main() { let u = (assert!(true) as u32); }
| ^^^^^^^^^^^^^^^^^^^^^^ an `as` expression can only be used to convert between primitive types or to coerce to a specific trait object

View file

@ -1,2 +1 @@
//@ error-pattern: non-primitive cast: `u32` as `()`
fn main() { let u = 0u32 as (); }
fn main() { let u = 0u32 as (); } //~ ERROR non-primitive cast: `u32` as `()`

View file

@ -1,5 +1,5 @@
error[E0605]: non-primitive cast: `u32` as `()`
--> $DIR/cast-to-nil.rs:2:21
--> $DIR/cast-to-nil.rs:1:21
|
LL | fn main() { let u = 0u32 as (); }
| ^^^^^^^^^^ an `as` expression can only be used to convert between primitive types or to coerce to a specific trait object

View file

@ -1,7 +1,6 @@
// Error, the linked empty library is `no_std` and doesn't provide a panic handler.
//@ dont-check-compiler-stderr
//@ error-pattern: `#[panic_handler]` function required, but not found
//@ aux-build: cfg_false_lib_no_std_before.rs
#![no_std]
@ -9,3 +8,6 @@
extern crate cfg_false_lib_no_std_before as _;
fn main() {}
//~? ERROR `#[panic_handler]` function required, but not found
//~? ERROR unwinding panics are not supported without std

View file

@ -3,7 +3,6 @@
//@ build-fail
//@ 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: "`, `[A-Za-z0-9-:]*`" -> "`, `normalized data layout`"
//@ normalize-stderr: "layout, `[A-Za-z0-9-:]*`" -> "layout, `normalized data layout`"
@ -12,3 +11,5 @@
#[lang = "sized"]
trait Sized {}
//~? ERROR differs from LLVM target's

View file

@ -1,3 +1,5 @@
//@ compile-flags: --cfg a::b
//@ error-pattern: invalid `--cfg` argument: `a::b` (argument key must be an identifier)
fn main() {}
//~? ERROR invalid `--cfg` argument: `a::b` (argument key must be an identifier)

View file

@ -1,3 +1,5 @@
//@ compile-flags: --cfg a=10
//@ error-pattern: invalid `--cfg` argument: `a=10` (argument value must be a string)
fn main() {}
//~? ERROR invalid `--cfg` argument: `a=10` (argument value must be a string)

View file

@ -1,8 +1,7 @@
//@ error-pattern: `main` function not found
//@ compile-flags: --cfg foo --check-cfg=cfg(foo,bar)
// main is conditionally compiled, but the conditional compilation
// is conditional too!
#[cfg_attr(foo, cfg(bar))]
fn main() { }
fn main() { } //~ ERROR `main` function not found in crate `cfg_attr_cfg_2`

View file

@ -1,5 +1,5 @@
error[E0601]: `main` function not found in crate `cfg_attr_cfg_2`
--> $DIR/cfg-attr-cfg-2.rs:8:14
--> $DIR/cfg-attr-cfg-2.rs:7:14
|
LL | fn main() { }
| ^ consider adding a `main` function to `$DIR/cfg-attr-cfg-2.rs`

View file

@ -1,3 +1 @@
//@ error-pattern: `main` function not found
#![cfg(FALSE)]
#![cfg(FALSE)] //~ ERROR `main` function not found in crate `cfg_in_crate_1`

View file

@ -1,5 +1,5 @@
error[E0601]: `main` function not found in crate `cfg_in_crate_1`
--> $DIR/cfg-in-crate-1.rs:3:15
--> $DIR/cfg-in-crate-1.rs:1:15
|
LL | #![cfg(FALSE)]
| ^ consider adding a `main` function to `$DIR/cfg-in-crate-1.rs`

View file

@ -1,5 +1,3 @@
//@ error-pattern: evaluation of constant value failed
fn main() {
use std::ptr;
@ -8,6 +6,9 @@ fn main() {
const PAST_END_PTR: *const u32 = unsafe { DATA.as_ptr().add(1) };
const _READ: u32 = unsafe { ptr::read(PAST_END_PTR) };
//~^ ERROR evaluation of constant value failed
const _CONST_READ: u32 = unsafe { PAST_END_PTR.read() };
//~^ ERROR evaluation of constant value failed
const _MUT_READ: u32 = unsafe { (PAST_END_PTR as *mut u32).read() };
//~^ ERROR evaluation of constant value failed
}

View file

@ -1,5 +1,5 @@
error[E0080]: evaluation of constant value failed
--> $DIR/out_of_bounds_read.rs:10:33
--> $DIR/out_of_bounds_read.rs:8:33
|
LL | const _READ: u32 = unsafe { ptr::read(PAST_END_PTR) };
| ^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: expected a pointer to 4 bytes of memory, but got ALLOC0+0x4 which is at or beyond the end of the allocation of size 4 bytes
@ -8,7 +8,7 @@ note: inside `std::ptr::read::<u32>`
--> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
error[E0080]: evaluation of constant value failed
--> $DIR/out_of_bounds_read.rs:11:39
--> $DIR/out_of_bounds_read.rs:10:39
|
LL | const _CONST_READ: u32 = unsafe { PAST_END_PTR.read() };
| ^^^^^^^^^^^^^^^^^^^ memory access failed: expected a pointer to 4 bytes of memory, but got ALLOC0+0x4 which is at or beyond the end of the allocation of size 4 bytes

View file

@ -1,7 +1,6 @@
//@ error-pattern: cycle detected
struct Foo {
bytes: [u8; std::mem::size_of::<Foo>()]
//~^ ERROR cycle detected when evaluating type-level constant
}
fn main() {}

View file

@ -1,11 +1,11 @@
error[E0391]: cycle detected when evaluating type-level constant
--> $DIR/const-size_of-cycle.rs:4:17
--> $DIR/const-size_of-cycle.rs:2:17
|
LL | bytes: [u8; std::mem::size_of::<Foo>()]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: ...which requires const-evaluating + checking `Foo::bytes::{constant#0}`...
--> $DIR/const-size_of-cycle.rs:4:17
--> $DIR/const-size_of-cycle.rs:2:17
|
LL | bytes: [u8; std::mem::size_of::<Foo>()]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -14,7 +14,7 @@ LL | bytes: [u8; std::mem::size_of::<Foo>()]
= note: ...which requires normalizing `[u8; std::mem::size_of::<Foo>()]`...
= note: ...which again requires evaluating type-level constant, completing the cycle
note: cycle used when checking that `Foo` is well-formed
--> $DIR/const-size_of-cycle.rs:3:1
--> $DIR/const-size_of-cycle.rs:1:1
|
LL | struct Foo {
| ^^^^^^^^^^

View file

@ -14,4 +14,6 @@ static TEST_OK: () = {
// The actual error is tested by the error-pattern above.
static TEST_BAD: () = {
let _v: Vec<i32> = Vec::new();
};
}; //~ ERROR could not evaluate static initializer
//~? WARN skipping const checks

View file

@ -3,7 +3,6 @@
//! ICE.
//@ compile-flags: --crate-type=lib -Ztiny-const-eval-limit
//@ error-pattern: constant evaluation is taking a long time
static ROOK_ATTACKS_TABLE: () = {
0_u64.count_ones();
@ -23,3 +22,5 @@ static ROOK_ATTACKS_TABLE: () = {
0_u64.count_ones();
0_u64.count_ones();
};
//~? ERROR constant evaluation is taking a long time

View file

@ -4,7 +4,7 @@ error: constant evaluation is taking a long time
= note: this lint makes sure the compiler doesn't get stuck due to infinite loops in const eval.
If your compilation actually takes a long time, you can safely allow the lint.
help: the constant being evaluated
--> $DIR/timeout.rs:8:1
--> $DIR/timeout.rs:7:1
|
LL | static ROOK_ATTACKS_TABLE: () = {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View file

@ -1,4 +1,5 @@
//@ compile-flags: --crate-type dynlib
//@ error-pattern: unknown crate type: `dynlib`, expected one of: `lib`, `rlib`, `staticlib`, `dylib`, `cdylib`, `bin`, `proc-macro`
fn main() {}
//~? ERROR unknown crate type: `dynlib`

View file

@ -1,9 +1,9 @@
//~ ERROR values of the type `[u8; usize::MAX]` are too big for the target architecture
// Make sure the compiler does not ICE when trying to generate the debuginfo name of a type that
// causes a layout error. See https://github.com/rust-lang/rust/issues/94961.
//@ compile-flags:-C debuginfo=2
//@ build-fail
//@ error-pattern: too big for the target architecture
#![crate_type = "rlib"]

View file

@ -1,3 +1,4 @@
//~ ERROR values of the type `[u8; usize::MAX]` are too big for the target architecture
// Make sure the compiler does not ICE when trying to generate the debuginfo name of a type that
// causes a layout error.
// This version of the test already ICE'd before the commit that introduce the ICE described in
@ -5,7 +6,6 @@
//@ compile-flags:-C debuginfo=2
//@ build-fail
//@ error-pattern: too big for the target architecture
#![crate_type = "rlib"]

View file

@ -4,7 +4,6 @@
//@ revisions: zero one two three four five six
//@[zero] compile-flags: -Zdwarf-version=0
//@[zero] error-pattern: requested DWARF version 0 is not supported
//@[one] compile-flags: -Zdwarf-version=1
//@[one] error-pattern: requested DWARF version 1 is not supported
@ -22,7 +21,6 @@
//@[five] check-pass
//@[six] compile-flags: -Zdwarf-version=6
//@[six] error-pattern: requested DWARF version 6 is not supported
//@ compile-flags: -g --target x86_64-unknown-linux-gnu --crate-type cdylib
//@ needs-llvm-components: x86
@ -36,3 +34,7 @@
pub trait Sized {}
pub fn foo() {}
//[zero]~? ERROR requested DWARF version 0 is not supported
//[one]~? ERROR requested DWARF version 1 is not supported
//[six]~? ERROR requested DWARF version 6 is not supported

View file

@ -1,6 +1,5 @@
//@ revisions: aarch64_gl i686_g i686_gl i686_uwp_g x86_64_g x86_64_gl x86_64_uwp_g
//@ compile-flags: --crate-type cdylib -Csplit-debuginfo=packed
//@ error-pattern: error: `-Csplit-debuginfo=packed` is unstable on this platform
//@[aarch64_gl] compile-flags: --target aarch64-pc-windows-gnullvm
//@[aarch64_gl] needs-llvm-components: aarch64
@ -27,3 +26,5 @@
#![no_core]
#![no_std]
//~? ERROR `-Csplit-debuginfo=packed` is unstable on this platform

View file

@ -1,6 +1,5 @@
//@ revisions: aarch64_gl i686_g i686_gl i686_uwp_g x86_64_g x86_64_gl x86_64_uwp_g
//@ compile-flags: --crate-type cdylib -Csplit-debuginfo=unpacked
//@ error-pattern: error: `-Csplit-debuginfo=unpacked` is unstable on this platform
//@[aarch64_gl] compile-flags: --target aarch64-pc-windows-gnullvm
//@[aarch64_gl] needs-llvm-components: aarch64
@ -27,3 +26,5 @@
#![no_core]
#![no_std]
//~? ERROR `-Csplit-debuginfo=unpacked` is unstable on this platform

View file

@ -1,5 +1,4 @@
//@ aux-build:deprecation-lint.rs
//@ error-pattern: use of deprecated function
#![deny(deprecated)]
@ -9,5 +8,5 @@ extern crate deprecation_lint;
use deprecation_lint::*;
fn main() {
macro_test!();
macro_test!(); //~ ERROR use of deprecated function `deprecation_lint::deprecated`: text
}

View file

@ -1,11 +1,11 @@
error: use of deprecated function `deprecation_lint::deprecated`: text
--> $DIR/deprecation-lint-2.rs:12:5
--> $DIR/deprecation-lint-2.rs:11:5
|
LL | macro_test!();
| ^^^^^^^^^^^^^
|
note: the lint level is defined here
--> $DIR/deprecation-lint-2.rs:4:9
--> $DIR/deprecation-lint-2.rs:3:9
|
LL | #![deny(deprecated)]
| ^^^^^^^^^^

View file

@ -1,5 +1,4 @@
//@ aux-build:deprecation-lint.rs
//@ error-pattern: use of deprecated function
#![deny(deprecated)]
#![allow(warnings)]
@ -11,4 +10,5 @@ use deprecation_lint::*;
fn main() {
macro_test_arg_nested!(deprecated_text);
//~^ ERROR use of deprecated function `deprecation_lint::deprecated_text`: text
}

View file

@ -1,11 +1,11 @@
error: use of deprecated function `deprecation_lint::deprecated_text`: text
--> $DIR/deprecation-lint-3.rs:13:28
--> $DIR/deprecation-lint-3.rs:12:28
|
LL | macro_test_arg_nested!(deprecated_text);
| ^^^^^^^^^^^^^^^
|
note: the lint level is defined here
--> $DIR/deprecation-lint-3.rs:4:9
--> $DIR/deprecation-lint-3.rs:3:9
|
LL | #![deny(deprecated)]
| ^^^^^^^^^^

View file

@ -1,7 +1,5 @@
//@ build-fail
//
//@ error-pattern: symbol `fail` is already defined
#![crate_type="rlib"]
#![allow(warnings)]
@ -20,5 +18,5 @@ impl A for B {
impl A for C {
#[no_mangle]
fn fail(self) {}
fn fail(self) {} //~ ERROR symbol `fail` is already defined
}

View file

@ -1,5 +1,5 @@
error: symbol `fail` is already defined
--> $DIR/dupe-symbols-4.rs:23:5
--> $DIR/dupe-symbols-4.rs:21:5
|
LL | fn fail(self) {}
| ^^^^^^^^^^^^^

View file

@ -1,10 +1,7 @@
//@ build-fail
//@ ignore-wasi wasi does different things with the `main` symbol
//
//@ error-pattern: entry symbol `main` declared multiple times
#![allow(warnings)]
#[no_mangle]
fn main(){}
fn main(){} //~ ERROR entry symbol `main` declared multiple times

View file

@ -1,5 +1,5 @@
error: entry symbol `main` declared multiple times
--> $DIR/dupe-symbols-7.rs:10:1
--> $DIR/dupe-symbols-7.rs:7:1
|
LL | fn main(){}
| ^^^^^^^^^

View file

@ -1,11 +1,10 @@
//@ build-fail
//@ error-pattern: entry symbol `main` declared multiple times
//@ ignore-wasi wasi does different things with the `main` symbol
//
// See #67946.
#![allow(warnings)]
fn main() {
fn main() { //~ ERROR entry symbol `main` declared multiple times
extern "Rust" {
fn main();
}

View file

@ -1,5 +1,5 @@
error: entry symbol `main` declared multiple times
--> $DIR/dupe-symbols-8.rs:8:1
--> $DIR/dupe-symbols-8.rs:7:1
|
LL | fn main() {
| ^^^^^^^^^

View file

@ -1,7 +1,5 @@
//@ error-pattern: `main` function not found
// Since we're not compiling a test runner this function should be elided
// and the build will fail because main doesn't exist
#[test]
fn main() {
}
} //~ ERROR `main` function not found in crate `elided_test`

View file

@ -1,5 +1,5 @@
error[E0601]: `main` function not found in crate `elided_test`
--> $DIR/elided-test.rs:7:2
--> $DIR/elided-test.rs:5:2
|
LL | }
| ^ consider adding a `main` function to `$DIR/elided-test.rs`

View file

@ -1,8 +1,11 @@
//@ compile-flags:-D bogus
//@ check-pass
//@ error-pattern:E0602
//@ error-pattern:requested on the command line with `-D bogus`
//@ error-pattern:`#[warn(unknown_lints)]` on by default
fn main() {}
//~? WARN unknown lint: `bogus`
//~? WARN unknown lint: `bogus`
//~? WARN unknown lint: `bogus`

View file

@ -1,7 +1,7 @@
error[E0423]: expected value, found struct `remapped_dep::SomeStruct`
--> $DIR/remap-path-prefix-reverse.rs:16:13
|
LL | let _ = remapped_dep::SomeStruct; // ~ERROR E0423
LL | let _ = remapped_dep::SomeStruct;
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: use struct literal syntax instead: `remapped_dep::SomeStruct {}`
|
::: remapped-aux/remapped_dep.rs:4:1

View file

@ -1,7 +1,7 @@
error[E0423]: expected value, found struct `remapped_dep::SomeStruct`
--> $DIR/remap-path-prefix-reverse.rs:16:13
|
LL | let _ = remapped_dep::SomeStruct; // ~ERROR E0423
LL | let _ = remapped_dep::SomeStruct;
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: use struct literal syntax instead: `remapped_dep::SomeStruct {}`
|
::: remapped-aux/remapped_dep.rs:4:1

View file

@ -13,5 +13,6 @@ extern crate remapped_dep;
fn main() {
// The actual error is irrelevant. The important part it that is should show
// a snippet of the dependency's source.
let _ = remapped_dep::SomeStruct; // ~ERROR E0423
let _ = remapped_dep::SomeStruct;
//~^ ERROR expected value, found struct `remapped_dep::SomeStruct`
}

View file

@ -3,7 +3,6 @@
//@ [with-remap]compile-flags: --remap-path-prefix={{rust-src-base}}=remapped
//@ [with-remap]compile-flags: --remap-path-prefix={{src-base}}=remapped-tests-ui
//@ [without-remap]compile-flags:
//@ error-pattern: E0507
// The $SRC_DIR*.rs:LL:COL normalisation doesn't kick in automatically
// as the remapped revision will not begin with $SRC_DIR_REAL,
@ -18,7 +17,10 @@ struct Worker {
impl Drop for Worker {
fn drop(&mut self) {
self.thread.join().unwrap();
//[without-remap]~^ ERROR cannot move out of `self.thread` which is behind a mutable reference
}
}
pub fn main(){}
//[with-remap]~? ERROR cannot move out of `self.thread` which is behind a mutable reference

View file

@ -1,5 +1,5 @@
error[E0425]: cannot find value `ferris` in this scope
--> remapped/errors/remap-path-prefix.rs:19:5
--> remapped/errors/remap-path-prefix.rs:15:5
|
LL | ferris
| ^^^^^^ not found in this scope

View file

@ -7,14 +7,13 @@
// The remapped paths are not normalized by compiletest.
//@ normalize-stderr: "\\(errors)" -> "/$1"
// The remapped paths aren't recognized by compiletest, so we
// cannot use line-specific patterns.
//@ error-pattern: E0425
fn main() {
// We cannot actually put an ERROR marker here because
// the file name in the error message is not what the
// test framework expects (since the filename gets remapped).
// We still test the expected error in the stderr file.
ferris
ferris //[without-diagnostic-scope]~ ERROR cannot find value `ferris` in this scope
}
//[normal]~? ERROR cannot find value `ferris` in this scope
//[with-diagnostic-scope]~? ERROR cannot find value `ferris` in this scope

View file

@ -1,5 +1,5 @@
error[E0425]: cannot find value `ferris` in this scope
--> remapped/errors/remap-path-prefix.rs:19:5
--> remapped/errors/remap-path-prefix.rs:15:5
|
LL | ferris
| ^^^^^^ not found in this scope

View file

@ -1,5 +1,5 @@
error[E0425]: cannot find value `ferris` in this scope
--> $DIR/remap-path-prefix.rs:19:5
--> $DIR/remap-path-prefix.rs:15:5
|
LL | ferris
| ^^^^^^ not found in this scope

View file

@ -1,4 +1,3 @@
//@ error-pattern:mismatched types
// issue #513
fn f() { }
@ -6,5 +5,5 @@ fn f() { }
fn main() {
// f is not a bool
if f { }
if f { } //~ ERROR mismatched types
}

View file

@ -1,5 +1,5 @@
error[E0308]: mismatched types
--> $DIR/if-typeck.rs:9:8
--> $DIR/if-typeck.rs:8:8
|
LL | if f { }
| ^ expected `bool`, found fn item

View file

@ -1,2 +1,2 @@
//@ error-pattern:cannot find macro
fn main() { iamnotanextensionthatexists!(""); }
//~^ ERROR cannot find macro `iamnotanextensionthatexists` in this scope

View file

@ -1,5 +1,5 @@
error: cannot find macro `iamnotanextensionthatexists` in this scope
--> $DIR/ext-nonexistent.rs:2:13
--> $DIR/ext-nonexistent.rs:1:13
|
LL | fn main() { iamnotanextensionthatexists!(""); }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^

View file

@ -1,6 +1,9 @@
//~ ERROR extern location for std does not exist
//@ compile-flags: --extern std=
//@ error-pattern: extern location for std does not exist
//@ needs-unwind since it affects the error output
//@ ignore-emscripten missing eh_catch_typeinfo lang item
fn main() {}
//~? ERROR `#[panic_handler]` function required, but not found
//~? ERROR unwinding panics are not supported without std

View file

@ -1,5 +1,4 @@
//@ compile-flags: --extern=my-awesome-library=libawesome.rlib
//@ error-pattern: crate name `my-awesome-library` passed to `--extern` is not a valid ASCII identifier
//@ error-pattern: consider replacing the dashes with underscores: `my_awesome_library`
// In a sense, this is a regression test for issue #113035. We no longer suggest
@ -8,3 +7,5 @@
pub use my_awesome_library::*;
fn main() {}
//~? ERROR crate name `my-awesome-library` passed to `--extern` is not a valid ASCII identifier

View file

@ -1,4 +1,5 @@
//@ compile-flags: --extern čɍαţē=libnon_ascii.rlib
//@ error-pattern: crate name `čɍαţē` passed to `--extern` is not a valid ASCII identifier
fn main() {}
//~? ERROR crate name `čɍαţē` passed to `--extern` is not a valid ASCII identifier

View file

@ -1,4 +1,5 @@
//@ compile-flags: --extern=?#1%$
//@ error-pattern: crate name `?#1%$` passed to `--extern` is not a valid ASCII identifier
fn main() {}
//~? ERROR crate name `?#1%$` passed to `--extern` is not a valid ASCII identifier

View file

@ -1,10 +1,12 @@
//@ aux-crate:panic_handler=panic_handler.rs
//@ ignore-cross-compile (needs dylibs and compiletest doesn't have a more specific header)
// compile_flags: -Zunstable-options --crate-type dylib
//@ error-pattern: `#[panic_handler]` function required, but not found
//@ dont-check-compiler-stderr
//@ edition: 2018
#![no_std]
fn foo() {}
fn foo() {} //~ ERROR `main` function not found in crate `no_force_extern`
//~? ERROR `#[panic_handler]` function required, but not found
//~? ERROR unwinding panics are not supported without std

View file

@ -1,5 +1,3 @@
//@ error-pattern:mismatched types
fn f() -> isize { true }
fn f() -> isize { true } //~ ERROR mismatched types
fn main() { }

View file

@ -1,5 +1,5 @@
error[E0308]: mismatched types
--> $DIR/fn-bad-block-type.rs:3:19
--> $DIR/fn-bad-block-type.rs:1:19
|
LL | fn f() -> isize { true }
| ----- ^^^^ expected `isize`, found `bool`

View file

@ -1,11 +1,9 @@
//@ error-pattern:import
mod a {
pub use b::x;
}
mod b {
pub use a::x;
pub use a::x; //~ ERROR unresolved import `a::x`
fn main() { let y = x; }
}

View file

@ -1,5 +1,5 @@
error[E0432]: unresolved import `a::x`
--> $DIR/import-loop-2.rs:8:13
--> $DIR/import-loop-2.rs:6:13
|
LL | pub use a::x;
| ^^^^ no `x` in `a`

View file

@ -1,9 +1,7 @@
//@ error-pattern:import
use y::x;
mod y {
pub use y::x;
pub use y::x; //~ ERROR unresolved import `y::x`
}
fn main() { }

View file

@ -1,5 +1,5 @@
error[E0432]: unresolved import `y::x`
--> $DIR/import-loop.rs:6:13
--> $DIR/import-loop.rs:4:13
|
LL | pub use y::x;
| ^^^^ no `x` in `y`

View file

@ -1,4 +1,3 @@
//@ error-pattern: unresolved
use main::bar;
use main::bar; //~ ERROR unresolved import `main`
fn main() { println!("foo"); }

View file

@ -1,5 +1,5 @@
error[E0432]: unresolved import `main`
--> $DIR/import3.rs:2:5
--> $DIR/import3.rs:1:5
|
LL | use main::bar;
| ^^^^ use of unresolved module or unlinked crate `main`

View file

@ -1,7 +1,4 @@
//@ error-pattern: import
mod a { pub use b::foo; }
mod b { pub use a::foo; }
mod b { pub use a::foo; } //~ ERROR unresolved import `a::foo`
fn main() { println!("loop"); }

View file

@ -1,5 +1,5 @@
error[E0432]: unresolved import `a::foo`
--> $DIR/import4.rs:5:17
--> $DIR/import4.rs:2:17
|
LL | mod b { pub use a::foo; }
| ^^^^^^ no `foo` in `a`

View file

@ -1,8 +1,6 @@
//~ ERROR reached the recursion limit while instantiating `<VirtualWrapper<VirtualWrapper<VirtualWrapper
//@ build-fail
//@ error-pattern: reached the recursion limit while instantiating
//@ error-pattern: reached the recursion limit finding the struct tail
// Regression test for #114484: This used to ICE during monomorphization, because we treated
// `<VirtualWrapper<...> as Pointee>::Metadata` as a rigid projection after reaching the recursion
// limit when finding the struct tail.
@ -73,3 +71,16 @@ fn main() {
let test = SomeData([0; 256]);
test.virtualize();
}
//~? ERROR reached the recursion limit finding the struct tail for `[u8; 256]`
//~? ERROR reached the recursion limit finding the struct tail for `[u8; 256]`
//~? ERROR reached the recursion limit finding the struct tail for `[u8; 256]`
//~? ERROR reached the recursion limit finding the struct tail for `[u8; 256]`
//~? ERROR reached the recursion limit finding the struct tail for `SomeData<256>`
//~? ERROR reached the recursion limit finding the struct tail for `SomeData<256>`
//~? ERROR reached the recursion limit finding the struct tail for `SomeData<256>`
//~? ERROR reached the recursion limit finding the struct tail for `SomeData<256>`
//~? ERROR reached the recursion limit finding the struct tail for `VirtualWrapper<SomeData<256>, 0>`
//~? ERROR reached the recursion limit finding the struct tail for `VirtualWrapper<SomeData<256>, 0>`
//~? ERROR reached the recursion limit finding the struct tail for `VirtualWrapper<SomeData<256>, 0>`
//~? ERROR reached the recursion limit finding the struct tail for `VirtualWrapper<SomeData<256>, 0>`

View file

@ -18,7 +18,7 @@ error: reached the recursion limit finding the struct tail for `[u8; 256]`
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
note: the above error was encountered while instantiating `fn virtualize_my_trait::<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<SomeData<256>, 0>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>>`
--> $DIR/infinite-instantiation-struct-tail-ice-114484.rs:26:18
--> $DIR/infinite-instantiation-struct-tail-ice-114484.rs:24:18
|
LL | unsafe { virtualize_my_trait(L, self) }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -43,7 +43,7 @@ error: reached the recursion limit finding the struct tail for `SomeData<256>`
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
note: the above error was encountered while instantiating `fn virtualize_my_trait::<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<SomeData<256>, 0>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>>`
--> $DIR/infinite-instantiation-struct-tail-ice-114484.rs:26:18
--> $DIR/infinite-instantiation-struct-tail-ice-114484.rs:24:18
|
LL | unsafe { virtualize_my_trait(L, self) }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -68,7 +68,7 @@ error: reached the recursion limit finding the struct tail for `VirtualWrapper<S
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
note: the above error was encountered while instantiating `fn virtualize_my_trait::<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<SomeData<256>, 0>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>, 1>>`
--> $DIR/infinite-instantiation-struct-tail-ice-114484.rs:26:18
--> $DIR/infinite-instantiation-struct-tail-ice-114484.rs:24:18
|
LL | unsafe { virtualize_my_trait(L, self) }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -76,7 +76,7 @@ LL | unsafe { virtualize_my_trait(L, self) }
error: reached the recursion limit while instantiating `<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<VirtualWrapper<..., 1>, 1>, 1>, 1>, 1> as MyTrait>::virtualize`
|
note: `<VirtualWrapper<T, L> as MyTrait>::virtualize` defined here
--> $DIR/infinite-instantiation-struct-tail-ice-114484.rs:25:5
--> $DIR/infinite-instantiation-struct-tail-ice-114484.rs:23:5
|
LL | fn virtualize(&self) -> &dyn MyTrait {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View file

@ -2,6 +2,7 @@
//
//@ needs-xray
//@ compile-flags: -Z instrument-xray=always,never
//@ error-pattern: incorrect value `always,never` for unstable option `instrument-xray`
fn main() {}
//~? ERROR incorrect value `always,never` for unstable option `instrument-xray`

View file

@ -2,6 +2,7 @@
//
//@ needs-xray
//@ compile-flags: -Z instrument-xray=always,always
//@ error-pattern: incorrect value `always,always` for unstable option `instrument-xray`
fn main() {}
//~? ERROR incorrect value `always,always` for unstable option `instrument-xray`

View file

@ -2,6 +2,7 @@
//
//@ needs-xray
//@ compile-flags: -Z instrument-xray=ignore-loops,ignore-loops
//@ error-pattern: incorrect value `ignore-loops,ignore-loops` for unstable option `instrument-xray`
fn main() {}
//~? ERROR incorrect value `ignore-loops,ignore-loops` for unstable option `instrument-xray`

Some files were not shown because too many files have changed in this diff Show more