
In #20424, we moved `HOMEBREW_RUSTFLAGS` to the end of the compiler invocation, but didn't update the comment. Let's fix that. While we're here, let's fix these `shellcheck disable`s.
15 lines
476 B
Bash
Executable File
15 lines
476 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# Prepend HOMEBREW_RUSTFLAGS to rustc arguments if set.
|
|
# This allows Homebrew to pass optimization flags while still respecting
|
|
# .cargo/config.toml (which sets RUSTFLAGS).
|
|
|
|
# rustc is passed as the first argument to RUSTC_WRAPPER
|
|
# https://doc.rust-lang.org/cargo/reference/environment-variables.html
|
|
RUSTC="${1}"
|
|
shift
|
|
|
|
# Append HOMEBREW_RUSTFLAGS to the arguments if set.
|
|
read -ra RUSTFLAGS <<<"${HOMEBREW_RUSTFLAGS:-}"
|
|
exec "${RUSTC}" "$@" "${RUSTFLAGS[@]}"
|