Rollup merge of #149367 - reddevilmidzy:t4, r=Kivooeo
Tidying up UI tests [4/N] > [!NOTE] > Intermediate commits are intended to help review, but will be squashed prior to merge. part of rust-lang/rust#133895 Relocate 4 tests in fn-main and issues and remove fn-main directory r? Kivooeo
This commit is contained in:
commit
01512aa08a
16 changed files with 21 additions and 40 deletions
|
|
@ -930,7 +930,6 @@ ui/dst/issue-90528-unsizing-suggestion-4.rs
|
|||
ui/dyn-keyword/issue-5153.rs
|
||||
ui/dyn-keyword/issue-56327-dyn-trait-in-macro-is-okay.rs
|
||||
ui/empty/issue-37026.rs
|
||||
ui/entry-point/issue-118772.rs
|
||||
ui/enum-discriminant/auxiliary/issue-41394.rs
|
||||
ui/enum-discriminant/issue-104519.rs
|
||||
ui/enum-discriminant/issue-41394-rpass.rs
|
||||
|
|
|
|||
|
|
@ -585,10 +585,6 @@ Exercises the `format!` macro.
|
|||
|
||||
A broad category of tests on functions.
|
||||
|
||||
## `tests/ui/fn-main/`
|
||||
|
||||
**FIXME**: Serves a duplicate purpose with `ui/entry-point`, should be combined.
|
||||
|
||||
## `tests/ui/for/`: `for` keyword
|
||||
|
||||
Tests on the `for` keyword and some of its associated errors, such as attempting to write the faulty pattern `for _ in 0..1 {} else {}`.
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
error[E0601]: `main` function not found in crate `wrong_location`
|
||||
--> $DIR/wrong-location.rs:5:2
|
||||
error[E0601]: `main` function not found in crate `main_in_submodule`
|
||||
--> $DIR/main-in-submodule.rs:5:2
|
||||
|
|
||||
LL | }
|
||||
| ^ the main function must be defined at the crate level (in `$DIR/wrong-location.rs`)
|
||||
| ^ the main function must be defined at the crate level (in `$DIR/main-in-submodule.rs`)
|
||||
|
|
||||
note: here is a function named `main`
|
||||
--> $DIR/wrong-location.rs:4:5
|
||||
--> $DIR/main-in-submodule.rs:4:5
|
||||
|
|
||||
LL | fn main() { }
|
||||
| ^^^^^^^^^
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
error[E0646]: `main` function is not allowed to have a `where` clause
|
||||
--> $DIR/issue-50714.rs:3:11
|
||||
--> $DIR/main-where-fn-bound.rs:3:11
|
||||
|
|
||||
LL | fn main() where fn(&()): Eq {}
|
||||
| ^^^^^^^^^^^^^^^^^ `main` cannot have a `where` clause
|
||||
|
|
@ -1,3 +1,5 @@
|
|||
//! Regression test for <https://github.com/rust-lang/rust/issues/118772>
|
||||
|
||||
fn main(_: &i32) { //~ ERROR `main` function has wrong type
|
||||
println!("Hello, world!");
|
||||
}
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
error[E0580]: `main` function has wrong type
|
||||
--> $DIR/issue-118772.rs:1:1
|
||||
--> $DIR/main-with-invalid-signature.rs:3:1
|
||||
|
|
||||
LL | fn main(_: &i32) {
|
||||
| ^^^^^^^^^^^^^^^^ incorrect number of function parameters
|
||||
4
tests/ui/entry-point/main-with-lifetime-param.rs
Normal file
4
tests/ui/entry-point/main-with-lifetime-param.rs
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
//! Regression test for <https://github.com/rust-lang/rust/issues/51022>
|
||||
|
||||
fn main<'a>() {}
|
||||
//~^ ERROR `main` function is not allowed to have generic parameters [E0131]
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
error[E0131]: `main` function is not allowed to have generic parameters
|
||||
--> $DIR/issue-51022.rs:1:8
|
||||
--> $DIR/main-with-lifetime-param.rs:3:8
|
||||
|
|
||||
LL | fn main<'a>() { }
|
||||
LL | fn main<'a>() {}
|
||||
| ^^^^ `main` cannot have generic parameters
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
struct S {
|
||||
x: isize,
|
||||
y: isize,
|
||||
}
|
||||
|
||||
fn main(foo: S) {
|
||||
//~^ ERROR: `main` function has wrong type [E0580]
|
||||
}
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
error[E0580]: `main` function has wrong type
|
||||
--> $DIR/wrong-type.rs:6:1
|
||||
|
|
||||
LL | fn main(foo: S) {
|
||||
| ^^^^^^^^^^^^^^^ incorrect number of function parameters
|
||||
|
|
||||
= note: expected signature `fn()`
|
||||
found signature `fn(S)`
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0580`.
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
fn main() {
|
||||
[1; || {}]; //~ ERROR mismatched types
|
||||
}
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
fn main<'a>() { }
|
||||
//~^ ERROR `main` function is not allowed to have generic parameters [E0131]
|
||||
5
tests/ui/mismatched_types/array-len-is-closure.rs
Normal file
5
tests/ui/mismatched_types/array-len-is-closure.rs
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
//! Regression test for <https://github.com/rust-lang/rust/issues/50688>
|
||||
|
||||
fn main() {
|
||||
[1; || {}]; //~ ERROR mismatched types
|
||||
}
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-50688.rs:2:9
|
||||
--> $DIR/array-len-is-closure.rs:4:9
|
||||
|
|
||||
LL | [1; || {}];
|
||||
| ^^^^^ expected `usize`, found closure
|
||||
|
|
||||
= note: expected type `usize`
|
||||
found closure `{closure@$DIR/issue-50688.rs:2:9: 2:11}`
|
||||
found closure `{closure@$DIR/array-len-is-closure.rs:4:9: 4:11}`
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue