Skip to content

Commit 830b8af

Browse files
committed
remove unused argument to Context::lib_profile
1 parent 6216179 commit 830b8af

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

src/cargo/ops/cargo_rustc/context.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ impl<'a, 'cfg> Context<'a, 'cfg> {
597597
Ok(Unit {
598598
pkg: pkg,
599599
target: t,
600-
profile: self.lib_profile(id),
600+
profile: self.lib_profile(),
601601
kind: unit.kind.for_target(t),
602602
})
603603
})
@@ -630,7 +630,7 @@ impl<'a, 'cfg> Context<'a, 'cfg> {
630630
Unit {
631631
pkg: unit.pkg,
632632
target: t,
633-
profile: self.lib_profile(id),
633+
profile: self.lib_profile(),
634634
kind: unit.kind.for_target(t),
635635
}
636636
}));
@@ -707,7 +707,7 @@ impl<'a, 'cfg> Context<'a, 'cfg> {
707707
ret.push(Unit {
708708
pkg: dep,
709709
target: lib,
710-
profile: self.lib_profile(dep.package_id()),
710+
profile: self.lib_profile(),
711711
kind: unit.kind.for_target(lib),
712712
});
713713
if self.build_config.doc_all {
@@ -753,7 +753,7 @@ impl<'a, 'cfg> Context<'a, 'cfg> {
753753
Unit {
754754
pkg: unit.pkg,
755755
target: t,
756-
profile: self.lib_profile(unit.pkg.package_id()),
756+
profile: self.lib_profile(),
757757
kind: unit.kind.for_target(t),
758758
}
759759
})
@@ -808,7 +808,7 @@ impl<'a, 'cfg> Context<'a, 'cfg> {
808808
/// Number of jobs specified for this build
809809
pub fn jobs(&self) -> u32 { self.build_config.jobs }
810810

811-
pub fn lib_profile(&self, _pkg: &PackageId) -> &'a Profile {
811+
pub fn lib_profile(&self) -> &'a Profile {
812812
let (normal, test) = if self.build_config.release {
813813
(&self.profiles.release, &self.profiles.bench_deps)
814814
} else {
@@ -821,10 +821,10 @@ impl<'a, 'cfg> Context<'a, 'cfg> {
821821
}
822822
}
823823

824-
pub fn build_script_profile(&self, pkg: &PackageId) -> &'a Profile {
824+
pub fn build_script_profile(&self, _pkg: &PackageId) -> &'a Profile {
825825
// TODO: should build scripts always be built with the same library
826826
// profile? How is this controlled at the CLI layer?
827-
self.lib_profile(pkg)
827+
self.lib_profile()
828828
}
829829

830830
pub fn rustflags_args(&self, unit: &Unit) -> CargoResult<Vec<String>> {

src/cargo/ops/cargo_rustc/custom_build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ fn build_work<'a, 'cfg>(cx: &mut Context<'a, 'cfg>, unit: &Unit<'a>)
9797
// environment variables. Note that the profile-related environment
9898
// variables are not set with this the build script's profile but rather the
9999
// package's library profile.
100-
let profile = cx.lib_profile(unit.pkg.package_id());
100+
let profile = cx.lib_profile();
101101
let to_exec = to_exec.into_os_string();
102102
let mut cmd = cx.compilation.host_process(to_exec, unit.pkg)?;
103103
cmd.env("OUT_DIR", &build_output)

src/cargo/ops/cargo_rustc/job_queue.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,9 +198,7 @@ impl<'a> JobQueue<'a> {
198198
}
199199

200200
let build_type = if self.is_release { "release" } else { "debug" };
201-
let profile = cx.ws.current_opt().map_or_else(Profile::default, |p| {
202-
cx.lib_profile(p.package_id()).to_owned()
203-
});
201+
let profile = cx.lib_profile();
204202
let mut opt_type = String::from(if profile.opt_level == "0" { "unoptimized" }
205203
else { "optimized" });
206204
if profile.debuginfo {

0 commit comments

Comments
 (0)