Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move tests from src/test/run-fail/ to src/test/ui/ #65506

Closed
wants to merge 19 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// run-fail
// error-pattern:index out of bounds

use std::usize;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// run-fail
// error-pattern:index out of bounds

use std::mem;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// run-fail
// error-pattern:index out of bounds: the len is 1 but the index is 2


Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// run-fail
// error-pattern:quux
fn foo() -> ! {
panic!("quux");
Expand Down
8 changes: 8 additions & 0 deletions src/test/ui/binop/binop-fail-3.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
warning: lint `resolve_trait_on_defaulted_unit` has been removed: `converted into hard error, see https://github.com/rust-lang/rust/issues/48950`
--> $DIR/binop-fail-3.rs:7:9
|
LL | #[allow(resolve_trait_on_defaulted_unit)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(renamed_and_removed_lints)]` on by default

Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// run-fail
// error-pattern:quux
fn my_err(s: String) -> ! {
println!("{}", s);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// run-fail
// error-pattern:panic 1

// revisions: migrate mir
Expand Down
1 change: 1 addition & 0 deletions src/test/run-fail/bug-811.rs → src/test/ui/bug-811.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// run-fail
// error-pattern:quux

use std::marker::PhantomData;
Expand Down
20 changes: 20 additions & 0 deletions src/test/ui/bug-811.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
warning: type `task_id` should have an upper camel case name
--> $DIR/bug-811.rs:10:6
|
LL | type task_id = isize;
| ^^^^^^^ help: convert the identifier to upper camel case: `TaskId`
|
= note: `#[warn(non_camel_case_types)]` on by default

warning: type `port_id` should have an upper camel case name
--> $DIR/bug-811.rs:11:6
|
LL | type port_id = isize;
| ^^^^^^^ help: convert the identifier to upper camel case: `PortId`

warning: type `chan_t` should have an upper camel case name
--> $DIR/bug-811.rs:13:8
|
LL | struct chan_t<T> {
| ^^^^^^ help: convert the identifier to upper camel case: `ChanT`

Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// run-fail
// error-pattern:oops

fn main() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#![allow(while_true)]

// run-fail
// error-pattern:quux
fn main() {
let _x: isize = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#![allow(while_true)]

// run-fail
// error-pattern:giraffe
fn main() {
panic!({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// run-fail
// error-pattern:generator resumed after panicking

// 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,3 +1,4 @@
// run-fail
// error-pattern:capacity overflow

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

pub fn main() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// run-fail
// error-pattern:bad input

fn main() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// run-fail
// error-pattern:stop

// #18576
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Regression test for Issue #20971.

// run-fail
// error-pattern:Hello, world!

pub trait Parser {
Expand Down
8 changes: 8 additions & 0 deletions src/test/ui/issues/issue-20971.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
warning: trait objects without an explicit `dyn` are deprecated
--> $DIR/issue-20971.rs:16:22
|
LL | pub fn many() -> Box<Parser<Input = <() as Parser>::Input> + 'static> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn Parser<Input = <() as Parser>::Input> + 'static`
|
= note: `#[warn(bare_trait_objects)]` on by default

Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// run-fail
// error-pattern:panic evaluated

#[allow(unused_variables)]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// run-fail
// error-pattern:panic evaluated

#[allow(unused_variables)]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// run-fail
// error-pattern:explicit panic

use std::sync::Arc;
Expand Down
14 changes: 14 additions & 0 deletions src/test/ui/issues/issue-2444.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
warning: type `e` should have an upper camel case name
--> $DIR/issue-2444.rs:6:6
|
LL | enum e<T> {
| ^ help: convert the identifier to upper camel case: `E`
|
= note: `#[warn(non_camel_case_types)]` on by default

warning: variant `ee` should have an upper camel case name
--> $DIR/issue-2444.rs:7:5
|
LL | ee(Arc<T>),
| ^^ help: convert the identifier to upper camel case: `Ee`

Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// run-fail
// error-pattern:custom message

fn main() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Regression test: issue had to do with "givens" in region inference,
// which were not being considered during the contraction phase.

// run-fail
// error-pattern:explicit panic

struct Parser<'i: 't, 't>(&'i u8, &'t u8);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// run-fail
// error-pattern:index out of bounds: the len is 5 but the index is 5

const fn test(x: usize) -> i32 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#![allow(unused_variables)]


// run-fail
// error-pattern:so long
fn main() {
let mut x = Vec::new();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// check that panics in destructors during assignment do not leave
// destroyed values lying around for other destructors to observe.

// run-fail
// error-pattern:panicking destructors ftw!

struct Observer<'a>(&'a mut FilledOnDrop);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// run-fail
// error-pattern:overflow

use std::time::{Instant, Duration};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// run-fail
// error-pattern:overflow

use std::time::{Duration, SystemTime};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// run-fail
// error-pattern:overflow

use std::time::{Instant, Duration};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// run-fail
// error-pattern:overflow

use std::time::{Duration, SystemTime};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// run-fail
// error-pattern: thread 'main' panicked at 'explicit panic'

fn main() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// run-fail
// error-pattern:explicit panic

fn foo<T>(t: T) {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// run-fail
// error-pattern:beep boop

#![allow(unused_variables)]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// run-fail
// error-pattern:assertion failed: 1 == 2

fn main() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// run-fail
// error-pattern:assertion failed: `(left == right)`
// error-pattern: left: `14`
// error-pattern:right: `15`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// run-fail
// error-pattern:panicked at 'assertion failed: false'

fn main() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// run-fail
// error-pattern:panicked at 'test-assert-fmt 42 rust'

fn main() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// run-fail
// error-pattern:panicked at 'test-assert-owned'

fn main() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// run-fail
// error-pattern:panicked at 'test-assert-static'

fn main() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// run-fail
// error-pattern:assertion failed: `(left != right)`
// error-pattern: left: `14`
// error-pattern:right: `14`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// run-fail
// error-pattern:not yet implemented
fn main() {
unimplemented!()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// run-fail
// error-pattern:internal error: entered unreachable code: 6 is not prime
fn main() {
unreachable!("{} is not {}", 6u32, "prime");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// run-fail
// error-pattern:internal error: entered unreachable code
fn main() {
unreachable!()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// run-fail
// error-pattern:internal error: entered unreachable code: uhoh
fn main() {
unreachable!("uhoh")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// run-fail
// error-pattern:internal error: entered unreachable code
fn main() {
unreachable!()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// run-fail
// error-pattern:explicit panic

#![allow(unreachable_code)]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// run-fail
// error-pattern:quux
fn f() -> ! {
panic!("quux")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// run-fail
// error-pattern:squirrelcupcake
fn cmp() -> isize {
match (Some('a'), None::<char>) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// run-fail
// Meta test for compiletest: check that when we give the wrong error
// patterns, the test fails.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// run-fail
// Meta test for compiletest: check that when we give the right error
// patterns, the test passes. See all `meta-revision-bad.rs`.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// run-fail
// error-pattern:converging_fn called
// error-pattern:0 dropped
// error-pattern:exit
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// run-fail
// error-pattern:complex called
// error-pattern:dropped
// error-pattern:exit
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// run-fail
// error-pattern:diverging_fn called

fn diverging_fn() -> ! {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// run-fail
// error-pattern:diverging_fn called
// error-pattern:0 dropped

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// run-fail
// compile-flags: -Z no-landing-pads -C codegen-units=1
// error-pattern:converging_fn called
// ignore-cloudabi no std::process
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// run-fail
// compile-flags: -Z no-landing-pads -C codegen-units=1
// error-pattern:diverging_fn called
// ignore-cloudabi no std::process
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// run-fail
// error-pattern:panic 1
// error-pattern:drop 2

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// run-fail
// error-pattern:drop 1
// error-pattern:drop 2
// ignore-cloudabi no std::process
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// run-fail
// error-pattern:drop 1
// ignore-cloudabi no std::process

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// run-fail
// error-pattern:unwind happens
// error-pattern:drop 3
// error-pattern:drop 2
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// run-fail
// error-pattern:index out of bounds: the len is 5 but the index is 10

const C: [u32; 5] = [0; 5];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// run-fail
// error-pattern:index out of bounds: the len is 5 but the index is 10

const C: &'static [u8; 5] = b"hello";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// run-fail
// error-pattern:index out of bounds: the len is 5 but the index is 10

const C: &'static [u8; 5] = b"hello";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Test that ! coerces to other types.

// run-fail
// error-pattern:aah!

fn call_another_fn<T, F: FnOnce() -> T>(f: F) -> T {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// run-fail
// error-pattern:attempt to divide by zero

fn main() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// run-fail
// error-pattern:attempt to calculate the remainder with a divisor of zero

fn main() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// run-fail
// error-pattern:thread 'main' panicked at 'attempt to add with overflow'
// compile-flags: -C debug-assertions

Expand Down
Loading