Check if p1 and p2 point to the same Constant. Return true if exists a1 in pts(p1) and a1 is Constant(c1) and exists a2 in pts(p2) and a2 is Constant(c2) and c1 = c2
(
pts1: &FxHashSet<ConstraintNode<'tcx>>,
pts2: &FxHashSet<ConstraintNode<'tcx>>,
)
| 1069 | pts1: &FxHashSet<ConstraintNode<'tcx>>, |
| 1070 | pts2: &FxHashSet<ConstraintNode<'tcx>>, |
| 1071 | ) -> bool { |
| 1072 | let mut constants1 = pts1 |
| 1073 | .iter() |
| 1074 | .filter(|node| matches!(node, &ConstraintNode::ConstantDeref(_))); |
| 1075 | let mut constants2 = pts2 |
| 1076 | .iter() |
| 1077 | .filter(|node| matches!(node, &ConstraintNode::ConstantDeref(_))); |
| 1078 | constants1.any(|c1| constants2.any(|c2| c2 == c1)) |
| 1079 | } |
| 1080 | |
| 1081 | /// Check if `local` is a parameter |
| 1082 | #[inline] |
| 1083 | fn is_parameter(local: Local, body: &Body<'_>) -> bool { |
| 1084 | body.args_iter().any(|arg| arg == local) |
| 1085 | } |