Combine two `Match`es such that the result allows for either applying, i.e. contains the intersection of their constraints.
(mut self, other: Self)
| 1087 | /// Combine two `Match`es such that the result allows for either applying, |
| 1088 | /// i.e. contains the intersection of their constraints. |
| 1089 | fn or(mut self, other: Self) -> Self { |
| 1090 | let Match { |
| 1091 | ambiguous, |
| 1092 | storage_class_var_found, |
| 1093 | ty_var_found, |
| 1094 | index_composite_ty_var_found, |
| 1095 | ty_list_var_found, |
| 1096 | } = &mut self; |
| 1097 | |
| 1098 | *ambiguous |= other.ambiguous; |
| 1099 | for (i, self_found) in storage_class_var_found { |
| 1100 | let other_found = other |
| 1101 | .storage_class_var_found |
| 1102 | .get(i) |
| 1103 | .map_or(&[][..], |xs| &xs[..]); |
| 1104 | self_found.retain(|x| other_found.contains(x)); |
| 1105 | } |
| 1106 | for (i, self_found) in ty_var_found { |
| 1107 | let other_found = other.ty_var_found.get(i).map_or(&[][..], |xs| &xs[..]); |
| 1108 | self_found.retain(|x| other_found.contains(x)); |
| 1109 | } |
| 1110 | for (i, self_found) in index_composite_ty_var_found { |
| 1111 | let other_found = other |
| 1112 | .index_composite_ty_var_found |
| 1113 | .get(i) |
| 1114 | .map_or(&[][..], |xs| &xs[..]); |
| 1115 | self_found.retain(|x| other_found.contains(x)); |
| 1116 | } |
| 1117 | for (i, self_found) in ty_list_var_found { |
| 1118 | let other_found = other.ty_list_var_found.get(i).map_or(&[][..], |xs| &xs[..]); |
| 1119 | self_found.retain(|x| other_found.contains(x)); |
| 1120 | } |
| 1121 | self |
| 1122 | } |
| 1123 | |
| 1124 | fn debug_with_infer_cx<'b>( |
| 1125 | &'b self, |
no test coverage detected