Skip to content

Commit 3672602

Browse files
committed
Use EvaluatedToOkModuloRegions when we get a coinductive match
This forces every participant in the cycle to have a result `EvaluatedToOkModuloRegions` (or an error) as well, since their result will be influenced by the coinductive result. While I'm confident that this is sound (AFAIK, it's always sound to replace `EvaluatedToOk` with `EvaluatedToOkModuloRegions`), I don't really understand the coinductive cycle logic. This appears to fix the `syn` incremental crash, but there could be a different way of fixing it as well.
1 parent d203fce commit 3672602

File tree

1 file changed

+1
-1
lines changed
  • compiler/rustc_trait_selection/src/traits/select

1 file changed

+1
-1
lines changed

compiler/rustc_trait_selection/src/traits/select/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
736736
cycle.map(|stack| stack.obligation.predicate.without_const().to_predicate(tcx));
737737
if self.coinductive_match(cycle) {
738738
debug!("evaluate_stack --> recursive, coinductive");
739-
Some(EvaluatedToOk)
739+
Some(EvaluatedToOkModuloRegions)
740740
} else {
741741
debug!("evaluate_stack --> recursive, inductive");
742742
Some(EvaluatedToRecur)

0 commit comments

Comments
 (0)