Open
Description
After entering the following code:
use std; fn main(){ println!("Hello, world!"); }
and clicking the "Build" button, I get the following message:
No main function was detected, so your code was compiled
but not run. If you’d like to execute your code, please
add a main function.
No code in the main function is run.
After a bit more testing, I've found that if the main
function's signature is not on its own line, the playground fails to detect the function:
// Also doesn't detect main
const foo: i32 = 10; fn main(){}
// Also doesn't detect main
use std; fn main(){
}
// Does detect main
use std;
fn main() {}