You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Better account for invalid async fn main() {} #78905
error[E0277]: `main` has invalid return type `impl Future`
--> src/main.rs:1:17
|
1 | async fn main() {
| ^ `main` can only return types that implement `Termination`
|
= help: consider using `()`, or a `Result`
error[E0752]: `main` function is not allowed to be `async`
--> src/main.rs:1:1
|
1 | async fn main() {
| ^^^^^^^^^^^^^^^ `main` function is not allowed to be `async`
The two errors (E0277 and E0752) should be only a single error.
error[E0752]: `main` function is not allowed to be `async`
--> projects/rust/test.rs:5:1
|
5 | async fn main() {
| ^^^^^^^^^^^^^^^ `main` function is not allowed to be `async`
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0752`.
Activity
veera-sivarajan commentedon Jul 26, 2024
Output on
rustc 1.80.0:Enselic commentedon Mar 26, 2026
Triage: Since the expected behavior is now in place, we can close this issue now, right?
Enselic commentedon Jul 16, 2026
Triage: Looks like we don't have a test for this, so we just need to add a test.
konard commentedon Jul 21, 2026
@rustbot claim
Rollup merge of rust-lang#162616 - malezjaa:add-async-main-regression…
Unrolled build for #162616 in rollup 162622