(constant: &ConstantInfo)
| 79 | mut ungrounded: FxHashMap<Name, GroundError>, |
| 80 | in_refs: &RefMap, |
| 81 | ) -> FxHashMap<Name, GroundError> { |
| 82 | let mut stack: Vec<_> = ungrounded.keys().cloned().collect(); |
| 83 | while let Some(popped) = stack.pop() { |
| 84 | let Some(in_ref_set) = in_refs.get(&popped) else { |
| 85 | continue; |
| 86 | }; |
| 87 | for in_ref in in_ref_set { |
| 88 | if let Entry::Vacant(entry) = ungrounded.entry(in_ref.clone()) { |
| 89 | entry.insert(GroundError::Ref(popped.clone())); |
| 90 | stack.push(in_ref.clone()); |
| 91 | } |
| 92 | } |
| 93 | } |
| 94 | ungrounded |
| 95 | } |