世界はmain()
から始まるんじゃ無かったんだよ!!
# ![feature(start)]
fn main() {
println!("Hello, world!");
}
# [start]
fn start(_argc: isize, _argv: *const *const u8) -> isize {
println!("Before the world!");
main();
println!("After the world!");
0
}
$ cargo run
Before the world!
Hello, world!
After the world!
な、なんだってー
Q&A
いつ使うのこれ?
OS書くときとかはあると便利だったりするらしいですね
http://ykomatsu.github.io/rust/book-ja/no-stdlib.html
nightlyでしか動かないのでは?
夜中に書いてるから良いんです!
元ネタはC++の話ですよね?lasy_static!
あれば十分じゃないの
せやな(´・ω・`)