Skip to content

Commit a917de4

Browse files
committed
Move tests from /ui directory
1 parent 1f2b71e commit a917de4

10 files changed

+39
-31
lines changed

tests/ui/auxiliary/removing-extern-crate.rs

-1
This file was deleted.

tests/ui/catch-unwind-bang.rs

-10
This file was deleted.
File renamed without changes.

tests/ui/error-festival.rs renamed to tests/ui/error-emitter/error-festival.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! Check that if there are a lot of errors we truncate the list of errors appropriately
2+
13
enum Question {
24
Yes,
35
No,

tests/ui/error-festival.stderr renamed to tests/ui/error-emitter/error-festival.stderr

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0425]: cannot find value `y` in this scope
2-
--> $DIR/error-festival.rs:14:5
2+
--> $DIR/error-festival.rs:16:5
33
|
44
LL | y = 2;
55
| ^
@@ -15,47 +15,47 @@ LL | let y = 2;
1515
| +++
1616

1717
error[E0603]: constant `FOO` is private
18-
--> $DIR/error-festival.rs:22:10
18+
--> $DIR/error-festival.rs:24:10
1919
|
2020
LL | foo::FOO;
2121
| ^^^ private constant
2222
|
2323
note: the constant `FOO` is defined here
24-
--> $DIR/error-festival.rs:7:5
24+
--> $DIR/error-festival.rs:9:5
2525
|
2626
LL | const FOO: u32 = 0;
2727
| ^^^^^^^^^^^^^^^^^^^
2828

2929
error[E0368]: binary assignment operation `+=` cannot be applied to type `&str`
30-
--> $DIR/error-festival.rs:12:5
30+
--> $DIR/error-festival.rs:14:5
3131
|
3232
LL | x += 2;
3333
| -^^^^^
3434
| |
3535
| cannot use `+=` on type `&str`
3636

3737
error[E0599]: no method named `z` found for reference `&str` in the current scope
38-
--> $DIR/error-festival.rs:16:7
38+
--> $DIR/error-festival.rs:18:7
3939
|
4040
LL | x.z();
4141
| ^ method not found in `&str`
4242

4343
error[E0600]: cannot apply unary operator `!` to type `Question`
44-
--> $DIR/error-festival.rs:19:5
44+
--> $DIR/error-festival.rs:21:5
4545
|
4646
LL | !Question::Yes;
4747
| ^^^^^^^^^^^^^^ cannot apply unary operator `!`
4848
|
4949
note: an implementation of `Not` might be missing for `Question`
50-
--> $DIR/error-festival.rs:1:1
50+
--> $DIR/error-festival.rs:3:1
5151
|
5252
LL | enum Question {
5353
| ^^^^^^^^^^^^^ must implement `Not`
5454
note: the trait `Not` must be implemented
5555
--> $SRC_DIR/core/src/ops/bit.rs:LL:COL
5656

5757
error[E0604]: only `u8` can be cast as `char`, not `u32`
58-
--> $DIR/error-festival.rs:25:5
58+
--> $DIR/error-festival.rs:27:5
5959
|
6060
LL | 0u32 as char;
6161
| ^^^^^^^^^^^^
@@ -64,13 +64,13 @@ LL | 0u32 as char;
6464
| help: try `char::from_u32` instead: `char::from_u32(0u32)`
6565

6666
error[E0605]: non-primitive cast: `u8` as `Vec<u8>`
67-
--> $DIR/error-festival.rs:29:5
67+
--> $DIR/error-festival.rs:31:5
6868
|
6969
LL | x as Vec<u8>;
7070
| ^^^^^^^^^^^^ an `as` expression can only be used to convert between primitive types or to coerce to a specific trait object
7171

7272
error[E0054]: cannot cast `{integer}` as `bool`
73-
--> $DIR/error-festival.rs:33:24
73+
--> $DIR/error-festival.rs:35:24
7474
|
7575
LL | let x_is_nonzero = x as bool;
7676
| ^^^^^^^^^
@@ -82,7 +82,7 @@ LL + let x_is_nonzero = x != 0;
8282
|
8383

8484
error[E0606]: casting `&u8` as `u32` is invalid
85-
--> $DIR/error-festival.rs:37:18
85+
--> $DIR/error-festival.rs:39:18
8686
|
8787
LL | let y: u32 = x as u32;
8888
| ^^^^^^^^
@@ -93,7 +93,7 @@ LL | let y: u32 = *x as u32;
9393
| +
9494

9595
error[E0607]: cannot cast thin pointer `*const u8` to wide pointer `*const [u8]`
96-
--> $DIR/error-festival.rs:41:5
96+
--> $DIR/error-festival.rs:43:5
9797
|
9898
LL | v as *const [u8];
9999
| ^^^^^^^^^^^^^^^^

tests/ui/panics/catch-unwind-bang.rs

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//! Check that the unwind machinery handles uninhabited types correctly.
2+
//! It used to call `std::mem::uninitialized::<!>();` at some point...
3+
//!
4+
//! See <https://github.com/rust-lang/rust/issues/39432>
5+
6+
//@ run-pass
7+
//@ needs-unwind
8+
9+
fn worker() -> ! {
10+
panic!()
11+
}
12+
13+
fn main() {
14+
std::panic::catch_unwind(worker).unwrap_err();
15+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// intentionally blank, used because we need an extern crate for
2+
// `removing-extern-crate.rs` but don't care about what's in it.

tests/ui/removing-extern-crate.fixed renamed to tests/ui/rust-2018/removing-extern-crate.fixed

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@ edition:2018
2-
//@ aux-build:removing-extern-crate.rs
2+
//@ aux-build:dummy-crate.rs
33
//@ run-rustfix
44
//@ check-pass
55

tests/ui/removing-extern-crate.rs renamed to tests/ui/rust-2018/removing-extern-crate.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
//@ edition:2018
2-
//@ aux-build:removing-extern-crate.rs
2+
//@ aux-build:dummy-crate.rs
33
//@ run-rustfix
44
//@ check-pass
55

66
#![warn(rust_2018_idioms)]
77

8-
extern crate removing_extern_crate as foo; //~ WARNING unused extern crate
8+
extern crate dummy_crate as foo; //~ WARNING unused extern crate
99
extern crate core; //~ WARNING unused extern crate
1010

1111
mod another {
12-
extern crate removing_extern_crate as foo; //~ WARNING unused extern crate
12+
extern crate dummy_crate as foo; //~ WARNING unused extern crate
1313
extern crate core; //~ WARNING unused extern crate
1414
}
1515

tests/ui/removing-extern-crate.stderr renamed to tests/ui/rust-2018/removing-extern-crate.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
warning: unused extern crate
22
--> $DIR/removing-extern-crate.rs:8:1
33
|
4-
LL | extern crate removing_extern_crate as foo;
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove it
4+
LL | extern crate dummy_crate as foo;
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove it
66
|
77
note: the lint level is defined here
88
--> $DIR/removing-extern-crate.rs:6:9
@@ -20,8 +20,8 @@ LL | extern crate core;
2020
warning: unused extern crate
2121
--> $DIR/removing-extern-crate.rs:12:5
2222
|
23-
LL | extern crate removing_extern_crate as foo;
24-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove it
23+
LL | extern crate dummy_crate as foo;
24+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove it
2525

2626
warning: unused extern crate
2727
--> $DIR/removing-extern-crate.rs:13:5

0 commit comments

Comments
 (0)