Skip to content

Commit

Permalink
default_union_representation: Fix the order of short-circuit operations
Browse files Browse the repository at this point in the history
  • Loading branch information
jubnzv committed Jan 26, 2022
1 parent 1028599 commit c07dfd8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion clippy_lints/src/default_union_representation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ declare_lint_pass!(DefaultUnionRepresentation => [DEFAULT_UNION_REPRESENTATION])

impl<'tcx> LateLintPass<'tcx> for DefaultUnionRepresentation {
fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx Item<'tcx>) {
if !has_c_repr_attr(cx, item.hir_id()) && is_union_with_two_non_zst_fields(cx, item) {
if is_union_with_two_non_zst_fields(cx, item) && !has_c_repr_attr(cx, item.hir_id()) {
span_lint_and_help(
cx,
DEFAULT_UNION_REPRESENTATION,
Expand Down

0 comments on commit c07dfd8

Please sign in to comment.