Rollup merge of #85934 - tmiasko:is-union, r=jackh726
Add `Ty::is_union` predicate
This commit is contained in:
@@ -752,12 +752,8 @@ impl Visitor<'tcx> for Validator<'mir, 'tcx> {
|
||||
| ProjectionElem::Field(..)
|
||||
| ProjectionElem::Index(_) => {
|
||||
let base_ty = Place::ty_from(place_local, proj_base, self.body, self.tcx).ty;
|
||||
match base_ty.ty_adt_def() {
|
||||
Some(def) if def.is_union() => {
|
||||
self.check_op(ops::UnionAccess);
|
||||
}
|
||||
|
||||
_ => {}
|
||||
if base_ty.is_union() {
|
||||
self.check_op(ops::UnionAccess);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user