问题
I feel like binary portability isn't really a concern, and so something like -march=native may always be the default behavior. I can't find anything saying one way or the other though.
回答1:
As mentioned in the comments, pass the -C target-cpu
option to rustc:
rustc -C target-cpu=native
For more options:
$ rustc -C help
...
-C target-cpu=val -- select target processor (rustc --print target-cpus for details)
...
See How to pass rustc flags to cargo? for more methods of passing the option.
I feel like binary portability isn't really a concern
I'm pretty sure that the Firefox developers that rely on Rust would disagree with you, as well as plenty of others.
来源:https://stackoverflow.com/questions/46780074/does-rustc-cargo-have-a-march-native-equivalent