cargo doc: Generate metadata instead of compiling dependencies
authorMatt Brubeck <mbrubeck@limpet.net>
Wed, 24 Jan 2018 20:37:19 +0000 (12:37 -0800)
committerMatt Brubeck <mbrubeck@limpet.net>
Mon, 5 Feb 2018 18:46:20 +0000 (10:46 -0800)
src/cargo/ops/cargo_rustc/context.rs

index f9c0cec873d7d94d2f54b65825ca4464fe5be47d..da22f57ed951fee6bf265d5110a1f656ca94e645 100644 (file)
@@ -940,7 +940,7 @@ impl<'a, 'cfg> Context<'a, 'cfg> {
             ret.push(Unit {
                 pkg: dep,
                 target: lib,
-                profile: self.lib_profile(),
+                profile: self.lib_or_check_profile(unit, lib),
                 kind: unit.kind.for_target(lib),
             });
             if self.build_config.doc_all {
@@ -1057,6 +1057,9 @@ impl<'a, 'cfg> Context<'a, 'cfg> {
     pub fn lib_or_check_profile(&self, unit: &Unit, target: &Target) -> &'a Profile {
         if unit.profile.check && !target.is_custom_build() && !target.for_host() {
             &self.profiles.check
+        } else if unit.profile.doc && !unit.profile.test &&
+                !target.is_custom_build() && !target.for_host() {
+            &self.profiles.check
         } else {
             self.lib_profile()
         }