forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#62177 - Centril:move-some-compile-fail-test…
…s, r=petrochenkov Move some tests in src/test/compile-fail -> src/test/ui This is a subset of rust-lang#62113. Hopefully everything here sticks, but if it doesn't I'll remove tests until it does. r? @petrochenkov
- Loading branch information
Showing
75 changed files
with
453 additions
and
66 deletions.
There are no files selected for viewing
15 changes: 0 additions & 15 deletions
15
src/test/compile-fail/auxiliary/panic-runtime-lang-items.rs
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
6 changes: 0 additions & 6 deletions
6
src/test/compile-fail/auxiliary/wants-panic-runtime-unwind.rs
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
error: <inline asm>:1:2: error: invalid instruction mnemonic 'nowayisthisavalidinstruction' | ||
nowayisthisavalidinstruction | ||
^~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
--> $DIR/asm-src-loc.rs:7:9 | ||
| | ||
LL | asm!("nowayisthisavalidinstruction"); | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to previous error | ||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
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 | ||
--> $DIR/issue-23595-1.rs:8:54 | ||
| | ||
LL | type Value; | ||
| ----------- `Value` defined here | ||
LL | type ChildKey; | ||
| -------------- `ChildKey` defined here | ||
LL | type Children = dyn Index<Self::ChildKey, Output=dyn Hierarchy>; | ||
| -------------------------------------------------^^^^^^^^^^^^^-- | ||
| | | | ||
| | associated type `Value` must be specified | ||
| | associated type `ChildKey` must be specified | ||
| | associated type `Children` must be specified | ||
| `Children` defined here | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0191`. |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
error[E0277]: the trait bound `f32: Foo` is not satisfied | ||
--> $DIR/chalk_initial_program.rs:15:5 | ||
| | ||
LL | gimme::<f32>(); | ||
| ^^^^^^^^^^^^ the trait `Foo` is not implemented for `f32` | ||
| | ||
note: required by `gimme` | ||
--> $DIR/chalk_initial_program.rs:9:1 | ||
| | ||
LL | fn gimme<F: Foo>() { } | ||
| ^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0277`. |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
error[E0277]: the trait bound `(std::option::Option<T>, f32): Foo` is not satisfied | ||
--> $DIR/generic_impls.rs:12:5 | ||
| | ||
LL | gimme::<(Option<T>, f32)>(); | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `(std::option::Option<T>, f32)` | ||
| | ||
= help: the following implementations were found: | ||
<(T, u32) as Foo> | ||
note: required by `gimme` | ||
--> $DIR/generic_impls.rs:7:1 | ||
| | ||
LL | fn gimme<F: Foo>() { } | ||
| ^^^^^^^^^^^^^^^^^^ | ||
|
||
error[E0277]: the trait bound `(i32, f32): Foo` is not satisfied | ||
--> $DIR/generic_impls.rs:17:5 | ||
| | ||
LL | gimme::<(i32, f32)>(); | ||
| ^^^^^^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `(i32, f32)` | ||
| | ||
= help: the following implementations were found: | ||
<(T, u32) as Foo> | ||
note: required by `gimme` | ||
--> $DIR/generic_impls.rs:7:1 | ||
| | ||
LL | fn gimme<F: Foo>() { } | ||
| ^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0277`. |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
error[E0277]: the trait bound `{float}: Foo` is not satisfied | ||
--> $DIR/type_wf.rs:17:13 | ||
| | ||
LL | let s = S { | ||
| ^ the trait `Foo` is not implemented for `{float}` | ||
| | ||
= help: the following implementations were found: | ||
<i32 as Foo> | ||
<std::option::Option<T> as Foo> | ||
note: required by `S` | ||
--> $DIR/type_wf.rs:5:1 | ||
| | ||
LL | struct S<T: Foo> { | ||
| ^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0277`. |
File renamed without changes.
11 changes: 11 additions & 0 deletions
11
src/test/ui/coercion/coerce-unsafe-closure-to-unsafe-fn-ptr.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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`. |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
error: this expression will panic at runtime | ||
--> $DIR/const-err3.rs:9:13 | ||
| | ||
LL | let b = 200u8 + 200u8 + 200u8; | ||
| ^^^^^^^^^^^^^ attempt to add with overflow | ||
| | ||
note: lint level defined here | ||
--> $DIR/const-err3.rs:2:9 | ||
| | ||
LL | #![deny(const_err)] | ||
| ^^^^^^^^^ | ||
|
||
error: this expression will panic at runtime | ||
--> $DIR/const-err3.rs:11:13 | ||
| | ||
LL | let c = 200u8 * 4; | ||
| ^^^^^^^^^ attempt to multiply with overflow | ||
|
||
error: this expression will panic at runtime | ||
--> $DIR/const-err3.rs:13:13 | ||
| | ||
LL | let d = 42u8 - (42u8 + 1); | ||
| ^^^^^^^^^^^^^^^^^ attempt to subtract with overflow | ||
|
||
error: index out of bounds: the len is 1 but the index is 1 | ||
--> $DIR/const-err3.rs:15:14 | ||
| | ||
LL | let _e = [5u8][1]; | ||
| ^^^^^^^^ | ||
|
||
error: aborting due to 4 previous errors | ||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
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[E0019]: constant function contains unimplemented expression type | ||
--> $DIR/const-fn-error.rs:7:14 | ||
| | ||
LL | for i in 0..x { | ||
| ^^^^ | ||
|
||
error[E0019]: constant function contains unimplemented expression type | ||
--> $DIR/const-fn-error.rs:7:5 | ||
| | ||
LL | / for i in 0..x { | ||
LL | | | ||
LL | | | ||
LL | | | ||
LL | | | ||
LL | | sum += i; | ||
LL | | } | ||
| |_____^ | ||
|
||
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 std::iter::IntoIterator>::into_iter` | ||
|
||
error: aborting due to 4 previous errors | ||
|
||
Some errors have detailed explanations: E0015, E0019, E0080. | ||
For more information about an error, try `rustc --explain E0015`. |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
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 type `&_` | ||
|
||
error[E0308]: mismatched types | ||
--> $DIR/issue-52443.rs:3:17 | ||
| | ||
LL | [(); loop { break }]; | ||
| ^^^^^ expected (), found usize | ||
| | ||
= note: expected type `()` | ||
found type `usize` | ||
|
||
error[E0019]: constant contains unimplemented expression type | ||
--> $DIR/issue-52443.rs:4:11 | ||
| | ||
LL | [(); {while true {break}; 0}]; | ||
| ^^^^^^^^^^^^^^^^^^ | ||
|
||
error[E0015]: calls in constants are limited to constant functions, tuple structs and tuple variants | ||
--> $DIR/issue-52443.rs:5:21 | ||
| | ||
LL | [(); { for _ in 0usize.. {}; 0}]; | ||
| ^^^^^^^^ | ||
|
||
error[E0019]: constant contains unimplemented expression type | ||
--> $DIR/issue-52443.rs:5:21 | ||
| | ||
LL | [(); { for _ in 0usize.. {}; 0}]; | ||
| ^^^^^^^^ | ||
|
||
error[E0019]: constant contains unimplemented expression type | ||
--> $DIR/issue-52443.rs:5:12 | ||
| | ||
LL | [(); { for _ in 0usize.. {}; 0}]; | ||
| ^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error[E0080]: evaluation of constant value failed | ||
--> $DIR/issue-52443.rs:5:21 | ||
| | ||
LL | [(); { for _ in 0usize.. {}; 0}]; | ||
| ^^^^^^^^ calling non-const function `<std::ops::RangeFrom<usize> as std::iter::IntoIterator>::into_iter` | ||
|
||
error: aborting due to 7 previous errors | ||
|
||
Some errors have detailed explanations: E0015, E0019, E0080, E0308. | ||
For more information about an error, try `rustc --explain E0015`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// compile-flags: --extern std= | ||
// error-pattern: can't find crate for `std` | ||
// only-wasm32 | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
error: extern location for std does not exist: | ||
|
||
error[E0463]: can't find crate for `std` | ||
| | ||
= note: the `wasm32-unknown-unknown` target may not be installed | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0463`. |
1 change: 1 addition & 0 deletions
1
src/test/compile-fail/empty-extern-arg.rs → src/test/ui/imports/empty-extern-arg.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
// compile-flags: --extern std= | ||
// error-pattern: can't find crate for `std` | ||
// ignore-wasm32 | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
error: extern location for std does not exist: | ||
|
||
error[E0463]: can't find crate for `std` | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0463`. |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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`. |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
error: linker `llllll` not found | ||
| | ||
= note: No such file or directory (os error 2) | ||
|
||
error: aborting due to previous error | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.