Skip to content

Commit

Permalink
Rollup merge of rust-lang#71185 - JohnTitor:run-fail, r=petrochenkov
Browse files Browse the repository at this point in the history
Move tests from `test/run-fail` to UI

Fixes rust-lang#65440
cc rust-lang#65865 rust-lang#65506
r? @nikomatsakis
  • Loading branch information
RalfJung authored May 9, 2020
2 parents 2420b42 + 9a164ff commit 1704dca
Show file tree
Hide file tree
Showing 165 changed files with 537 additions and 152 deletions.
2 changes: 0 additions & 2 deletions src/bootstrap/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,6 @@ impl<'a> Builder<'a> {
test::Tidy,
test::Ui,
test::CompileFail,
test::RunFail,
test::RunPassValgrind,
test::MirOpt,
test::Codegen,
Expand All @@ -370,7 +369,6 @@ impl<'a> Builder<'a> {
test::UiFullDeps,
test::Rustdoc,
test::Pretty,
test::RunFailPretty,
test::RunPassValgrindPretty,
test::Crate,
test::CrateLibrustc,
Expand Down
1 change: 0 additions & 1 deletion src/bootstrap/mk/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ check:
$(Q)$(BOOTSTRAP) test $(BOOTSTRAP_ARGS)
check-aux:
$(Q)$(BOOTSTRAP) test \
src/test/run-fail/pretty \
src/test/run-pass-valgrind/pretty \
$(AUX_ARGS) \
$(BOOTSTRAP_ARGS)
Expand Down
9 changes: 0 additions & 9 deletions src/bootstrap/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -898,8 +898,6 @@ default_test!(CompileFail {
suite: "compile-fail"
});

default_test!(RunFail { path: "src/test/run-fail", mode: "run-fail", suite: "run-fail" });

default_test!(RunPassValgrind {
path: "src/test/run-pass-valgrind",
mode: "run-pass-valgrind",
Expand Down Expand Up @@ -929,13 +927,6 @@ host_test!(UiFullDeps { path: "src/test/ui-fulldeps", mode: "ui", suite: "ui-ful
host_test!(Rustdoc { path: "src/test/rustdoc", mode: "rustdoc", suite: "rustdoc" });

host_test!(Pretty { path: "src/test/pretty", mode: "pretty", suite: "pretty" });
test!(RunFailPretty {
path: "src/test/run-fail/pretty",
mode: "pretty",
suite: "run-fail",
default: false,
host: true
});
test!(RunPassValgrindPretty {
path: "src/test/run-pass-valgrind/pretty",
mode: "pretty",
Expand Down
24 changes: 0 additions & 24 deletions src/test/run-fail/bug-811.rs

This file was deleted.

9 changes: 0 additions & 9 deletions src/test/run-fail/overflowing-lsh-1.rs

This file was deleted.

9 changes: 0 additions & 9 deletions src/test/run-fail/overflowing-lsh-2.rs

This file was deleted.

9 changes: 0 additions & 9 deletions src/test/run-fail/overflowing-lsh-3.rs

This file was deleted.

9 changes: 0 additions & 9 deletions src/test/run-fail/overflowing-rsh-1.rs

This file was deleted.

9 changes: 0 additions & 9 deletions src/test/run-fail/overflowing-rsh-2.rs

This file was deleted.

9 changes: 0 additions & 9 deletions src/test/run-fail/overflowing-rsh-3.rs

This file was deleted.

9 changes: 0 additions & 9 deletions src/test/run-fail/overflowing-rsh-5.rs

This file was deleted.

10 changes: 0 additions & 10 deletions src/test/run-fail/overflowing-rsh-6.rs

This file was deleted.

7 changes: 0 additions & 7 deletions src/test/run-fail/panic-macro-any.rs

This file was deleted.

10 changes: 0 additions & 10 deletions src/test/run-fail/unwind-unique.rs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// run-fail
// error-pattern:index out of bounds
// ignore-emscripten no processes

use std::usize;
use std::mem::size_of;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
// Test bounds checking for DST raw slices

// run-fail
// error-pattern:index out of bounds
// ignore-emscripten no processes

#[allow(unconditional_panic)]
fn main() {
let a: *const [_] = &[1, 2, 3];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
// run-fail
// error-pattern:quux
// ignore-emscripten no processes

fn foo() -> ! {
panic!("quux");
}

#[allow(resolve_trait_on_defaulted_unit)]
fn main() {
foo() == foo(); // these types wind up being defaulted to ()
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
// run-fail
// error-pattern:quux
// ignore-emscripten no processes

fn my_err(s: String) -> ! {
println!("{}", s);
panic!("quux");
}

fn main() {
3_usize == my_err("bye".to_string());
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// run-fail
// error-pattern:panic 1
// ignore-emscripten no processes

// revisions: migrate mir
//[mir]compile-flags: -Z borrowck=mir
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// run-fail
// error-pattern:oops
// ignore-emscripten no processes

fn main() {
let func = || -> ! {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#![allow(unconditional_panic, const_err)]

// run-fail
// error-pattern: attempt to divide by zero
// ignore-emscripten no processes

fn main() {
let x = &(1 / (1 - 1));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// run-fail
// error-pattern:explicit panic
// ignore-emscripten no processes

fn f() -> ! {
panic!()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// run-fail
// error-pattern:generator resumed after panicking
// ignore-emscripten no processes

// Test that we get the correct message for resuming a panicked generator.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// run-fail
// error-pattern:capacity overflow
// ignore-emscripten no processes

use std::collections::hash_map::HashMap;
use std::usize;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// run-fail
// error-pattern:explicit panic
// ignore-emscripten no processes

fn f() -> ! {
panic!()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// run-fail
// error-pattern:explicit panic
// ignore-emscripten no processes

fn main() {
let _x = if false {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
// run-fail
// error-pattern:Number is odd
// ignore-emscripten no processes

fn even(x: usize) -> bool {
if x < 2 {
return false;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
// run-fail
// error-pattern:quux
// ignore-emscripten no processes

fn my_err(s: String) -> ! {
println!("{}", s);
panic!("quux");
}

fn main() {
if my_err("bye".to_string()) {
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Issue #7580

// run-fail
// error-pattern:panic works
// ignore-emscripten no processes

use std::*;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// run-fail
// error-pattern:explicit panic
// ignore-emscripten no processes

pub fn main() {
panic!();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// run-fail
// error-pattern:bad input
// ignore-emscripten no processes

fn main() {
Some("foo").unwrap_or(panic!("bad input")).to_string();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// run-fail
// error-pattern:stop
// ignore-emscripten no processes

// #18576
// Make sure that calling an extern function pointer in an unreachable
Expand All @@ -10,4 +12,5 @@ fn main() {
let pointer = other;
pointer();
}

extern "C" fn other() {}
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Regression test for Issue #20971.

// run-fail
// error-pattern:Hello, world!
// ignore-emscripten no processes

pub trait Parser {
type Input;
Expand All @@ -12,7 +14,7 @@ impl Parser for () {
fn parse(&mut self, input: ()) {}
}

pub fn many() -> Box<Parser<Input = <() as Parser>::Input> + 'static> {
pub fn many() -> Box<dyn Parser<Input = <() as Parser>::Input> + 'static> {
panic!("Hello, world!")
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// run-fail
// error-pattern:panic evaluated
// ignore-emscripten no processes

#[allow(unused_variables)]
fn main() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// run-fail
// error-pattern:panic evaluated
// ignore-emscripten no processes

#[allow(unused_variables)]
fn main() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
// run-fail
// error-pattern:explicit panic
// ignore-emscripten no processes

use std::sync::Arc;

enum e<T> {
ee(Arc<T>),
enum Err<T> {
Errr(Arc<T>),
}

fn foo() -> e<isize> {
fn foo() -> Err<isize> {
panic!();
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// run-fail
// error-pattern:index out of bounds
// ignore-emscripten no processes

use std::mem;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// run-fail
// error-pattern:custom message
// ignore-emscripten no processes

fn main() {
assert!(false, "custom message");
Expand Down
Loading

0 comments on commit 1704dca

Please sign in to comment.