Skip to content

Commit 902cb98

Browse files
committed
Fix Unit/Context parameter order.
1 parent 195520b commit 902cb98

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/cargo/core/compiler/context/unit_dependencies.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ fn compute_deps<'a, 'b, 'cfg>(
132132
if unit.target.is_custom_build() {
133133
return Ok(ret);
134134
}
135-
ret.extend(dep_build_script(cx, unit));
135+
ret.extend(dep_build_script(unit, cx));
136136

137137
// If this target is a binary, test, example, etc, then it depends on
138138
// the library of the same package. The call to `resolve.deps` above
@@ -141,7 +141,7 @@ fn compute_deps<'a, 'b, 'cfg>(
141141
if unit.target.is_lib() && unit.mode != CompileMode::Doctest {
142142
return Ok(ret);
143143
}
144-
ret.extend(maybe_lib(cx, unit, profile_for));
144+
ret.extend(maybe_lib(unit, cx, profile_for));
145145

146146
Ok(ret)
147147
}
@@ -178,7 +178,7 @@ fn compute_deps_custom_build<'a, 'cfg>(
178178
if !unit.target.linkable() || unit.pkg.manifest().links().is_none() {
179179
return None;
180180
}
181-
dep_build_script(cx, unit)
181+
dep_build_script(unit, cx)
182182
})
183183
.chain(Some((
184184
new_unit(
@@ -248,18 +248,18 @@ fn compute_deps_doc<'a, 'cfg>(
248248
}
249249

250250
// Be sure to build/run the build script for documented libraries as
251-
ret.extend(dep_build_script(cx, unit));
251+
ret.extend(dep_build_script(unit, cx));
252252

253253
// If we document a binary, we need the library available
254254
if unit.target.is_bin() {
255-
ret.extend(maybe_lib(cx, unit, ProfileFor::Any));
255+
ret.extend(maybe_lib(unit, cx, ProfileFor::Any));
256256
}
257257
Ok(ret)
258258
}
259259

260260
fn maybe_lib<'a>(
261-
cx: &Context,
262261
unit: &Unit<'a>,
262+
cx: &Context,
263263
profile_for: ProfileFor,
264264
) -> Option<(Unit<'a>, ProfileFor)> {
265265
let mode = check_or_build_mode(&unit.mode, unit.target);
@@ -276,7 +276,7 @@ fn maybe_lib<'a>(
276276
/// script itself doesn't have any dependencies, so even in that case a unit
277277
/// of work is still returned. `None` is only returned if the package has no
278278
/// build script.
279-
fn dep_build_script<'a>(cx: &Context, unit: &Unit<'a>) -> Option<(Unit<'a>, ProfileFor)> {
279+
fn dep_build_script<'a>(unit: &Unit<'a>, cx: &Context) -> Option<(Unit<'a>, ProfileFor)> {
280280
unit.pkg
281281
.targets()
282282
.iter()

0 commit comments

Comments
 (0)