-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Correct pluralisation of various diagnostic messages #64233
Conversation
r? @eddyb (rust_highfive has picked a reviewer for you, use r? to override) |
r? @estebank |
@@ -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() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This if $n != 1 { "s" } else { "" }
business should be refactored to a function in some utility module in rustc_errors
. Would be good to grep for "s" } else { ""
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would make a nice beginner issue. I'll open one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opened #64238.
📌 Commit 0b97726 has been approved by |
…ebank Correct pluralisation of various diagnostic messages
Rollup of 10 pull requests Successful merges: - #63919 (Use hygiene for AST passes) - #63927 (Filter linkcheck spurious failure) - #64149 (rustc_codegen_llvm: give names to non-alloca variable values.) - #64192 (Bail out when encountering likely missing turbofish in parser) - #64231 (Move the HIR CFG to `rustc_ast_borrowck`) - #64233 (Correct pluralisation of various diagnostic messages) - #64236 (reduce visibility) - #64240 (Include compiler-rt in the source tarball) - #64241 ([doc] Added more prereqs and note about default directory) - #64243 (Move injection of attributes from command line to `libsyntax_ext`) Failed merges: r? @ghost
No description provided.