Skip to content

Commit 1e772f9

Browse files
committed
check for empty heads after adding parent
1 parent 42b384e commit 1e772f9

File tree

1 file changed

+4
-4
lines changed
  • compiler/rustc_type_ir/src/search_graph

1 file changed

+4
-4
lines changed

compiler/rustc_type_ir/src/search_graph/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -969,10 +969,6 @@ impl<D: Delegate<Cx = X>, X: Cx> SearchGraph<D, X> {
969969
return true;
970970
};
971971

972-
let Some(new_highest_head_index) = heads.opt_highest_cycle_head_index() else {
973-
return false;
974-
};
975-
976972
// We're rebasing an entry `e` over a head `p`. This head
977973
// has a number of own heads `h` it depends on.
978974
//
@@ -1046,6 +1042,10 @@ impl<D: Delegate<Cx = X>, X: Cx> SearchGraph<D, X> {
10461042
};
10471043
}
10481044

1045+
let Some(new_highest_head_index) = heads.opt_highest_cycle_head_index() else {
1046+
return false;
1047+
};
1048+
10491049
// We now care about the path from the next highest cycle head to the
10501050
// provisional cache entry.
10511051
*path_from_head = path_from_head.extend(Self::cycle_path_kind(

0 commit comments

Comments
 (0)