Skip to content
GitLab
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Changes
Page history
Update Rust
authored
Sep 29, 2023
by
Miki, Hiromitsu
Show whitespace changes
Inline
Side-by-side
Rust.md
View page @
ff345185
...
...
@@ -6,8 +6,15 @@
以下手順で Rust の GNU 版をインストールする
1.
Rust の
[
Standalone installers
](
https://forge.rust-lang.org/infra/other-installation-methods.html#standalone-installers
)
から「x86_64-pc-windows-gnu」を選択してダウンロードする
2.
インストーラーを実行してインストールする
1.
「
[
Rust をインストール
](
https://www.rust-lang.org/ja/tools/install
)
」のページから「RUSTUP-INIT.exe(64-BIT)」を選択してダウンロードする
2.
ダウンロードした「rustup-init.exe」を実行する
3.
「3」(Don't install the prerequisites) を入力する
4.
「2」(Customize installation) を入力する
5.
Default host triple に「x86_64-pc-windows-gnu」を入力する
6.
Default toolchain に「stable」を入力する (デフォルトのため、何も入力せず Enter を押すだけでよい)
7.
Profile に「default」を入力する (デフォルトのため、何も入力せず Enter を押すだけでよい)
8.
Modify PATH variable に「Y」を入力する (デフォルトのため、何も入力せず Enter を押すだけでよい)
9.
「1」(Proceed with installation) を入力する (デフォルトのため、何も入力せず Enter を押すだけでよい)
## Visual Studio Code
...
...
@@ -39,14 +46,14 @@ https://github.com/rust-lang/rfcs/blob/master/text/0430-finalizing-naming-conven
リリースビルドをしたい場合、ルートフォルダでコマンド
`cargo build --release`
を実行する。
尚、以下の設定を Cargo.toml に記載することで、リリースビルド時に stip が有効になり、ファイルサイズを大幅に減らすことができる。(Hello World の例: 5.19 MB -> 1.01 MB)
尚、以下の設定を Cargo.toml に記載することで、リリースビルド時に stip が有効になり、ファイルサイズを大幅に減らすことができる。(Hello World の例: 5.19 MB -
\
>
1.01 MB)
```
toml
[
profile
.
release
]
strip
=
true
```
更に、以下の設定を Cargo.toml に記載することで、リリースビルド時に LTO (Link Time Optimization) が有効になり、ファイルサイズを減らすことができる。(Hello World の例: 1.01 MB -> 0.27 KB)
更に、以下の設定を Cargo.toml に記載することで、リリースビルド時に LTO (Link Time Optimization) が有効になり、ファイルサイズを減らすことができる。(Hello World の例: 1.01 MB -
\
>
0.27 KB)
```
toml
[
profile
.
release
]
...
...
...
...