You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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