@@ -696,10 +696,8 @@ fn prepare_rustc(build_runner: &BuildRunner<'_, '_>, unit: &Unit) -> CargoResult
696
696
base. inherit_jobserver ( & build_runner. jobserver ) ;
697
697
build_deps_args ( & mut base, build_runner, unit) ?;
698
698
add_cap_lints ( build_runner. bcx , unit, & mut base) ;
699
- if cargo_rustc_higher_args_precedence ( build_runner) {
700
- if let Some ( args) = build_runner. bcx . extra_args_for ( unit) {
701
- base. args ( args) ;
702
- }
699
+ if let Some ( args) = build_runner. bcx . extra_args_for ( unit) {
700
+ base. args ( args) ;
703
701
}
704
702
base. args ( & unit. rustflags ) ;
705
703
if build_runner. bcx . gctx . cli_unstable ( ) . binary_dep_depinfo {
@@ -754,12 +752,6 @@ fn prepare_rustdoc(build_runner: &BuildRunner<'_, '_>, unit: &Unit) -> CargoResu
754
752
755
753
rustdoc. args ( unit. pkg . manifest ( ) . lint_rustflags ( ) ) ;
756
754
757
- if !cargo_rustc_higher_args_precedence ( build_runner) {
758
- if let Some ( args) = build_runner. bcx . extra_args_for ( unit) {
759
- rustdoc. args ( args) ;
760
- }
761
- }
762
-
763
755
let metadata = build_runner. metadata_for_doc_units [ unit] ;
764
756
rustdoc
765
757
. arg ( "-C" )
@@ -800,10 +792,8 @@ fn prepare_rustdoc(build_runner: &BuildRunner<'_, '_>, unit: &Unit) -> CargoResu
800
792
801
793
rustdoc:: add_output_format ( build_runner, unit, & mut rustdoc) ?;
802
794
803
- if cargo_rustc_higher_args_precedence ( build_runner) {
804
- if let Some ( args) = build_runner. bcx . extra_args_for ( unit) {
805
- rustdoc. args ( args) ;
806
- }
795
+ if let Some ( args) = build_runner. bcx . extra_args_for ( unit) {
796
+ rustdoc. args ( args) ;
807
797
}
808
798
rustdoc. args ( & unit. rustdocflags ) ;
809
799
@@ -1107,11 +1097,6 @@ fn build_base_args(
1107
1097
1108
1098
cmd. args ( unit. pkg . manifest ( ) . lint_rustflags ( ) ) ;
1109
1099
cmd. args ( & profile_rustflags) ;
1110
- if !cargo_rustc_higher_args_precedence ( build_runner) {
1111
- if let Some ( args) = build_runner. bcx . extra_args_for ( unit) {
1112
- cmd. args ( args) ;
1113
- }
1114
- }
1115
1100
1116
1101
// `-C overflow-checks` is implied by the setting of `-C debug-assertions`,
1117
1102
// so we only need to provide `-C overflow-checks` if it differs from
@@ -2001,19 +1986,3 @@ fn scrape_output_path(build_runner: &BuildRunner<'_, '_>, unit: &Unit) -> CargoR
2001
1986
. outputs ( unit)
2002
1987
. map ( |outputs| outputs[ 0 ] . path . clone ( ) )
2003
1988
}
2004
-
2005
- /// Provides a way to change the precedence of `cargo rustc -- <flags>`.
2006
- ///
2007
- /// This is intended to be a short-live function.
2008
- ///
2009
- /// See <https://github.com/rust-lang/cargo/issues/14346>
2010
- fn cargo_rustc_higher_args_precedence ( build_runner : & BuildRunner < ' _ , ' _ > ) -> bool {
2011
- build_runner. bcx . gctx . nightly_features_allowed
2012
- && build_runner
2013
- . bcx
2014
- . gctx
2015
- . get_env ( "__CARGO_RUSTC_ORIG_ARGS_PRIO" )
2016
- . ok ( )
2017
- . as_deref ( )
2018
- != Some ( "1" )
2019
- }
0 commit comments