@@ -87,11 +87,19 @@ pub struct FixOptions {
87
87
pub broken_code : bool ,
88
88
}
89
89
90
- pub fn fix ( ws : & Workspace < ' _ > , opts : & mut FixOptions ) -> CargoResult < ( ) > {
91
- check_version_control ( ws. gctx ( ) , opts) ?;
90
+ pub fn fix (
91
+ gctx : & GlobalContext ,
92
+ original_ws : & Workspace < ' _ > ,
93
+ root_manifest : & Path ,
94
+ opts : & mut FixOptions ,
95
+ ) -> CargoResult < ( ) > {
96
+ check_version_control ( gctx, opts) ?;
97
+
92
98
if opts. edition {
93
- check_resolver_change ( ws , opts) ?;
99
+ check_resolver_change ( & original_ws , opts) ?;
94
100
}
101
+ let mut ws = Workspace :: new ( & root_manifest, gctx) ?;
102
+ ws. set_honor_rust_version ( original_ws. honor_rust_version ( ) ) ;
95
103
96
104
// Spin up our lock server, which our subprocesses will use to synchronize fixes.
97
105
let lock_server = LockServer :: new ( ) ?;
@@ -128,7 +136,7 @@ pub fn fix(ws: &Workspace<'_>, opts: &mut FixOptions) -> CargoResult<()> {
128
136
server. configure ( & mut wrapper) ;
129
137
}
130
138
131
- let rustc = ws. gctx ( ) . load_global_rustc ( Some ( ws) ) ?;
139
+ let rustc = ws. gctx ( ) . load_global_rustc ( Some ( & ws) ) ?;
132
140
wrapper. arg ( & rustc. path ) ;
133
141
// This is calling rustc in cargo fix-proxy-mode, so it also need to retry.
134
142
// The argfile handling are located at `FixArgs::from_args`.
@@ -138,7 +146,7 @@ pub fn fix(ws: &Workspace<'_>, opts: &mut FixOptions) -> CargoResult<()> {
138
146
// repeating build until there are no more changes to be applied
139
147
opts. compile_opts . build_config . primary_unit_rustc = Some ( wrapper) ;
140
148
141
- ops:: compile ( ws, & opts. compile_opts ) ?;
149
+ ops:: compile ( & ws, & opts. compile_opts ) ?;
142
150
Ok ( ( ) )
143
151
}
144
152
0 commit comments