Combine two `Match`es such that the result implies both of them apply, i.e. contains the union of their constraints.
(mut self, other: Self)
| 1056 | /// Combine two `Match`es such that the result implies both of them apply, |
| 1057 | /// i.e. contains the union of their constraints. |
| 1058 | fn and(mut self, other: Self) -> Self { |
| 1059 | let Match { |
| 1060 | ambiguous, |
| 1061 | storage_class_var_found, |
| 1062 | ty_var_found, |
| 1063 | index_composite_ty_var_found, |
| 1064 | ty_list_var_found, |
| 1065 | } = &mut self; |
| 1066 | |
| 1067 | *ambiguous |= other.ambiguous; |
| 1068 | for (i, other_found) in other.storage_class_var_found { |
| 1069 | storage_class_var_found |
| 1070 | .get_mut_or_default(i) |
| 1071 | .extend(other_found); |
| 1072 | } |
| 1073 | for (i, other_found) in other.ty_var_found { |
| 1074 | ty_var_found.get_mut_or_default(i).extend(other_found); |
| 1075 | } |
| 1076 | for (i, other_found) in other.index_composite_ty_var_found { |
| 1077 | index_composite_ty_var_found |
| 1078 | .get_mut_or_default(i) |
| 1079 | .extend(other_found); |
| 1080 | } |
| 1081 | for (i, other_found) in other.ty_list_var_found { |
| 1082 | ty_list_var_found.get_mut_or_default(i).extend(other_found); |
| 1083 | } |
| 1084 | self |
| 1085 | } |
| 1086 | |
| 1087 | /// Combine two `Match`es such that the result allows for either applying, |
| 1088 | /// i.e. contains the intersection of their constraints. |
no test coverage detected