Relocate some tests and remove fn-main directory

Relocate issues/issue-51022.rs to
entry-point/main-with-lifetime-param.rs

Relocate issue-50714.rs to entry-point/main-where-fn-bound.rs

Rename issue-118772.rs to main-with-invalid-signature.rs and delete
duplicate test

remove ui/entry-point/issue-118772.rs in issues.txt

Relocate fn-main/wrong-location.rs to entry-point/main-in-submodule.rs

Remove fn-main directory

Relocate issue-50688.rs to mismatched_types/array-len-is-closure.rs
This commit is contained in:
reddevilmidzy 2025-11-27 01:10:26 +09:00
parent 6840234806
commit a5dc701e74
16 changed files with 21 additions and 40 deletions

View file

@ -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

View file

@ -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 {}`.

View file

@ -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() { }
| ^^^^^^^^^

View file

@ -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

View file

@ -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!");
}

View file

@ -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

View 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]

View file

@ -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

View file

@ -1,8 +0,0 @@
struct S {
x: isize,
y: isize,
}
fn main(foo: S) {
//~^ ERROR: `main` function has wrong type [E0580]
}

View file

@ -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`.

View file

@ -1,3 +0,0 @@
fn main() {
[1; || {}]; //~ ERROR mismatched types
}

View file

@ -1,2 +0,0 @@
fn main<'a>() { }
//~^ ERROR `main` function is not allowed to have generic parameters [E0131]

View file

@ -0,0 +1,5 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/50688>
fn main() {
[1; || {}]; //~ ERROR mismatched types
}

View file

@ -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