]> git.lizzy.rs Git - rust.git/commit - src/tools/rustfmt
Auto merge of #49488 - alexcrichton:small-wasm-panic, r=sfackler
authorbors <bors@rust-lang.org>
Mon, 16 Apr 2018 23:19:41 +0000 (23:19 +0000)
committerbors <bors@rust-lang.org>
Mon, 16 Apr 2018 23:19:41 +0000 (23:19 +0000)
commit3809bbf47c8557bd149b3e52ceb47434ca8378d5
treecb1af67dda415a8c9c9b31ea64100725dafa3221
parent4a3ab8b234cd848b673b64758e4d94bc690f98e0
parent46d16b66e0b017430eb50b247926ea447c60ef07
Auto merge of #49488 - alexcrichton:small-wasm-panic, r=sfackler

std: Minimize size of panicking on wasm

This commit applies a few code size optimizations for the wasm target to
the standard library, namely around panics. We notably know that in most
configurations it's impossible for us to print anything in
wasm32-unknown-unknown so we can skip larger portions of panicking that
are otherwise simply informative. This allows us to get quite a nice
size reduction.

Finally we can also tweak where the allocation happens for the
`Box<Any>` that we panic with. By only allocating once unwinding starts
we can reduce the size of a panicking wasm module from 44k to 350 bytes.
src/liballoc/raw_vec.rs