Remove compile-fail test suite

This commit is contained in:
Vadim Petrochenkov 2020-12-28 20:15:16 +03:00
parent 158f8d034b
commit 4d2d0bad4e
116 changed files with 516 additions and 196 deletions

View File

@ -607,7 +607,7 @@ pub struct Crate<'hir> {
// over the ids in increasing order. In principle it should not
// matter what order we visit things in, but in *practice* it
// does, because it can affect the order in which errors are
// detected, which in turn can make compile-fail tests yield
// detected, which in turn can make UI tests yield
// slightly different results.
pub items: BTreeMap<HirId, Item<'hir>>,

View File

@ -12,7 +12,7 @@
//! In this code, we report errors on each `rustc_if_this_changed`
//! annotation. If a path exists in all cases, then we would report
//! "all path(s) exist". Otherwise, we report: "no path to `foo`" for
//! each case where no path exists. `compile-fail` tests can then be
//! each case where no path exists. `ui` tests can then be
//! used to check when paths exist or do not.
//!
//! The full form of the `rustc_if_this_changed` annotation is

View File

@ -889,7 +889,7 @@ fn analysis(tcx: TyCtxt<'_>, cnum: CrateNum) -> Result<()> {
// Avoid overwhelming user with errors if borrow checking failed.
// I'm not sure how helpful this is, to be honest, but it avoids a
// lot of annoying errors in the compile-fail tests (basically,
// lot of annoying errors in the ui tests (basically,
// lint warnings and so on -- kindck used to do this abort, but
// kindck is gone now). -nmatsakis
if sess.has_errors() {

View File

@ -280,7 +280,7 @@ impl<'tcx> Queries<'tcx> {
// Don't do code generation if there were any errors
self.session().compile_status()?;
// Hook for compile-fail tests.
// Hook for UI tests.
Self::check_for_rustc_errors_attr(tcx);
Ok(passes::start_codegen(&***self.codegen_backend(), tcx, &*outputs.peek()))
@ -289,7 +289,7 @@ impl<'tcx> Queries<'tcx> {
}
/// Check for the `#[rustc_error]` annotation, which forces an error in codegen. This is used
/// to write compile-fail tests that actually test that compilation succeeds without reporting
/// to write UI tests that actually test that compilation succeeds without reporting
/// an error.
fn check_for_rustc_errors_attr(tcx: TyCtxt<'_>) {
let def_id = match tcx.entry_fn(LOCAL_CRATE) {

View File

@ -92,7 +92,7 @@ impl<'tcx> MirPass<'tcx> for SanityCheck {
/// "rustc_peek: bit not set".
///
/// The intention is that one can write unit tests for dataflow by
/// putting code into a compile-fail test and using `rustc_peek` to
/// putting code into an UI test and using `rustc_peek` to
/// make observations about the results of dataflow static analyses.
///
/// (If there are any calls to `rustc_peek` that do not match the

View File

@ -525,7 +525,7 @@ impl<'a, 'b> BuildReducedGraphVisitor<'a, 'b> {
ModuleKind::Block(..) => unreachable!(),
};
// HACK(eddyb) unclear how good this is, but keeping `$crate`
// in `source` breaks `src/test/compile-fail/import-crate-var.rs`,
// in `source` breaks `src/test/ui/imports/import-crate-var.rs`,
// while the current crate doesn't have a valid `crate_name`.
if crate_name != kw::Invalid {
// `crate_name` should not be interpreted as relative.

View File

@ -162,7 +162,7 @@ impl<'tcx> OutlivesEnvironmentExt<'tcx> for OutlivesEnvironment<'tcx> {
/// 'b` (and hence, transitively, that `T: 'a`). This method would
/// add those assumptions into the outlives-environment.
///
/// Tests: `src/test/compile-fail/regions-free-region-ordering-*.rs`
/// Tests: `src/test/ui/regions/regions-free-region-ordering-*.rs`
fn add_implied_bounds(
&mut self,
infcx: &InferCtxt<'a, 'tcx>,

View File

@ -558,7 +558,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
// where-clause or, in the case of an object type,
// it could be that the object type lists the
// trait (e.g., `Foo+Send : Send`). See
// `compile-fail/typeck-default-trait-impl-send-param.rs`
// `ui/typeck/typeck-default-trait-impl-send-param.rs`
// for an example of a test case that exercises
// this path.
}

View File

@ -1767,8 +1767,7 @@ fn gather_explicit_predicates_of(tcx: TyCtxt<'_>, def_id: DefId) -> ty::GenericP
const NO_GENERICS: &hir::Generics<'_> = &hir::Generics::empty();
// We use an `IndexSet` to preserves order of insertion.
// Preserving the order of insertion is important here so as not to break
// compile-fail UI tests.
// Preserving the order of insertion is important here so as not to break UI tests.
let mut predicates: FxIndexSet<(ty::Predicate<'_>, Span)> = FxIndexSet::default();
let ast_generics = match node {

View File

@ -201,7 +201,6 @@ build/
# Output for all compiletest-based test suites
test/
ui/
compile-fail/
debuginfo/
...

View File

@ -384,7 +384,6 @@ impl<'a> Builder<'a> {
test::ExpandYamlAnchors,
test::Tidy,
test::Ui,
test::CompileFail,
test::RunPassValgrind,
test::MirOpt,
test::Codegen,

View File

@ -66,7 +66,6 @@ check-stage2-T-x86_64-unknown-linux-musl-H-x86_64-unknown-linux-gnu:
TESTS_IN_2 := \
src/test/ui \
src/test/compile-fail \
src/tools/linkchecker
ci-subset-1:
@ -75,8 +74,7 @@ ci-subset-2:
$(Q)$(BOOTSTRAP) test --stage 2 $(TESTS_IN_2)
TESTS_IN_MINGW_2 := \
src/test/ui \
src/test/compile-fail
src/test/ui
ci-mingw-subset-1:
$(Q)$(BOOTSTRAP) test --stage 2 $(TESTS_IN_MINGW_2:%=--exclude %)

View File

@ -869,12 +869,6 @@ default_test_with_compare_mode!(Ui {
compare_mode: "nll"
});
default_test!(CompileFail {
path: "src/test/compile-fail",
mode: "compile-fail",
suite: "compile-fail"
});
default_test!(RunPassValgrind {
path: "src/test/run-pass-valgrind",
mode: "run-pass-valgrind",

View File

@ -44,7 +44,6 @@ ENV WASM_TARGETS=wasm32-unknown-unknown
ENV WASM_SCRIPT python3 /checkout/x.py --stage 2 test --host='' --target $WASM_TARGETS \
src/test/run-make \
src/test/ui \
src/test/compile-fail \
src/test/mir-opt \
src/test/codegen-units \
library/core

View File

@ -1,7 +1,7 @@
#!/usr/bin/env python
"""
This script creates a pile of compile-fail tests check that all the
This script creates a pile of UI tests check that all the
derives have spans that point to the fields, rather than the
#[derive(...)] line.

View File

@ -1,15 +0,0 @@
// no-prefer-dynamic
#![crate_type = "rlib"]
#![no_std]
#![feature(lang_items)]
use core::panic::PanicInfo;
#[lang = "panic_impl"]
fn panic_impl(info: &PanicInfo) -> ! { loop {} }
#[lang = "eh_personality"]
fn eh_personality() {}
#[lang = "eh_catch_typeinfo"]
static EH_CATCH_TYPEINFO: u8 = 0;

View File

@ -1,17 +0,0 @@
// compile-flags:-C panic=unwind
// no-prefer-dynamic
#![feature(panic_runtime)]
#![crate_type = "rlib"]
#![no_std]
#![panic_runtime]
#[no_mangle]
pub extern fn __rust_maybe_catch_panic() {}
#[no_mangle]
pub extern fn __rust_start_panic() {}
#[no_mangle]
pub extern fn rust_eh_personality() {}

View File

@ -1,17 +0,0 @@
// compile-flags:-C panic=unwind
// no-prefer-dynamic
#![feature(panic_runtime)]
#![crate_type = "rlib"]
#![no_std]
#![panic_runtime]
#[no_mangle]
pub extern fn __rust_maybe_catch_panic() {}
#[no_mangle]
pub extern fn __rust_start_panic() {}
#[no_mangle]
pub extern fn rust_eh_personality() {}

View File

@ -1,11 +0,0 @@
// no-prefer-dynamic
#![crate_type = "rlib"]
#![no_std]
use core::panic::PanicInfo;
#[panic_handler]
fn panic(info: &PanicInfo) -> ! {
loop {}
}

View File

@ -1,6 +0,0 @@
// no-prefer-dynamic
#![crate_type = "rlib"]
#![no_std]
extern crate panic_runtime_unwind;

View File

@ -1,4 +0,0 @@
error: the crate `depends` cannot depend on a crate that needs a panic runtime, but it depends on `needs_panic_runtime`
error: aborting due to previous error

View File

@ -1,9 +1,8 @@
-include ../tools.mk
# Modelled after compile-fail/changing-crates test, but this one puts
# Modelled after ui/changing-crates.rs test, but this one puts
# more than one (mismatching) candidate crate into the search path,
# which did not appear directly expressible in compile-fail/aux-build
# infrastructure.
# which did not appear directly expressible in UI testing infrastructure.
#
# Note that we move the built libraries into target direcrtories rather than
# use the `--out-dir` option because the `../tools.mk` file already bakes a
@ -33,4 +32,4 @@ all:
'crate `crateA`:' \
'crate `crateB`:' \
< $(LOG)
# the 'crate `crateA`' will match two entries.
# the 'crate `crateA`' will match two entries.

View File

@ -5,7 +5,7 @@
// causing a type mismatch.
// The test is nearly the same as the one in
// compile-fail/type-mismatch-same-crate-name.rs
// ui/type/type-mismatch-same-crate-name.rs
// but deals with the case where one of the crates
// is only introduced as an indirect dependency.
// and the type is accessed via a re-export.

View File

@ -1,8 +1,8 @@
// Reject mixing cyclic structure and Drop when using TypedArena.
//
// (Compare against compile-fail/dropck_vec_cycle_checked.rs)
// (Compare against dropck-vec-cycle-checked.rs)
//
// (Also compare against compile-fail/dropck_tarena_unsound_drop.rs,
// (Also compare against ui-fulldeps/dropck-tarena-unsound-drop.rs,
// which is a reduction of this code to more directly show the reason
// for the error message we see here.)

View File

@ -5,7 +5,7 @@
// methods might access borrowed data, as long as the borrowed data
// has lifetime that strictly outlives the arena itself.
//
// Compare against compile-fail/dropck_tarena_unsound_drop.rs, which
// Compare against ui-fulldeps/dropck-tarena-unsound-drop.rs, which
// shows a similar setup, but restricts `f` so that the struct `C<'a>`
// is force-fed a lifetime equal to that of the borrowed arena.

View File

@ -2,7 +2,7 @@
// Ensure that we can copy out of a fixed-size array.
//
// (Compare with compile-fail/move-out-of-array-1.rs)
// (Compare with ui/moves/move-out-of-array-1.rs)
#[derive(Copy, Clone)]
struct C { _x: u8 }

View File

@ -3,7 +3,7 @@
// the trait definition if there is no default method and for every impl,
// `Self` does implement `Get`.
//
// See also compile-fail tests associated-types-no-suitable-supertrait
// See also tests associated-types-no-suitable-supertrait
// and associated-types-no-suitable-supertrait-2, which show how small
// variants of the code below can fail.

View File

@ -0,0 +1,16 @@
error[E0191]: the value of the associated types `ChildKey` (from trait `Hierarchy`), `Children` (from trait `Hierarchy`), `Value` (from trait `Hierarchy`) must be specified
--> $DIR/issue-23595-1.rs:8:58
|
LL | type Value;
| ----------- `Value` defined here
LL | type ChildKey;
| -------------- `ChildKey` defined here
LL | type Children = dyn Index<Self::ChildKey, Output=dyn Hierarchy>;
| -----------------------------------------------------^^^^^^^^^--
| | |
| | help: specify the associated types: `Hierarchy<Value = Type, ChildKey = Type, Children = Type>`
| `Children` defined here
error: aborting due to previous error
For more information about this error, try `rustc --explain E0191`.

View File

@ -0,0 +1,17 @@
error[E0277]: the trait bound `T: Copy` is not satisfied
--> $DIR/issue-27675-unchecked-bounds.rs:15:31
|
LL | fn copy<U: Setup + ?Sized>(from: &U::From) -> U::From {
| ----- required by this bound in `copy`
...
LL | copy::<dyn Setup<From=T>>(t)
| ^ the trait `Copy` is not implemented for `T`
|
help: consider restricting type parameter `T`
|
LL | pub fn copy_any<T: Copy>(t: &T) -> T {
| ^^^^^^
error: aborting due to previous error
For more information about this error, try `rustc --explain E0277`.

View File

@ -0,0 +1,11 @@
error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
--> $DIR/coerce-unsafe-closure-to-unsafe-fn-ptr.rs:2:31
|
LL | let _: unsafe fn() = || { ::std::pin::Pin::new_unchecked(&0_u8); };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
|
= note: consult the function's documentation for information on how to avoid undefined behavior
error: aborting due to previous error
For more information about this error, try `rustc --explain E0133`.

View File

@ -0,0 +1,11 @@
error[E0277]: expected a `FnOnce<(&str,)>` closure, found `unsafe extern "rust-intrinsic" fn(_) -> _ {transmute::<_, _>}`
--> $DIR/coerce-unsafe-to-closure.rs:2:44
|
LL | let x: Option<&[u8]> = Some("foo").map(std::mem::transmute);
| ^^^^^^^^^^^^^^^^^^^ expected an `FnOnce<(&str,)>` closure, found `unsafe extern "rust-intrinsic" fn(_) -> _ {transmute::<_, _>}`
|
= help: the trait `FnOnce<(&str,)>` is not implemented for `unsafe extern "rust-intrinsic" fn(_) -> _ {transmute::<_, _>}`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0277`.

View File

@ -0,0 +1,49 @@
error[E0744]: `for` is not allowed in a `const fn`
--> $DIR/const-fn-error.rs:7:5
|
LL | / for i in 0..x {
LL | |
LL | |
LL | |
... |
LL | | sum += i;
LL | | }
| |_____^
error[E0015]: calls in constant functions are limited to constant functions, tuple structs and tuple variants
--> $DIR/const-fn-error.rs:7:14
|
LL | for i in 0..x {
| ^^^^
error[E0658]: mutable references are not allowed in constant functions
--> $DIR/const-fn-error.rs:7:14
|
LL | for i in 0..x {
| ^^^^
|
= note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
= help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
error[E0015]: calls in constant functions are limited to constant functions, tuple structs and tuple variants
--> $DIR/const-fn-error.rs:7:14
|
LL | for i in 0..x {
| ^^^^
error[E0080]: evaluation of constant value failed
--> $DIR/const-fn-error.rs:7:14
|
LL | for i in 0..x {
| ^^^^
| |
| calling non-const function `<std::ops::Range<usize> as IntoIterator>::into_iter`
| inside `f` at $DIR/const-fn-error.rs:7:14
...
LL | let a : [i32; f(X)];
| ---- inside `main::{constant#0}` at $DIR/const-fn-error.rs:20:19
error: aborting due to 5 previous errors
Some errors have detailed explanations: E0015, E0080, E0658, E0744.
For more information about an error, try `rustc --explain E0015`.

View File

@ -0,0 +1,28 @@
error[E0391]: cycle detected when simplifying constant for the type system `Foo::bytes::{constant#0}`
--> $DIR/issue-44415.rs:6:17
|
LL | bytes: [u8; unsafe { intrinsics::size_of::<Foo>() }],
| ^^^^^^
|
note: ...which requires simplifying constant for the type system `Foo::bytes::{constant#0}`...
--> $DIR/issue-44415.rs:6:17
|
LL | bytes: [u8; unsafe { intrinsics::size_of::<Foo>() }],
| ^^^^^^
note: ...which requires const-evaluating + checking `Foo::bytes::{constant#0}`...
--> $DIR/issue-44415.rs:6:17
|
LL | bytes: [u8; unsafe { intrinsics::size_of::<Foo>() }],
| ^^^^^^
= note: ...which requires computing layout of `Foo`...
= note: ...which requires normalizing `[u8; _]`...
= note: ...which again requires simplifying constant for the type system `Foo::bytes::{constant#0}`, completing the cycle
note: cycle used when checking that `Foo` is well-formed
--> $DIR/issue-44415.rs:5:1
|
LL | struct Foo {
| ^^^^^^^^^^
error: aborting due to previous error
For more information about this error, try `rustc --explain E0391`.

View File

@ -1,3 +1,4 @@
// build-fail
// normalize-stderr-64bit "18446744073709551615" -> "SIZE"
// normalize-stderr-32bit "4294967295" -> "SIZE"

View File

@ -0,0 +1,25 @@
error[E0080]: values of the type `[u8; SIZE]` are too big for the current architecture
--> $SRC_DIR/core/src/mem/mod.rs:LL:COL
|
LL | intrinsics::size_of::<T>()
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| inside `std::mem::size_of::<[u8; SIZE]>` at $SRC_DIR/core/src/mem/mod.rs:LL:COL
| inside `main` at $DIR/issue-55878.rs:7:26
|
::: $DIR/issue-55878.rs:7:26
|
LL | println!("Size: {}", std::mem::size_of::<[u8; u64::MAX as usize]>());
| ----------------------------------------------
error: erroneous constant used
--> $DIR/issue-55878.rs:7:26
|
LL | println!("Size: {}", std::mem::size_of::<[u8; u64::MAX as usize]>());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
|
= note: `#[deny(const_err)]` on by default
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0080`.

View File

@ -1,3 +1,4 @@
// dont-check-compiler-stderr
// aux-build:crateresolve1-1.rs
// aux-build:crateresolve1-2.rs
// aux-build:crateresolve1-3.rs

View File

@ -1,7 +1,7 @@
// Reject mixing cyclic structure and Drop when using trait
// objects to hide the cross-references.
//
// (Compare against compile-fail/dropck_vec_cycle_checked.rs)
// (Compare against ui/span/dropck_vec_cycle_checked.rs)
use std::cell::Cell;
use id::Id;

View File

@ -0,0 +1,4 @@
error: extern location for std does not exist:
error: aborting due to previous error

View File

@ -36,7 +36,7 @@ impl Drop for DropMoveFoo { fn drop(&mut self) { } }
fn test0() {
// just copy implicitly copyable fields from `f`, no moves
// (and thus it is okay that these are Drop; compare against
// compile-fail test: borrowck-struct-update-with-dtor.rs).
// test ui/borrowck/borrowck-struct-update-with-dtor.rs).
// Case 1: Nocopyable
let f = DropNoFoo::new(1, 2);

View File

@ -5,4 +5,4 @@ inputs. This investigation was kicked off by #38714, which revealed
some pretty deep flaws in the ad-hoc way that we were doing things
before.
See also `src/test/compile-fail/closure-expected-type`.
See also `src/test/ui/closure-expected-type`.

View File

@ -1,6 +1,6 @@
// run-pass
// This test is bogus (i.e., should be compile-fail) during the period
// This test is bogus (i.e., should be check-fail) during the period
// where #54986 is implemented and #54987 is *not* implemented. For
// now: just ignore it
//

View File

@ -1,6 +1,6 @@
// run-pass
// This test is bogus (i.e., should be compile-fail) during the period
// This test is bogus (i.e., should be check-fail) during the period
// where #54986 is implemented and #54987 is *not* implemented. For
// now: just ignore it
//

View File

@ -3,7 +3,7 @@
// Demonstrate the use of the unguarded escape hatch with a lifetime param
// to assert that destructor will not access any dead data.
//
// Compare with compile-fail/issue28498-reject-lifetime-param.rs
// Compare with ui/span/issue28498-reject-lifetime-param.rs
#![feature(dropck_eyepatch)]

View File

@ -3,7 +3,7 @@
// Demonstrate the use of the unguarded escape hatch with a type param in negative position
// to assert that destructor will not access any dead data.
//
// Compare with compile-fail/issue28498-reject-lifetime-param.rs
// Compare with ui/span/issue28498-reject-lifetime-param.rs
// Demonstrate that a type param in negative position causes dropck to reject code
// that might indirectly access previously dropped value.

View File

@ -3,7 +3,7 @@
// Demonstrate the use of the unguarded escape hatch with a trait bound
// to assert that destructor will not access any dead data.
//
// Compare with compile-fail/issue28498-reject-trait-bound.rs
// Compare with ui/span/issue28498-reject-trait-bound.rs
#![feature(dropck_eyepatch)]

View File

@ -2,7 +2,7 @@
#![feature(test)]
#![allow(unused_mut)] // under NLL we get warning about `x` below: rust-lang/rust#54499
// This test is bogus (i.e., should be compile-fail) during the period
// This test is bogus (i.e., should be check-fail) during the period
// where #54986 is implemented and #54987 is *not* implemented. For
// now: just ignore it
//

View File

@ -1,3 +1,5 @@
// build-fail
// dont-check-compiler-stderr
// ignore-msvc due to linker-flavor=ld
// error-pattern:aFdEfSeVEEE
// compile-flags: -C linker-flavor=ld

View File

@ -1,3 +1,5 @@
// build-fail
// dont-check-compiler-stderr
// compile-flags: -C linker=llllll -C linker-flavor=ld
// error-pattern: linker `llllll` not found

View File

@ -0,0 +1,47 @@
error: unused implementer of `Iterator` that must be used
--> $DIR/must_use-in-stdlib-traits.rs:42:4
|
LL | iterator();
| ^^^^^^^^^^^
|
note: the lint level is defined here
--> $DIR/must_use-in-stdlib-traits.rs:1:9
|
LL | #![deny(unused_must_use)]
| ^^^^^^^^^^^^^^^
= note: iterators are lazy and do nothing unless consumed
error: unused implementer of `Future` that must be used
--> $DIR/must_use-in-stdlib-traits.rs:43:4
|
LL | future();
| ^^^^^^^^^
|
= note: futures do nothing unless you `.await` or poll them
error: unused implementer of `FnOnce` that must be used
--> $DIR/must_use-in-stdlib-traits.rs:44:4
|
LL | square_fn_once();
| ^^^^^^^^^^^^^^^^^
|
= note: closures are lazy and do nothing unless called
error: unused implementer of `FnMut` that must be used
--> $DIR/must_use-in-stdlib-traits.rs:45:4
|
LL | square_fn_mut();
| ^^^^^^^^^^^^^^^^
|
= note: closures are lazy and do nothing unless called
error: unused implementer of `Fn` that must be used
--> $DIR/must_use-in-stdlib-traits.rs:46:4
|
LL | square_fn();
| ^^^^^^^^^^^^
|
= note: closures are lazy and do nothing unless called
error: aborting due to 5 previous errors

View File

@ -1,3 +1,5 @@
// build-fail
// dont-check-compiler-stderr
// compile-flags: -C codegen-units=2
// ignore-emscripten

View File

@ -1,3 +1,5 @@
// build-fail
// dont-check-compiler-stderr
// ignore-emscripten
#![feature(llvm_asm)]

View File

@ -8,7 +8,7 @@
// to it being e.g., a place where the addition of an argument
// causes it to go down a code path with subtly different behavior).
//
// There is a companion test in compile-fail.
// There is a companion failing test.
// compile-flags: --test -C debug_assertions=yes
// revisions: std core
@ -68,26 +68,26 @@ fn to_format_or_not_to_format() {
assert!(true, "{}",);
// assert_eq!(1, 1, "{}",); // see compile-fail
// assert_ne!(1, 2, "{}",); // see compile-fail
// assert_eq!(1, 1, "{}",); // see check-fail
// assert_ne!(1, 2, "{}",); // see check-fail
debug_assert!(true, "{}",);
// debug_assert_eq!(1, 1, "{}",); // see compile-fail
// debug_assert_ne!(1, 2, "{}",); // see compile-fail
// eprint!("{}",); // see compile-fail
// eprintln!("{}",); // see compile-fail
// format!("{}",); // see compile-fail
// format_args!("{}",); // see compile-fail
// debug_assert_eq!(1, 1, "{}",); // see check-fail
// debug_assert_ne!(1, 2, "{}",); // see check-fail
// eprint!("{}",); // see check-fail
// eprintln!("{}",); // see check-fail
// format!("{}",); // see check-fail
// format_args!("{}",); // see check-fail
if falsum() { panic!("{}",); }
// print!("{}",); // see compile-fail
// println!("{}",); // see compile-fail
// unimplemented!("{}",); // see compile-fail
// print!("{}",); // see check-fail
// println!("{}",); // see check-fail
// unimplemented!("{}",); // see check-fail
if falsum() { unreachable!("{}",); }
// write!(&mut stdout, "{}",); // see compile-fail
// writeln!(&mut stdout, "{}",); // see compile-fail
// write!(&mut stdout, "{}",); // see check-fail
// writeln!(&mut stdout, "{}",); // see check-fail
}

View File

@ -23,22 +23,28 @@ LL | debug_assert_ne!(1, 2, "{}",);
| ^^
error: 1 positional argument in format string, but no arguments were given
--> $DIR/macro-comma-behavior.rs:54:19
--> $DIR/macro-comma-behavior.rs:52:19
|
LL | format_args!("{}",);
| ^^
error: 1 positional argument in format string, but no arguments were given
--> $DIR/macro-comma-behavior.rs:72:21
--> $DIR/macro-comma-behavior.rs:68:21
|
LL | unimplemented!("{}",);
| ^^
error: 1 positional argument in format string, but no arguments were given
--> $DIR/macro-comma-behavior.rs:81:24
--> $DIR/macro-comma-behavior.rs:77:24
|
LL | write!(f, "{}",)?;
| ^^
error: aborting due to 7 previous errors
error: 1 positional argument in format string, but no arguments were given
--> $DIR/macro-comma-behavior.rs:81:26
|
LL | writeln!(f, "{}",)?;
| ^^
error: aborting due to 8 previous errors

View File

@ -40,10 +40,8 @@ fn to_format_or_not_to_format() {
}
#[cfg(std)] {
// FIXME: compile-fail says "expected error not found" even though
// rustc does emit an error
// eprintln!("{}",);
// <DISABLED> [std]~^ ERROR no arguments
eprintln!("{}",);
//[std]~^ ERROR no arguments
}
#[cfg(std)] {
@ -63,10 +61,8 @@ fn to_format_or_not_to_format() {
}
#[cfg(std)] {
// FIXME: compile-fail says "expected error not found" even though
// rustc does emit an error
// println!("{}",);
// <DISABLED> [std]~^ ERROR no arguments
println!("{}",);
//[std]~^ ERROR no arguments
}
unimplemented!("{}",);
@ -82,11 +78,9 @@ fn to_format_or_not_to_format() {
//[core]~^ ERROR no arguments
//[std]~^^ ERROR no arguments
// FIXME: compile-fail says "expected error not found" even though
// rustc does emit an error
// writeln!(f, "{}",)?;
// <DISABLED> [core]~^ ERROR no arguments
// <DISABLED> [std]~^^ ERROR no arguments
writeln!(f, "{}",)?;
//[core]~^ ERROR no arguments
//[std]~^^ ERROR no arguments
Ok(())
}
}

View File

@ -29,34 +29,52 @@ LL | eprint!("{}",);
| ^^
error: 1 positional argument in format string, but no arguments were given
--> $DIR/macro-comma-behavior.rs:50:18
--> $DIR/macro-comma-behavior.rs:43:20
|
LL | eprintln!("{}",);
| ^^
error: 1 positional argument in format string, but no arguments were given
--> $DIR/macro-comma-behavior.rs:48:18
|
LL | format!("{}",);
| ^^
error: 1 positional argument in format string, but no arguments were given
--> $DIR/macro-comma-behavior.rs:54:19
--> $DIR/macro-comma-behavior.rs:52:19
|
LL | format_args!("{}",);
| ^^
error: 1 positional argument in format string, but no arguments were given
--> $DIR/macro-comma-behavior.rs:61:17
--> $DIR/macro-comma-behavior.rs:59:17
|
LL | print!("{}",);
| ^^
error: 1 positional argument in format string, but no arguments were given
--> $DIR/macro-comma-behavior.rs:72:21
--> $DIR/macro-comma-behavior.rs:64:19
|
LL | println!("{}",);
| ^^
error: 1 positional argument in format string, but no arguments were given
--> $DIR/macro-comma-behavior.rs:68:21
|
LL | unimplemented!("{}",);
| ^^
error: 1 positional argument in format string, but no arguments were given
--> $DIR/macro-comma-behavior.rs:81:24
--> $DIR/macro-comma-behavior.rs:77:24
|
LL | write!(f, "{}",)?;
| ^^
error: aborting due to 10 previous errors
error: 1 positional argument in format string, but no arguments were given
--> $DIR/macro-comma-behavior.rs:81:26
|
LL | writeln!(f, "{}",)?;
| ^^
error: aborting due to 13 previous errors

View File

@ -68,7 +68,7 @@ fn column() {
let _ = column!();
}
// compile_error! is in a companion to this test in compile-fail
// compile_error! is in a check-fail companion to this test
#[test]
fn concat() {

View File

@ -0,0 +1,10 @@
error: couldn't read $DIR/not-utf8.bin: stream did not contain valid UTF-8
--> $DIR/not-utf8.rs:4:5
|
LL | include!("not-utf8.bin")
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error

View File

@ -0,0 +1,16 @@
error[E0308]: mismatched types
--> $DIR/meta-expected-error-wrong-rev.rs:13:18
|
LL | let x: u32 = 22_usize;
| --- ^^^^^^^^ expected `u32`, found `usize`
| |
| expected due to this
|
help: change the type of the numeric literal from `usize` to `u32`
|
LL | let x: u32 = 22_u32;
| ^^^^^^
error: aborting due to previous error
For more information about this error, try `rustc --explain E0308`.

View File

@ -0,0 +1,57 @@
warning: denote infinite loops with `loop { ... }`
--> $DIR/issue-52443.rs:6:11
|
LL | [(); {while true {break}; 0}];
| ^^^^^^^^^^ help: use `loop`
|
= note: `#[warn(while_true)]` on by default
error[E0744]: `for` is not allowed in a `const`
--> $DIR/issue-52443.rs:9:12
|
LL | [(); { for _ in 0usize.. {}; 0}];
| ^^^^^^^^^^^^^^^^^^^^
error[E0308]: mismatched types
--> $DIR/issue-52443.rs:2:10
|
LL | [(); & { loop { continue } } ];
| ^^^^^^^^^^^^^^^^^^^^^^^
| |
| expected `usize`, found reference
| help: consider removing the borrow: `{ loop { continue } }`
|
= note: expected type `usize`
found reference `&_`
error[E0308]: mismatched types
--> $DIR/issue-52443.rs:4:17
|
LL | [(); loop { break }];
| ^^^^^
| |
| expected `usize`, found `()`
| help: give it a value of the expected type: `break 42`
error[E0015]: calls in constants are limited to constant functions, tuple structs and tuple variants
--> $DIR/issue-52443.rs:9:21
|
LL | [(); { for _ in 0usize.. {}; 0}];
| ^^^^^^^^
error[E0764]: mutable references are not allowed in constants
--> $DIR/issue-52443.rs:9:21
|
LL | [(); { for _ in 0usize.. {}; 0}];
| ^^^^^^^^ `&mut` is only allowed in `const fn`
error[E0015]: calls in constants are limited to constant functions, tuple structs and tuple variants
--> $DIR/issue-52443.rs:9:21
|
LL | [(); { for _ in 0usize.. {}; 0}];
| ^^^^^^^^
error: aborting due to 6 previous errors; 1 warning emitted
Some errors have detailed explanations: E0015, E0308, E0744, E0764.
For more information about an error, try `rustc --explain E0015`.

View File

@ -23,7 +23,7 @@ fn b<'a>(t: &'a Box<dyn Test>, mut ss: SomeStruct<'a>) {
ss.u = t;
}
// see also compile-fail/object-lifetime-default-from-rptr-box-error.rs
// see also ui/object-lifetime/object-lifetime-default-from-rptr-box-error.rs
fn d<'a>(t: &'a Box<dyn Test+'a>, mut ss: SomeStruct<'a>) {
ss.u = t;

View File

@ -1,3 +1,4 @@
// dont-check-compiler-stderr
// error-pattern: `#[panic_handler]` function required, but not found
#![feature(lang_items)]

View File

@ -1,3 +1,4 @@
// dont-check-compiler-stderr
// aux-build:some-panic-impl.rs
#![feature(lang_items)]

View File

@ -0,0 +1,19 @@
error[E0259]: the name `core` is defined multiple times
--> $DIR/weak-lang-item.rs:8:1
|
LL | extern crate core;
| ^^^^^^^^^^^^^^^^^^ `core` reimported here
|
= note: `core` must be defined only once in the type namespace of this module
help: you can use `as` to change the binding name of the import
|
LL | extern crate core as other_core;
|
error: `#[panic_handler]` function required, but not found
error: language item required, but not found: `eh_personality`
error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0259`.

View File

@ -1,3 +1,4 @@
// dont-check-compiler-stderr
// aux-build:needs-panic-runtime.rs
// aux-build:depends.rs
// error-pattern:cannot depend on a crate that needs a panic runtime

View File

@ -1,3 +1,5 @@
// build-fail
// dont-check-compiler-stderr
// error-pattern:cannot link together two panic runtimes: panic_runtime_unwind and panic_runtime_unwind2
// ignore-tidy-linelength
// aux-build:panic-runtime-unwind.rs

View File

@ -1,6 +1,7 @@
// Tests that the compiler errors if the user tries to turn off unwind tables
// when they are required.
//
// dont-check-compiler-stderr
// compile-flags: -C panic=unwind -C force-unwind-tables=no
// ignore-tidy-linelength
//

View File

@ -1,3 +1,5 @@
// build-fail
// dont-check-compiler-stderr
// error-pattern:is not compiled with this crate's panic strategy `abort`
// aux-build:panic-runtime-unwind.rs
// compile-flags:-C panic=abort

View File

@ -1,3 +1,5 @@
// build-fail
// dont-check-compiler-stderr
// error-pattern:is not compiled with this crate's panic strategy `abort`
// aux-build:panic-runtime-unwind.rs
// aux-build:wants-panic-runtime-unwind.rs

View File

@ -0,0 +1,44 @@
error: variant `JuniorGrade` is private and cannot be re-exported
--> $DIR/issue-46209-private-enum-variant-reexport.rs:6:32
|
LL | pub use self::Lieutenant::{JuniorGrade, Full};
| ^^^^^^^^^^^
...
LL | enum Lieutenant {
| --------------- help: consider making the enum public: `pub enum Lieutenant`
error: variant `Full` is private and cannot be re-exported
--> $DIR/issue-46209-private-enum-variant-reexport.rs:6:45
|
LL | pub use self::Lieutenant::{JuniorGrade, Full};
| ^^^^
error: enum is private and its variants cannot be re-exported
--> $DIR/issue-46209-private-enum-variant-reexport.rs:4:13
|
LL | pub use self::Professor::*;
| ^^^^^^^^^^^^^^^^^^
...
LL | enum Professor {
| -------------- help: consider making the enum public: `pub enum Professor`
error: enum is private and its variants cannot be re-exported
--> $DIR/issue-46209-private-enum-variant-reexport.rs:9:13
|
LL | pub use self::PettyOfficer::*;
| ^^^^^^^^^^^^^^^^^^^^^
...
LL | pub(in rank) enum PettyOfficer {
| ------------------------------ help: consider making the enum public: `pub enum PettyOfficer`
error: enum is private and its variants cannot be re-exported
--> $DIR/issue-46209-private-enum-variant-reexport.rs:11:13
|
LL | pub use self::Crewman::*;
| ^^^^^^^^^^^^^^^^
...
LL | crate enum Crewman {
| ------------------ help: consider making the enum public: `pub enum Crewman`
error: aborting due to 5 previous errors

View File

@ -117,7 +117,7 @@ pub fn main() {
let m : Box<dyn Trait> = make_val();
// assert_eq!(object_invoke1(&*m), (4,5));
// ~~~~~~~~~~~~~~~~~~~
// this call yields a compilation error; see compile-fail/dropck-object-cycle.rs
// this call yields a compilation error; see ui/span/dropck-object-cycle.rs
// for details.
assert_eq!(object_invoke2(&*m), 5);

View File

@ -4,7 +4,7 @@
// Test that a type which is contravariant with respect to its region
// parameter compiles successfully when used in a contravariant way.
//
// Note: see compile-fail/variance-regions-*.rs for the tests that check that the
// Note: see ui/variance/variance-regions-*.rs for the tests that check that the
// variance inference works in the first place.
// pretty-expanded FIXME #23616

View File

@ -3,7 +3,7 @@
// Test that a type which is covariant with respect to its region
// parameter is successful when used in a covariant way.
//
// Note: see compile-fail/variance-regions-*.rs for the tests that
// Note: see ui/variance/variance-regions-*.rs for the tests that
// check that the variance inference works in the first place.
// This is covariant with respect to 'a, meaning that

View File

@ -1,7 +1,7 @@
// Reject mixing cyclic structure and Drop when using fixed length
// arrays.
//
// (Compare against compile-fail/dropck_vec_cycle_checked.rs)
// (Compare against ui/span/dropck_vec_cycle_checked.rs)

View File

@ -1,6 +1,6 @@
// Reject mixing cyclic structure and Drop when using Vec.
//
// (Compare against compile-fail/dropck_arr_cycle_checked.rs)
// (Compare against ui/span/dropck_arr_cycle_checked.rs)
use std::cell::Cell;
use id::Id;

View File

@ -4,7 +4,7 @@
#![feature(specialization)] //~ WARN the feature `specialization` is incomplete
// Make sure we *can* project non-defaulted associated types
// cf compile-fail/specialization-default-projection.rs
// cf ui/specialization/specialization-default-projection.rs
// First, do so without any use of specialization

View File

@ -1,4 +1,3 @@
// compile-fail
#![feature(specialization)]
//~^ WARN the feature `specialization` is incomplete

View File

@ -0,0 +1,26 @@
warning: the feature `specialization` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/issue-50452-fail.rs:1:12
|
LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information
= help: consider using `min_specialization` instead, which is more stable and complete
error[E0520]: `foo` specializes an item from a parent `impl`, but that item is not marked `default`
--> $DIR/issue-50452-fail.rs:10:5
|
LL | fn foo() {}
| ^^^^^^^^^^^ cannot specialize default item `foo`
...
LL | / impl<T> Foo for T {
LL | | fn foo() {}
LL | | }
| |_- parent `impl` is here
|
= note: to specialize, `foo` in the parent `impl` must be marked `default`
error: aborting due to previous error; 1 warning emitted
For more information about this error, try `rustc --explain E0520`.

View File

@ -4,7 +4,7 @@
#![feature(specialization)] //~ WARN the feature `specialization` is incomplete
// Make sure we *can* project non-defaulted associated types
// cf compile-fail/specialization-default-projection.rs
// cf ui/specialization/specialization-default-projection.rs
// First, do so without any use of specialization

View File

@ -2,7 +2,7 @@
// Issue 23030: Workaround overflowing discriminant
// with explicit assignments.
// See also compile-fail/overflow-discrim.rs, which shows what
// See also ui/discrim/discrim-overflow.rs, which shows what
// happens if you leave the OhNo explicit cases out here.
fn f_i8() {

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