Hello Worldしただけの記事です🙇
インストール
公式にある通り、↓を実行してインストール
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
途中、↓と聞かれたのでとりあえずスタンダードインストールを選択。
1) Proceed with standard installation (default - just press enter) 2) Customize installation 3) Cancel installation
インストールが完了したら、一旦シェルを閉じて再度開き直す。
% rustc --version rustc 1.78.0 (9b00956e5 2024-04-29)
インストールされてますね!
実行
main.rs
というファイルを作成します。
fn main() { println!("Hello, World!"); }
コンパイル、実行します。
rustc main.rs ./main Hello, World!
ちゃんと実行されてますね。