TIL You can override the entry point for Rust programs #![feature(start)] #![no_std] // Entry point for this program #[start] fn start(_argc: isize, _argv: *const *const u8) -> isize { 0 }
-
Show this thread
-
Replying to @DebugSteven
ok but why Just if you don't like the name "main" or smthing?
3 replies 0 retweets 1 like -
Replying to @jackie_cs_
There might be a more complicated reason behind it. I thought it was interesting because I thought that you had to have a function called main as the entry point to a Rust program, but that's not true. I really like programming trivia like this.
1 reply 0 retweets 2 likes
Replying to @DebugSteven @jackie_cs_
Here’s what happens before you call main in a normal rust program: https://github.com/rust-lang/rust/blob/master/src/libstd/rt.rs … If you don’t want this setup, you use #[start] instead!
0 replies
3 retweets
6 likes
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.