diff --git a/src/tools/tidy/src/issues.txt b/src/tools/tidy/src/issues.txt index 849dcb9e88fb1..acabfe96f2ea7 100644 --- a/src/tools/tidy/src/issues.txt +++ b/src/tools/tidy/src/issues.txt @@ -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 diff --git a/tests/ui/README.md b/tests/ui/README.md index 3b28ef694dd30..6cec5a27d21ce 100644 --- a/tests/ui/README.md +++ b/tests/ui/README.md @@ -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 {}`. diff --git a/tests/ui/fn-main/wrong-location.rs b/tests/ui/entry-point/main-in-submodule.rs similarity index 100% rename from tests/ui/fn-main/wrong-location.rs rename to tests/ui/entry-point/main-in-submodule.rs diff --git a/tests/ui/fn-main/wrong-location.stderr b/tests/ui/entry-point/main-in-submodule.stderr similarity index 71% rename from tests/ui/fn-main/wrong-location.stderr rename to tests/ui/entry-point/main-in-submodule.stderr index c47092bc47e92..60265909c7aec 100644 --- a/tests/ui/fn-main/wrong-location.stderr +++ b/tests/ui/entry-point/main-in-submodule.stderr @@ -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() { } | ^^^^^^^^^ diff --git a/tests/ui/issues/issue-50714.rs b/tests/ui/entry-point/main-where-fn-bound.rs similarity index 100% rename from tests/ui/issues/issue-50714.rs rename to tests/ui/entry-point/main-where-fn-bound.rs diff --git a/tests/ui/issues/issue-50714.stderr b/tests/ui/entry-point/main-where-fn-bound.stderr similarity index 88% rename from tests/ui/issues/issue-50714.stderr rename to tests/ui/entry-point/main-where-fn-bound.stderr index 57f9769d1dd56..ba814876e6281 100644 --- a/tests/ui/issues/issue-50714.stderr +++ b/tests/ui/entry-point/main-where-fn-bound.stderr @@ -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 diff --git a/tests/ui/entry-point/issue-118772.rs b/tests/ui/entry-point/main-with-invalid-signature.rs similarity index 55% rename from tests/ui/entry-point/issue-118772.rs rename to tests/ui/entry-point/main-with-invalid-signature.rs index 1a4173e1252d7..782da32756cc8 100644 --- a/tests/ui/entry-point/issue-118772.rs +++ b/tests/ui/entry-point/main-with-invalid-signature.rs @@ -1,3 +1,5 @@ +//! Regression test for + fn main(_: &i32) { //~ ERROR `main` function has wrong type println!("Hello, world!"); } diff --git a/tests/ui/entry-point/issue-118772.stderr b/tests/ui/entry-point/main-with-invalid-signature.stderr similarity index 88% rename from tests/ui/entry-point/issue-118772.stderr rename to tests/ui/entry-point/main-with-invalid-signature.stderr index cc33427f59d04..95b6bff179a94 100644 --- a/tests/ui/entry-point/issue-118772.stderr +++ b/tests/ui/entry-point/main-with-invalid-signature.stderr @@ -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 diff --git a/tests/ui/entry-point/main-with-lifetime-param.rs b/tests/ui/entry-point/main-with-lifetime-param.rs new file mode 100644 index 0000000000000..cb8cba12a58f2 --- /dev/null +++ b/tests/ui/entry-point/main-with-lifetime-param.rs @@ -0,0 +1,4 @@ +//! Regression test for + +fn main<'a>() {} +//~^ ERROR `main` function is not allowed to have generic parameters [E0131] diff --git a/tests/ui/issues/issue-51022.stderr b/tests/ui/entry-point/main-with-lifetime-param.stderr similarity index 78% rename from tests/ui/issues/issue-51022.stderr rename to tests/ui/entry-point/main-with-lifetime-param.stderr index c02c0ac93fa07..fc1dff0b22b49 100644 --- a/tests/ui/issues/issue-51022.stderr +++ b/tests/ui/entry-point/main-with-lifetime-param.stderr @@ -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 diff --git a/tests/ui/fn-main/wrong-type.rs b/tests/ui/fn-main/wrong-type.rs deleted file mode 100644 index 31deba72af4b3..0000000000000 --- a/tests/ui/fn-main/wrong-type.rs +++ /dev/null @@ -1,8 +0,0 @@ -struct S { - x: isize, - y: isize, -} - -fn main(foo: S) { -//~^ ERROR: `main` function has wrong type [E0580] -} diff --git a/tests/ui/fn-main/wrong-type.stderr b/tests/ui/fn-main/wrong-type.stderr deleted file mode 100644 index 2b0096431dbac..0000000000000 --- a/tests/ui/fn-main/wrong-type.stderr +++ /dev/null @@ -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`. diff --git a/tests/ui/issues/issue-50688.rs b/tests/ui/issues/issue-50688.rs deleted file mode 100644 index 88f898b86f914..0000000000000 --- a/tests/ui/issues/issue-50688.rs +++ /dev/null @@ -1,3 +0,0 @@ -fn main() { - [1; || {}]; //~ ERROR mismatched types -} diff --git a/tests/ui/issues/issue-51022.rs b/tests/ui/issues/issue-51022.rs deleted file mode 100644 index cebdfe00c1b9d..0000000000000 --- a/tests/ui/issues/issue-51022.rs +++ /dev/null @@ -1,2 +0,0 @@ -fn main<'a>() { } - //~^ ERROR `main` function is not allowed to have generic parameters [E0131] diff --git a/tests/ui/mismatched_types/array-len-is-closure.rs b/tests/ui/mismatched_types/array-len-is-closure.rs new file mode 100644 index 0000000000000..824b604ced10e --- /dev/null +++ b/tests/ui/mismatched_types/array-len-is-closure.rs @@ -0,0 +1,5 @@ +//! Regression test for + +fn main() { + [1; || {}]; //~ ERROR mismatched types +} diff --git a/tests/ui/issues/issue-50688.stderr b/tests/ui/mismatched_types/array-len-is-closure.stderr similarity index 69% rename from tests/ui/issues/issue-50688.stderr rename to tests/ui/mismatched_types/array-len-is-closure.stderr index 873f179f56d94..db5d801871bc5 100644 --- a/tests/ui/issues/issue-50688.stderr +++ b/tests/ui/mismatched_types/array-len-is-closure.stderr @@ -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