Skip to content

#[tokio::main] allowing arbitrary return values from main #4635

@monoclex

Description

@monoclex

Version

[dependencies]
tokio = { version = "1.17.0", features = ["macros", "rt-multi-thread"] }

Platform

Linux x86_64

Description

The following code compiles playground link

#[tokio::main]
async fn main() {
    return 1;
    ;
}

The following don't compile, as expected

#[tokio::main]
async fn main() {
    return 1;
    ()
}

#[tokio::main]
async fn main() {
    return 1;
}

#[tokio::main]
async fn main() {
    1
}

Metadata

Metadata

Assignees

Labels

A-tokio-macrosArea: The tokio-macros crateC-bugCategory: This is a bug.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions