main can be a inner function?
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.
I would not mind forcing main to always be a crate-level function.
I think my preference would be that main must be at the root of the crate. I hate when I download some C code and I have to grep around just to find main().
Removing from 0.7.
I-nominated (well-defined)
I think the main discovery logic needs to get its own pass. It's starting to get a bit complicated.
If we do this we'll need extra diagnostics to see if there's a 'main' function defined in the wrong place.
accepted for backwards compat
Closing as #6119 landed