Make non-zero check more obvious

This commit is contained in:
Maybe Waffle 2023-07-30 12:12:26 +00:00
parent a6dfd89fa7
commit 94c9d0c90f

View File

@ -464,7 +464,7 @@ fn virtual_call_violation_for_method<'tcx>(
// We can't monomorphize things like `fn foo<A>(...)`.
let own_counts = tcx.generics_of(method.def_id).own_counts();
if own_counts.types + own_counts.consts != 0 {
if own_counts.types > 0 || own_counts.consts > 0 {
return Some(MethodViolationCode::Generic);
}