@@ -220,21 +220,21 @@ optimized for binary size. More information about it can be found in the
220220
221221On macOS, the final stripped binary size is reduced to 51KB.
222222
223- # Remove ` panic ` String Formatting with ` panic_immediate_abort `
223+ # Remove ` panic ` String Formatting with ` panic=immediate-abort `
224224
225225![ Minimum Rust: Nightly] ( https://img.shields.io/badge/Minimum%20Rust%20Version-nightly-orange.svg )
226226
227227Even if ` panic = "abort" ` is specified in ` Cargo.toml ` , ` rustc ` will still include panic strings
228228and formatting code in final binary by default.
229- [ An unstable ` panic_immediate_abort ` feature] ( https://github.com/rust-lang/rust/pull/55011 )
229+ [ An unstable ` panic=immediate-abort ` feature] ( https://github.com/rust-lang/rust/pull/146317 )
230230has been merged into the ` nightly ` ` rustc ` compiler to address this.
231231
232- To use this, repeat the instructions above to use ` build-std ` , but also pass the following
233- [ ` -Z build-std-features=panic_immediate_abort ` ] ( https://doc.rust-lang.org/cargo/reference/unstable .html#build-std-features )
234- option .
232+ To use this, repeat the instructions above to use ` build-std ` , but also pass
233+ [ ` -Zunstable-options -Cpanic=immediate-abort ` ] ( https://doc.rust-lang.org/rustc/command-line-arguments .html?highlight=unstable-options#-z-set-unstable-options )
234+ to ` rustc ` .
235235
236236``` bash
237- $ cargo +nightly build -Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort \
237+ $ RUSTFLAGS= " -Zunstable-options -Cpanic=immediate-abort " cargo +nightly build -Z build-std=std,panic_abort \
238238 --target x86_64-apple-darwin --release
239239```
240240
@@ -252,7 +252,7 @@ we will restrict our usage of `libstd` in order to reduce binary size further.
252252
253253If you want an executable smaller than 20 kilobytes, Rust's string formatting code,
254254[ ` core::fmt ` ] ( https://doc.rust-lang.org/core/fmt/index.html ) must
255- be removed. ` panic_immediate_abort ` only removes some usages of this code. There is a lot of other
255+ be removed. ` panic=immediate-abort ` only removes some usages of this code. There is a lot of other
256256code that uses formatting in some cases. That includes Rust's "pre-main" code in ` libstd ` .
257257
258258By using a C entry point (by adding the ` #![no_main] ` attribute) , managing stdio manually, and
0 commit comments