Skip to content

Commit c4dba5a

Browse files
committed
use |=
1 parent f34909d commit c4dba5a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

compiler/rustc_typeck/src/expr_use_visitor.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -262,12 +262,14 @@ impl<'a, 'tcx> ExprUseVisitor<'a, 'tcx> {
262262
| Res::Def(DefKind::AssocConst, _) => {
263263
// Named constants have to be equated with the value
264264
// being matched, so that's a read of the value being matched.
265+
//
266+
// FIXME: We don't actually reads for ZSTs.
265267
needs_to_be_read = true;
266268
}
267269
_ => {
268270
// Otherwise, this is a struct/enum variant, and so it's
269271
// only a read if we need to read the discriminant.
270-
needs_to_be_read = is_multivariant_adt(place.place.ty());
272+
needs_to_be_read |= is_multivariant_adt(place.place.ty());
271273
}
272274
}
273275
}
@@ -279,9 +281,7 @@ impl<'a, 'tcx> ExprUseVisitor<'a, 'tcx> {
279281
// perform some reads).
280282

281283
let place_ty = place.place.ty();
282-
if is_multivariant_adt(place_ty) {
283-
needs_to_be_read = true;
284-
}
284+
needs_to_be_read |= is_multivariant_adt(place_ty);
285285
}
286286
PatKind::Lit(_) | PatKind::Range(..) => {
287287
// If the PatKind is a Lit or a Range then we want

0 commit comments

Comments
 (0)