Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/tools/tidy/src/issues.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions tests/ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}`.
Expand Down
Original file line number Diff line number Diff line change
@@ -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() { }
| ^^^^^^^^^
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo in filename "signiture"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh I missed! thanks

Original file line number Diff line number Diff line change
@@ -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!");
}
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 4 additions & 0 deletions tests/ui/entry-point/main-with-lifetime-param.rs
Original file line number Diff line number Diff line change
@@ -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]
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 0 additions & 8 deletions tests/ui/fn-main/wrong-type.rs
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I deleted it because I thought it was the same as entry-point/main-with-invalid-signiture.rs. What are your thoughts on this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I agree with this

This file was deleted.

12 changes: 0 additions & 12 deletions tests/ui/fn-main/wrong-type.stderr

This file was deleted.

3 changes: 0 additions & 3 deletions tests/ui/issues/issue-50688.rs

This file was deleted.

2 changes: 0 additions & 2 deletions tests/ui/issues/issue-51022.rs

This file was deleted.

5 changes: 5 additions & 0 deletions tests/ui/mismatched_types/array-len-is-closure.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/50688>
fn main() {
[1; || {}]; //~ ERROR mismatched types
}
Original file line number Diff line number Diff line change
@@ -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

Expand Down
Loading