about summary refs log tree commit diff
path: root/src/librustc
diff options
context:
space:
mode:
authorvarkor <github@varkor.com>2019-09-06 19:21:20 +0100
committervarkor <github@varkor.com>2019-09-06 19:21:20 +0100
commitf6481ed1c31d2a3c43fab73e58901f7c25360fcb (patch)
tree734024c70db95eceafedd99b2011bb05b777bee7 /src/librustc
parent4894123d21ed4b153a2e5c32c0870cb2d97f9b46 (diff)
downloadrust-f6481ed1c31d2a3c43fab73e58901f7c25360fcb.tar.gz
rust-f6481ed1c31d2a3c43fab73e58901f7c25360fcb.zip
Correct pluralisation of various diagnostic messages
Diffstat (limited to 'src/librustc')
-rw-r--r--src/librustc/ty/error.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/librustc/ty/error.rs b/src/librustc/ty/error.rs
index fe8f94ab1d3..f67526ea4a1 100644
--- a/src/librustc/ty/error.rs
+++ b/src/librustc/ty/error.rs
@@ -200,7 +200,9 @@ impl<'tcx> ty::TyS<'tcx> {
             ty::Array(_, n) => {
                 let n = tcx.lift_to_global(&n).unwrap();
                 match n.try_eval_usize(tcx, ty::ParamEnv::empty()) {
-                    Some(n) => format!("array of {} elements", n).into(),
+                    Some(n) => {
+                        format!("array of {} element{}", n, if n != 1 { "s" } else { "" }).into()
+                    }
                     None => "array".into(),
                 }
             }