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

Method and

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

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)

Source from the content-addressed store, hash-verified

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.

Callers 4

def_constant_cxMethod · 0.45
match_ty_patMethod · 0.45
match_ty_list_patMethod · 0.45
match_inst_sigMethod · 0.45

Calls 1

get_mut_or_defaultMethod · 0.80

Tested by

no test coverage detected