Skip to content

Commit 6258c01

Browse files
committed
Reintroduce workaround for rust-lang#62649
1 parent 10b23e3 commit 6258c01

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

src/librustc/dep_graph/graph.rs

+15-8
Original file line numberDiff line numberDiff line change
@@ -654,18 +654,25 @@ impl DepGraph {
654654
continue;
655655
}
656656
} else {
657+
// FIXME: This match is just a workaround for incremental bugs and should
658+
// be removed. https://github.com/rust-lang/rust/issues/62649 is one such
659+
// bug that must be fixed before removing this.
657660
match dep_dep_node.kind {
658-
DepKind::CrateMetadata => {
661+
DepKind::hir_owner
662+
| DepKind::hir_owner_items
663+
| DepKind::CrateMetadata => {
659664
if let Some(def_id) = dep_dep_node.extract_def_id(tcx) {
660665
if def_id_corresponds_to_hir_dep_node(tcx, def_id) {
661-
// The `DefPath` has corresponding node,
662-
// and that node should have been marked
663-
// either red or green in `data.colors`.
664-
bug!(
665-
"DepNode {:?} should have been \
666+
if dep_dep_node.kind == DepKind::CrateMetadata {
667+
// The `DefPath` has corresponding node,
668+
// and that node should have been marked
669+
// either red or green in `data.colors`.
670+
bug!(
671+
"DepNode {:?} should have been \
666672
pre-marked as red or green but wasn't.",
667-
dep_dep_node
668-
);
673+
dep_dep_node
674+
);
675+
}
669676
} else {
670677
// This `DefPath` does not have a
671678
// corresponding `DepNode` (e.g. a

0 commit comments

Comments
 (0)