MCPcopy Create free account
hub / github.com/Rust-GPU/rust-gpu / or

Method or

crates/rustc_codegen_spirv/src/linker/specializer.rs:1089–1122  ·  view source on GitHub ↗

Combine two `Match`es such that the result allows for either applying, i.e. contains the intersection of their constraints.

(mut self, other: Self)

Source from the content-addressed store, hash-verified

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,

Callers 6

check_fragment_instsFunction · 0.45
visitFunction · 0.45
match_ty_patMethod · 0.45
match_inst_sigsMethod · 0.45

Calls 1

getMethod · 0.45

Tested by

no test coverage detected