Skip to content

Commit 17a76b8

Browse files
committed
cargo doc: Generate metadata instead of compiling dependencies
1 parent df089f4 commit 17a76b8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/cargo/ops/cargo_rustc/context.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -940,7 +940,7 @@ impl<'a, 'cfg> Context<'a, 'cfg> {
940940
ret.push(Unit {
941941
pkg: dep,
942942
target: lib,
943-
profile: self.lib_profile(),
943+
profile: self.lib_or_check_profile(unit, lib),
944944
kind: unit.kind.for_target(lib),
945945
});
946946
if self.build_config.doc_all {
@@ -1057,6 +1057,9 @@ impl<'a, 'cfg> Context<'a, 'cfg> {
10571057
pub fn lib_or_check_profile(&self, unit: &Unit, target: &Target) -> &'a Profile {
10581058
if unit.profile.check && !target.is_custom_build() && !target.for_host() {
10591059
&self.profiles.check
1060+
} else if unit.profile.doc && !unit.profile.test &&
1061+
!target.is_custom_build() && !target.for_host() {
1062+
&self.profiles.check
10601063
} else {
10611064
self.lib_profile()
10621065
}

0 commit comments

Comments
 (0)