Skip to content

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

Closed

Description

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions