]> git.lizzy.rs Git - rust.git/commit
Auto merge of #55518 - alexcrichton:smaller-wasm, r=sfackler
authorbors <bors@rust-lang.org>
Tue, 6 Nov 2018 04:04:33 +0000 (04:04 +0000)
committerbors <bors@rust-lang.org>
Tue, 6 Nov 2018 04:04:33 +0000 (04:04 +0000)
commit24e66c28980442a48d9458f1a4f9b76cc722dc8a
treec1c32d1146a30ac22231e69f4e5cb67f2f9abe6d
parent8aa926729e68ef03316e81c9309b670a25e37b48
parent0c3d08e9676a7defd16b88307838f7294d28c3e5
Auto merge of #55518 - alexcrichton:smaller-wasm, r=sfackler

std: Improve codegen size of accessing TLS

Some code in the TLS implementation in libstd stores `Some(val)` into an
`&mut Option<T>` (effectively) and then pulls out `&T`, but it currently
uses `.unwrap()` which can codegen into a panic even though it can never
panic. With sufficient optimizations enabled (like LTO) the compiler can
see through this but this commit helps it along in normal mode
(`--release` with Cargo by default) to avoid codegen'ing the panic path.

This ends up improving the optimized codegen on wasm by ensuring that a
call to panic pulling in more file size doesn't stick around.