diff --git a/compiler/rustc_lint_defs/src/lib.rs b/compiler/rustc_lint_defs/src/lib.rs index f350957f72f1c..1d0e367abba3e 100644 --- a/compiler/rustc_lint_defs/src/lib.rs +++ b/compiler/rustc_lint_defs/src/lib.rs @@ -23,8 +23,9 @@ pub mod builtin; #[macro_export] macro_rules! pluralize { + // Pluralize based on count (e.g., apples) ($x:expr) => { - if $x != 1 { "s" } else { "" } + if $x == 1 { "" } else { "s" } }; ("has", $x:expr) => { if $x == 1 { "has" } else { "have" }