I'd like to compile using different opt flags (0, 1, 2, 3, "s", "z") but I don't see how I can do this via cargo. I've tried cargo rustc but it turns out the -O flag doesn't exist for that.
I tried using custom profiles via the "named-features" cargo nightly feature, but it's causing problems for my rust-analyser and I don't think I can handle without it (it's just too useful).
I wanted to avoid this since I'm trying to mass compile rust binaries at every single optimisation level. Custom profiles allowed me to cover each opt-level as a unique profile.. at the cost of using nightly.
Looks like if I want to achieve what I want I'd have to include a script that edits cargo.toml and changes the opt-level.