Skip to content

main can be a inner function? #4433

Closed
Closed
@ILyoan

Description

@ILyoan

main function can be a inner function.

for example

fn foo() {
    fn main() {
        io::println("i am the inner main");
        foo();
    }
    io::println("i am a outer function");
}

I wonder if it's intended.
If not, main should be always at the top crate level.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-frontendArea: Compiler frontend (errors, parsing and HIR)E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions