Skip to content

Exporting a function as main does not work as expected #27640

Description

@tbu-
mod foo {
    pub fn bar() {
    }
}
pub use foo::bar as main;

does not compile due to

error: main function not found
aborting due to previous error

The expected behaviour would be that the compiler treats the global symbol main which resolves to foo::bar as the main function.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions