Open
Description
The paragraph on Rust Playground says:
If there is no main function, then the code is automatically wrapped inside one.
However, my code doesn't compile without it. I've also replicated it in the editor chapter by removing the main
function.
Code:
let number = 5;
print!("{}", number);
Error:
Compiling playground v0.0.1 (/playground)
error: expected item, found keyword `let`
--> src/main.rs:1:1
|
1 | let number = 5;
| ^^^ expected item
error: could not compile `playground` due to previous error