Skip to content

Nested main causes build error #511

@joshlf

Description

@joshlf

The following code snippets seem to cause the playground to interpret the file as a binary (including changing the "build" button to say "run"), but then rustc can't find a crate-level main function, and so fails compilation:

mod foo {
    fn main() {}
}
fn foo() {
    fn main() {}
}

IMO, only main functions at the crate level should cause this behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementSomething new the playground could dohelp wantedNot immediately going to be prioritized — ask for mentoring instructions!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions