diff options
| author | est31 <MTest31@outlook.com> | 2022-03-14 17:55:14 +0100 |
|---|---|---|
| committer | est31 <MTest31@outlook.com> | 2022-03-15 15:37:49 +0100 |
| commit | 3bf9124f14f68f8c3cd26dd27d0ef27c516a5f06 (patch) | |
| tree | 514047e6dbfc97972aee02110fc0a89ab493992c /compiler/rustc_resolve/src | |
| parent | bce19cf7f19ee5729defaccc86b068cc3c206c9c (diff) | |
| download | rust-3bf9124f14f68f8c3cd26dd27d0ef27c516a5f06.tar.gz rust-3bf9124f14f68f8c3cd26dd27d0ef27c516a5f06.zip | |
Support other types of pluralization in pluralize macro
Diffstat (limited to 'compiler/rustc_resolve/src')
| -rw-r--r-- | compiler/rustc_resolve/src/late/diagnostics.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_resolve/src/late/diagnostics.rs b/compiler/rustc_resolve/src/late/diagnostics.rs index 9e38428660e..8dec28c8ae2 100644 --- a/compiler/rustc_resolve/src/late/diagnostics.rs +++ b/compiler/rustc_resolve/src/late/diagnostics.rs @@ -504,9 +504,9 @@ impl<'a: 'ast, 'ast> LateResolutionVisitor<'a, '_, 'ast> { for sp in spans { let msg = if sp == last_bound_span { format!( - "...because of {} bound{}", - if bounds.len() <= 2 { "this" } else { "these" }, - if bounds.len() <= 2 { "" } else { "s" }, + "...because of {these} bound{s}", + these = pluralize!("this", bounds.len() - 1), + s = pluralize!(bounds.len() - 1), ) } else { String::new() |
