@@ -52,7 +52,7 @@ use rustfix::diagnostics::Diagnostic;
5252use rustfix:: { self , CodeFix } ;
5353use semver:: Version ;
5454
55- use crate :: core:: compiler:: { CompileKind , RustcTargetData , TargetInfo } ;
55+ use crate :: core:: compiler:: RustcTargetData ;
5656use crate :: core:: resolver:: features:: { DiffMap , FeatureOpts , FeatureResolver } ;
5757use crate :: core:: resolver:: { HasDevUnits , Resolve , ResolveBehavior } ;
5858use crate :: core:: { Edition , MaybePackage , PackageId , Workspace } ;
@@ -68,7 +68,6 @@ const FIX_ENV: &str = "__CARGO_FIX_PLZ";
6868const BROKEN_CODE_ENV : & str = "__CARGO_FIX_BROKEN_CODE" ;
6969const EDITION_ENV : & str = "__CARGO_FIX_EDITION" ;
7070const IDIOMS_ENV : & str = "__CARGO_FIX_IDIOMS" ;
71- const SUPPORTS_FORCE_WARN : & str = "__CARGO_SUPPORTS_FORCE_WARN" ;
7271
7372pub struct FixOptions {
7473 pub edition : bool ,
@@ -124,17 +123,6 @@ pub fn fix(ws: &Workspace<'_>, opts: &mut FixOptions) -> CargoResult<()> {
124123 let rustc = ws. config ( ) . load_global_rustc ( Some ( ws) ) ?;
125124 wrapper. arg ( & rustc. path ) ;
126125
127- // Remove this once 1.56 is stabilized.
128- let target_info = TargetInfo :: new (
129- ws. config ( ) ,
130- & opts. compile_opts . build_config . requested_kinds ,
131- & rustc,
132- CompileKind :: Host ,
133- ) ?;
134- if target_info. supports_force_warn {
135- wrapper. env ( SUPPORTS_FORCE_WARN , "1" ) ;
136- }
137-
138126 // primary crates are compiled using a cargo subprocess to do extra work of applying fixes and
139127 // repeating build until there are no more changes to be applied
140128 opts. compile_opts . build_config . primary_unit_rustc = Some ( wrapper) ;
@@ -849,7 +837,7 @@ impl FixArgs {
849837 fn apply ( & self , cmd : & mut Command ) {
850838 cmd. arg ( & self . file ) ;
851839 cmd. args ( & self . other ) ;
852- if self . prepare_for_edition . is_some ( ) && env :: var_os ( SUPPORTS_FORCE_WARN ) . is_some ( ) {
840+ if self . prepare_for_edition . is_some ( ) {
853841 // When migrating an edition, we don't want to fix other lints as
854842 // they can sometimes add suggestions that fail to apply, causing
855843 // the entire migration to fail. But those lints aren't needed to
@@ -868,12 +856,8 @@ impl FixArgs {
868856
869857 if let Some ( edition) = self . prepare_for_edition {
870858 if edition. supports_compat_lint ( ) {
871- if env:: var_os ( SUPPORTS_FORCE_WARN ) . is_some ( ) {
872- cmd. arg ( "--force-warn" )
873- . arg ( format ! ( "rust-{}-compatibility" , edition) ) ;
874- } else {
875- cmd. arg ( "-W" ) . arg ( format ! ( "rust-{}-compatibility" , edition) ) ;
876- }
859+ cmd. arg ( "--force-warn" )
860+ . arg ( format ! ( "rust-{}-compatibility" , edition) ) ;
877861 }
878862 }
879863 }
0 commit comments