I know I can do this on the command line using
$ RUSTFLAGS='-C target-cpu=native' cargo bench
or whatever, but then I have to remember to do this every time. I also know that I can do this on a given account on a given computer by editing
~/.cargo/config to contain
[target.x86_64-unknown-linux-gnu] rustflags = ["-Ctarget-cpu=native"]
but then another account won't be using this option, or another computer (e.g. belonging to one of my students). I'd love to hear if there is a relatively fool-proof way to ensure that my code will always be run with native instructions (which not infrequently gives a 10% speed boost).