Skip to content

Commit b2aeb0f

Browse files
committed
Move some tests in src/test/compile-fail -> src/test/ui.
1 parent d3e2cec commit b2aeb0f

File tree

71 files changed

+383
-66
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+383
-66
lines changed

src/test/compile-fail/auxiliary/panic-runtime-lang-items.rs

-15
This file was deleted.

src/test/compile-fail/auxiliary/panic-runtime-unwind.rs

-17
This file was deleted.

src/test/compile-fail/auxiliary/panic-runtime-unwind2.rs

-17
This file was deleted.

src/test/compile-fail/auxiliary/some-panic-impl.rs

-11
This file was deleted.

src/test/compile-fail/auxiliary/wants-panic-runtime-unwind.rs

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

src/test/ui/asm/asm-src-loc.stderr

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
error: <inline asm>:1:2: error: invalid instruction mnemonic 'nowayisthisavalidinstruction'
2+
nowayisthisavalidinstruction
3+
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
4+
5+
--> $DIR/asm-src-loc.rs:7:9
6+
|
7+
LL | asm!("nowayisthisavalidinstruction");
8+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
9+
10+
error: aborting due to previous error
11+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
error[E0191]: the value of the associated types `Value` (from the trait `Hierarchy`), `ChildKey` (from the trait `Hierarchy`), `Children` (from the trait `Hierarchy`) must be specified
2+
--> $DIR/issue-23595-1.rs:8:54
3+
|
4+
LL | type Value;
5+
| ----------- `Value` defined here
6+
LL | type ChildKey;
7+
| -------------- `ChildKey` defined here
8+
LL | type Children = dyn Index<Self::ChildKey, Output=dyn Hierarchy>;
9+
| -------------------------------------------------^^^^^^^^^^^^^--
10+
| | |
11+
| | associated type `Value` must be specified
12+
| | associated type `ChildKey` must be specified
13+
| | associated type `Children` must be specified
14+
| `Children` defined here
15+
16+
error: aborting due to previous error
17+
18+
For more information about this error, try `rustc --explain E0191`.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
error[E0277]: the trait bound `f32: Foo` is not satisfied
2+
--> $DIR/chalk_initial_program.rs:15:5
3+
|
4+
LL | gimme::<f32>();
5+
| ^^^^^^^^^^^^ the trait `Foo` is not implemented for `f32`
6+
|
7+
note: required by `gimme`
8+
--> $DIR/chalk_initial_program.rs:9:1
9+
|
10+
LL | fn gimme<F: Foo>() { }
11+
| ^^^^^^^^^^^^^^^^^^
12+
13+
error: aborting due to previous error
14+
15+
For more information about this error, try `rustc --explain E0277`.
+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
error[E0277]: the trait bound `(std::option::Option<T>, f32): Foo` is not satisfied
2+
--> $DIR/generic_impls.rs:12:5
3+
|
4+
LL | gimme::<(Option<T>, f32)>();
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `(std::option::Option<T>, f32)`
6+
|
7+
= help: the following implementations were found:
8+
<(T, u32) as Foo>
9+
note: required by `gimme`
10+
--> $DIR/generic_impls.rs:7:1
11+
|
12+
LL | fn gimme<F: Foo>() { }
13+
| ^^^^^^^^^^^^^^^^^^
14+
15+
error[E0277]: the trait bound `(i32, f32): Foo` is not satisfied
16+
--> $DIR/generic_impls.rs:17:5
17+
|
18+
LL | gimme::<(i32, f32)>();
19+
| ^^^^^^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `(i32, f32)`
20+
|
21+
= help: the following implementations were found:
22+
<(T, u32) as Foo>
23+
note: required by `gimme`
24+
--> $DIR/generic_impls.rs:7:1
25+
|
26+
LL | fn gimme<F: Foo>() { }
27+
| ^^^^^^^^^^^^^^^^^^
28+
29+
error: aborting due to 2 previous errors
30+
31+
For more information about this error, try `rustc --explain E0277`.

src/test/ui/chalkify/type_wf.stderr

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
error[E0277]: the trait bound `{float}: Foo` is not satisfied
2+
--> $DIR/type_wf.rs:17:13
3+
|
4+
LL | let s = S {
5+
| ^ the trait `Foo` is not implemented for `{float}`
6+
|
7+
= help: the following implementations were found:
8+
<i32 as Foo>
9+
<std::option::Option<T> as Foo>
10+
note: required by `S`
11+
--> $DIR/type_wf.rs:5:1
12+
|
13+
LL | struct S<T: Foo> {
14+
| ^^^^^^^^^^^^^^^^
15+
16+
error: aborting due to previous error
17+
18+
For more information about this error, try `rustc --explain E0277`.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
2+
--> $DIR/coerce-unsafe-closure-to-unsafe-fn-ptr.rs:2:31
3+
|
4+
LL | let _: unsafe fn() = || { ::std::pin::Pin::new_unchecked(&0_u8); };
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
6+
|
7+
= note: consult the function's documentation for information on how to avoid undefined behavior
8+
9+
error: aborting due to previous error
10+
11+
For more information about this error, try `rustc --explain E0133`.

src/test/ui/consts/const-err3.stderr

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
error: this expression will panic at runtime
2+
--> $DIR/const-err3.rs:9:13
3+
|
4+
LL | let b = 200u8 + 200u8 + 200u8;
5+
| ^^^^^^^^^^^^^ attempt to add with overflow
6+
|
7+
note: lint level defined here
8+
--> $DIR/const-err3.rs:2:9
9+
|
10+
LL | #![deny(const_err)]
11+
| ^^^^^^^^^
12+
13+
error: this expression will panic at runtime
14+
--> $DIR/const-err3.rs:11:13
15+
|
16+
LL | let c = 200u8 * 4;
17+
| ^^^^^^^^^ attempt to multiply with overflow
18+
19+
error: this expression will panic at runtime
20+
--> $DIR/const-err3.rs:13:13
21+
|
22+
LL | let d = 42u8 - (42u8 + 1);
23+
| ^^^^^^^^^^^^^^^^^ attempt to subtract with overflow
24+
25+
error: index out of bounds: the len is 1 but the index is 1
26+
--> $DIR/const-err3.rs:15:14
27+
|
28+
LL | let _e = [5u8][1];
29+
| ^^^^^^^^
30+
31+
error: aborting due to 4 previous errors
32+
+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
error[E0015]: calls in constant functions are limited to constant functions, tuple structs and tuple variants
2+
--> $DIR/const-fn-error.rs:7:14
3+
|
4+
LL | for i in 0..x {
5+
| ^^^^
6+
7+
error[E0019]: constant function contains unimplemented expression type
8+
--> $DIR/const-fn-error.rs:7:14
9+
|
10+
LL | for i in 0..x {
11+
| ^^^^
12+
13+
error[E0019]: constant function contains unimplemented expression type
14+
--> $DIR/const-fn-error.rs:7:5
15+
|
16+
LL | / for i in 0..x {
17+
LL | |
18+
LL | |
19+
LL | |
20+
LL | |
21+
LL | | sum += i;
22+
LL | | }
23+
| |_____^
24+
25+
error[E0080]: evaluation of constant value failed
26+
--> $DIR/const-fn-error.rs:7:14
27+
|
28+
LL | for i in 0..x {
29+
| ^^^^ calling non-const function `<std::ops::Range<usize> as std::iter::IntoIterator>::into_iter`
30+
31+
error: aborting due to 4 previous errors
32+
33+
Some errors have detailed explanations: E0015, E0019, E0080.
34+
For more information about an error, try `rustc --explain E0015`.

src/test/ui/consts/issue-52443.stderr

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
error[E0308]: mismatched types
2+
--> $DIR/issue-52443.rs:2:10
3+
|
4+
LL | [(); & { loop { continue } } ];
5+
| ^^^^^^^^^^^^^^^^^^^^^^^
6+
| |
7+
| expected usize, found reference
8+
| help: consider removing the borrow: `{ loop { continue } }`
9+
|
10+
= note: expected type `usize`
11+
found type `&_`
12+
13+
error[E0308]: mismatched types
14+
--> $DIR/issue-52443.rs:3:17
15+
|
16+
LL | [(); loop { break }];
17+
| ^^^^^ expected (), found usize
18+
|
19+
= note: expected type `()`
20+
found type `usize`
21+
22+
error[E0019]: constant contains unimplemented expression type
23+
--> $DIR/issue-52443.rs:4:11
24+
|
25+
LL | [(); {while true {break}; 0}];
26+
| ^^^^^^^^^^^^^^^^^^
27+
28+
error[E0015]: calls in constants are limited to constant functions, tuple structs and tuple variants
29+
--> $DIR/issue-52443.rs:5:21
30+
|
31+
LL | [(); { for _ in 0usize.. {}; 0}];
32+
| ^^^^^^^^
33+
34+
error[E0019]: constant contains unimplemented expression type
35+
--> $DIR/issue-52443.rs:5:21
36+
|
37+
LL | [(); { for _ in 0usize.. {}; 0}];
38+
| ^^^^^^^^
39+
40+
error[E0019]: constant contains unimplemented expression type
41+
--> $DIR/issue-52443.rs:5:12
42+
|
43+
LL | [(); { for _ in 0usize.. {}; 0}];
44+
| ^^^^^^^^^^^^^^^^^^^^
45+
46+
error[E0080]: evaluation of constant value failed
47+
--> $DIR/issue-52443.rs:5:21
48+
|
49+
LL | [(); { for _ in 0usize.. {}; 0}];
50+
| ^^^^^^^^ calling non-const function `<std::ops::RangeFrom<usize> as std::iter::IntoIterator>::into_iter`
51+
52+
error: aborting due to 7 previous errors
53+
54+
Some errors have detailed explanations: E0015, E0019, E0080, E0308.
55+
For more information about an error, try `rustc --explain E0015`.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
error: extern location for std does not exist:
2+
3+
error[E0463]: can't find crate for `std`
4+
5+
error: aborting due to 2 previous errors
6+
7+
For more information about this error, try `rustc --explain E0463`.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
error[E0259]: the name `core` is defined multiple times
2+
--> $DIR/weak-lang-item.rs:8:1
3+
|
4+
LL | extern crate core;
5+
| ^^^^^^^^^^^^^^^^^^ `core` reimported here
6+
|
7+
= note: `core` must be defined only once in the type namespace of this module
8+
help: you can use `as` to change the binding name of the import
9+
|
10+
LL | extern crate core as other_core;
11+
|
12+
13+
error: `#[panic_handler]` function required, but not found
14+
15+
error: language item required, but not found: `eh_personality`
16+
17+
error: aborting due to 3 previous errors
18+
19+
For more information about this error, try `rustc --explain E0259`.
+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
error: linker `llllll` not found
2+
|
3+
= note: No such file or directory (os error 2)
4+
5+
error: aborting due to previous error
6+
File renamed without changes.
File renamed without changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
error: unused implementer of `std::iter::Iterator` that must be used
2+
--> $DIR/must_use-in-stdlib-traits.rs:42:4
3+
|
4+
LL | iterator();
5+
| ^^^^^^^^^^^
6+
|
7+
note: lint level defined here
8+
--> $DIR/must_use-in-stdlib-traits.rs:1:9
9+
|
10+
LL | #![deny(unused_must_use)]
11+
| ^^^^^^^^^^^^^^^
12+
= note: iterators are lazy and do nothing unless consumed
13+
14+
error: unused implementer of `std::future::Future` that must be used
15+
--> $DIR/must_use-in-stdlib-traits.rs:43:4
16+
|
17+
LL | future();
18+
| ^^^^^^^^^
19+
|
20+
= note: futures do nothing unless you `.await` or poll them
21+
22+
error: unused implementer of `std::ops::FnOnce` that must be used
23+
--> $DIR/must_use-in-stdlib-traits.rs:44:4
24+
|
25+
LL | square_fn_once();
26+
| ^^^^^^^^^^^^^^^^^
27+
|
28+
= note: closures are lazy and do nothing unless called
29+
30+
error: unused implementer of `std::ops::FnMut` that must be used
31+
--> $DIR/must_use-in-stdlib-traits.rs:45:4
32+
|
33+
LL | square_fn_mut();
34+
| ^^^^^^^^^^^^^^^^
35+
|
36+
= note: closures are lazy and do nothing unless called
37+
38+
error: unused implementer of `std::ops::Fn` that must be used
39+
--> $DIR/must_use-in-stdlib-traits.rs:46:4
40+
|
41+
LL | square_fn();
42+
| ^^^^^^^^^^^^
43+
|
44+
= note: closures are lazy and do nothing unless called
45+
46+
error: aborting due to 5 previous errors
47+

0 commit comments

Comments
 (0)