Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cargo-rustc): give trailing flags higher precedence on nightly #14587

Merged
merged 2 commits into from
Sep 25, 2024

Commits on Sep 25, 2024

  1. Configuration menu
    Copy the full SHA
    7ded268 View commit details
    Browse the repository at this point in the history
  2. fix(cargo-rustc): give trailing flags higher precedence

    Previously `cargo rustc -- <flags>` got a lower precedence than
    some of the flags set by cargo internal.
    This is a bit unintuitive as Cargo generally treats user-provided
    CLI flags with the highest priority.
    
    This commit changes `cargo rustc -- <flags>` to a higher precedence:
    higher than most of flags set by Cargo, and only lower than
    `build.rustflags` family.
    
    Unsure if this affects people's workflow, so this behavior is only
    enabled on nightly for collectin feedback. A environment variable
    `__CARGO_RUSTC_ORIG_ARGS_PRIO=1` is provided for users to opt-out.
    If everything goes well, the nightly gate will be removed after a
    few of releases.
    
    See discussion on https://rust-lang.zulipchat.com/#narrow/stream/246057-t-cargo/topic/rustflags.20precendence.20of.20.60cargo.20rustc.60
    weihanglo committed Sep 25, 2024
    Configuration menu
    Copy the full SHA
    35bb3de View commit details
    Browse the repository at this point in the history