1
Fork 0

add comment and test: we do not do value-based reasoning for promotion of unions

This commit is contained in:
Ralf Jung 2024-02-29 10:14:16 +01:00
parent 4cdd20584c
commit d9a2886ef8
3 changed files with 46 additions and 25 deletions

View file

@ -284,6 +284,7 @@ where
if Q::in_adt_inherently(cx, def, args) {
return true;
}
// Don't do any value-based reasoning for unions.
if def.is_union() && Q::in_any_value_of_ty(cx, rvalue.ty(cx.body, cx.tcx)) {
return true;
}