Skip to content

Commit 94c9d0c

Browse files
committed
Make non-zero check more obvious
1 parent a6dfd89 commit 94c9d0c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/rustc_trait_selection/src/traits/object_safety.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ fn virtual_call_violation_for_method<'tcx>(
464464

465465
// We can't monomorphize things like `fn foo<A>(...)`.
466466
let own_counts = tcx.generics_of(method.def_id).own_counts();
467-
if own_counts.types + own_counts.consts != 0 {
467+
if own_counts.types > 0 || own_counts.consts > 0 {
468468
return Some(MethodViolationCode::Generic);
469469
}
470470

0 commit comments

Comments
 (0)