rust: switch head branch

Closes #20492.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
Freeze optimization flags hash rather than duping it
Use Hardware::CPU module
ENV: clean up set_cpu_flags and set_cpu_cflags usage
Make flag lists into constants
Rename single-letter variable
Use has_key? rather than accessing the value
Simplify nested conditional
Delete rather than assign nil
Assign this inline
Remove outdated comment
Use ||= instead of unless
Favor compound if over compound unless