#125011 has added a optimize_for_size feature to the standard library, which is designed for special casing some algorithms in core/alloc/std to provide an implementation that tries to minimize its effect on binary size.
To use this feature, the standard library has to be compiled using -Zbuild-std:
$ cargo +nightly build -Z build-std -Z build-std-features="optimize_for_size" ...
Optimizations that leverage this flag:
#125011 has added a
optimize_for_sizefeature to the standard library, which is designed for special casing some algorithms incore/alloc/stdto provide an implementation that tries to minimize its effect on binary size.To use this feature, the standard library has to be compiled using
-Zbuild-std:$ cargo +nightly build -Z build-std -Z build-std-features="optimize_for_size" ...Optimizations that leverage this flag:
optimize_for_size#125609ptr::rotatesmaller when usingoptimize_for_size#125720optimize_for_sizevariants for stable and unstable sort as well as select_nth_unstable #129587