Skip to content

Commit f042687

Browse files
committed
Fix plural mistake in emitter.rs
1 parent e5b8c11 commit f042687

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/librustc_errors/emitter.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use Destination::*;
1212
use syntax_pos::{SourceFile, Span, MultiSpan};
1313

1414
use crate::{
15-
Level, CodeSuggestion, Diagnostic, SubDiagnostic,
15+
Level, CodeSuggestion, Diagnostic, SubDiagnostic, pluralise,
1616
SuggestionStyle, SourceMapper, SourceMapperDyn, DiagnosticId,
1717
};
1818
use crate::Level::Error;
@@ -1572,7 +1572,8 @@ impl EmitterWriter {
15721572
}
15731573
}
15741574
if suggestions.len() > MAX_SUGGESTIONS {
1575-
let msg = format!("and {} other candidates", suggestions.len() - MAX_SUGGESTIONS);
1575+
let others = suggestions.len() - MAX_SUGGESTIONS;
1576+
let msg = format!("and {} other candidate{}", others, pluralise!(others));
15761577
buffer.puts(row_num, max_line_num_len + 3, &msg, Style::NoStyle);
15771578
} else if notice_capitalization {
15781579
let msg = "notice the capitalization difference";

src/test/ui/issues/issue-17546.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ LL | use std::prelude::v1::Result;
2727
|
2828
LL | use std::result::Result;
2929
|
30-
and 1 other candidates
30+
and 1 other candidate
3131

3232
error[E0573]: expected type, found variant `Result`
3333
--> $DIR/issue-17546.rs:28:13
@@ -44,7 +44,7 @@ LL | use std::prelude::v1::Result;
4444
|
4545
LL | use std::result::Result;
4646
|
47-
and 1 other candidates
47+
and 1 other candidate
4848

4949
error[E0573]: expected type, found variant `NoResult`
5050
--> $DIR/issue-17546.rs:33:15

0 commit comments

Comments
 (0)