diff --git a/compiler/rustc_next_trait_solver/src/solve/search_graph.rs b/compiler/rustc_next_trait_solver/src/solve/search_graph.rs index f8a50913f05f8..69d52dcad7a59 100644 --- a/compiler/rustc_next_trait_solver/src/solve/search_graph.rs +++ b/compiler/rustc_next_trait_solver/src/solve/search_graph.rs @@ -71,7 +71,7 @@ struct StackEntry { /// C :- D /// D :- C /// ``` - cycle_participants: HashSet>, + nested_goals: HashSet>, /// Starts out as `None` and gets set when rerunning this /// goal in case we encounter a cycle. provisional_result: Option>, @@ -215,8 +215,8 @@ impl SearchGraph { let current_cycle_root = &mut stack[current_root.as_usize()]; for entry in cycle_participants { entry.non_root_cycle_participant = entry.non_root_cycle_participant.max(Some(head)); - current_cycle_root.cycle_participants.insert(entry.input); - current_cycle_root.cycle_participants.extend(mem::take(&mut entry.cycle_participants)); + current_cycle_root.nested_goals.insert(entry.input); + current_cycle_root.nested_goals.extend(mem::take(&mut entry.nested_goals)); } } @@ -335,7 +335,7 @@ impl SearchGraph { non_root_cycle_participant: None, encountered_overflow: false, has_been_used: HasBeenUsed::empty(), - cycle_participants: Default::default(), + nested_goals: Default::default(), provisional_result: None, }; assert_eq!(self.stack.push(entry), depth); @@ -389,7 +389,7 @@ impl SearchGraph { // // We must not use the global cache entry of a root goal if a cycle // participant is on the stack. This is necessary to prevent unstable - // results. See the comment of `StackEntry::cycle_participants` for + // results. See the comment of `StackEntry::nested_goals` for // more details. self.global_cache(cx).insert( cx, @@ -397,7 +397,7 @@ impl SearchGraph { proof_tree, reached_depth, final_entry.encountered_overflow, - final_entry.cycle_participants, + final_entry.nested_goals, dep_node, result, ) @@ -544,27 +544,27 @@ impl SearchGraph { non_root_cycle_participant, encountered_overflow: _, has_been_used, - ref cycle_participants, + ref nested_goals, provisional_result, } = *entry; let cache_entry = provisional_cache.get(&entry.input).unwrap(); assert_eq!(cache_entry.stack_depth, Some(depth)); if let Some(head) = non_root_cycle_participant { assert!(head < depth); - assert!(cycle_participants.is_empty()); + assert!(nested_goals.is_empty()); assert_ne!(stack[head].has_been_used, HasBeenUsed::empty()); let mut current_root = head; while let Some(parent) = stack[current_root].non_root_cycle_participant { current_root = parent; } - assert!(stack[current_root].cycle_participants.contains(&input)); + assert!(stack[current_root].nested_goals.contains(&input)); } - if !cycle_participants.is_empty() { + if !nested_goals.is_empty() { assert!(provisional_result.is_some() || !has_been_used.is_empty()); for entry in stack.iter().take(depth.as_usize()) { - assert_eq!(cycle_participants.get(&entry.input), None); + assert_eq!(nested_goals.get(&entry.input), None); } } }