Open
Description
See https://github.com/matklad/repros/tree/6b5121590ed9a758b90bb269d2d3d860a381a21d/lto-vs-rlib for the full reproduction.
The TL;DR is that if I have lto=true
in profile, and crate-type = ["cdylib", "rlib"]
, the lto silently isn't applied. This is confusing -- I would expect to see at least a warning.
Note that wasm+cdylib+rlib combination is advertised in https://rustwasm.github.io/wasm-pack/book/tutorials/npm-browser-packages/template-deep-dive/cargo-toml.html#1-crate-type, and you often do want lto for wasm.
Related issues: