Skip to content

Commit 0792cde

Browse files
committed
Revert change to lift doc units
1 parent dbcabc7 commit 0792cde

File tree

1 file changed

+0
-22
lines changed

1 file changed

+0
-22
lines changed

src/cargo/ops/cargo_compile.rs

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,6 @@ pub fn create_bcx<'a, 'cfg>(
542542
if build_config.mode == (CompileMode::Doc { deps: true }) {
543543
remove_duplicate_doc(build_config, &units, &mut unit_graph);
544544
}
545-
lift_doc_units_to_root(&mut units, &mut unit_graph);
546545

547546
if build_config
548547
.requested_kinds
@@ -1728,27 +1727,6 @@ fn opt_patterns_and_names(
17281727
Ok((opt_patterns, opt_names))
17291728
}
17301729

1731-
/// Removes all CompileMode::Doc units from the unit graph and lifts them to the root set.
1732-
///
1733-
/// This is sound because rustdoc has no actual dependency on the generated files from one
1734-
/// invocation to the next.
1735-
///
1736-
/// This is necessary because for RFC #3123, we need Doc and Check units of the same crate
1737-
/// to have the same metadata hash. This pass ensures that they have the same dependency set.
1738-
/// Also it exposes more parallelism during document generation!
1739-
fn lift_doc_units_to_root(root_units: &mut Vec<Unit>, unit_graph: &mut UnitGraph) {
1740-
for deps in unit_graph.values_mut() {
1741-
deps.retain(|dep| {
1742-
if dep.unit.mode.is_doc() {
1743-
root_units.push(dep.unit.clone());
1744-
false
1745-
} else {
1746-
true
1747-
}
1748-
});
1749-
}
1750-
}
1751-
17521730
/// Removes duplicate CompileMode::Doc units that would cause problems with
17531731
/// filename collisions.
17541732
///

0 commit comments

Comments
 (0)