Hacker News new | ask | show | jobs
by omaranto 4127 days ago
That's probably because there is no --release flag:

    $ rustc --release prog.rs
    error: Unrecognized option: 'release'.
There is a -O for optimization, it is equivalent to -C opt-level=2.

EDIT: Oh, cargo build does have a --release which seems to be equivalent to -C opt-level=3, which I guess is even better.

1 comments

`cargo build --release` does more than just `-C opt-level=3`, actually. For example a regular `cargo build` also adds `-g`, and that's removed for `--release`.