One possibility would be cargo build --lto as a level beyond cargo build --release. Presumably this should only work with binaries/static libraries and so be an error if applied to an rlib.
I think I may actually expect lto = true to be possible in the [profile.release] manifest section as opposed to adding a flag to this.
One may not want to build with LTO for every release since it takes so long, but maybe this isn't the case.
Most helpful comment
I think I may actually expect
lto = trueto be possible in the[profile.release]manifest section as opposed to adding a flag to this.