Skip to content

Commit

Permalink
Fix plural mistake in emitter.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
varkor committed Oct 19, 2019
1 parent e5b8c11 commit f042687
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/librustc_errors/emitter.rs
Expand Up @@ -12,7 +12,7 @@ use Destination::*;
use syntax_pos::{SourceFile, Span, MultiSpan};

use crate::{
Level, CodeSuggestion, Diagnostic, SubDiagnostic,
Level, CodeSuggestion, Diagnostic, SubDiagnostic, pluralise,
SuggestionStyle, SourceMapper, SourceMapperDyn, DiagnosticId,
};
use crate::Level::Error;
Expand Down Expand Up @@ -1572,7 +1572,8 @@ impl EmitterWriter {
}
}
if suggestions.len() > MAX_SUGGESTIONS {
let msg = format!("and {} other candidates", suggestions.len() - MAX_SUGGESTIONS);
let others = suggestions.len() - MAX_SUGGESTIONS;
let msg = format!("and {} other candidate{}", others, pluralise!(others));
buffer.puts(row_num, max_line_num_len + 3, &msg, Style::NoStyle);
} else if notice_capitalization {
let msg = "notice the capitalization difference";
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/issues/issue-17546.stderr
Expand Up @@ -27,7 +27,7 @@ LL | use std::prelude::v1::Result;
|
LL | use std::result::Result;
|
and 1 other candidates
and 1 other candidate

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

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

0 comments on commit f042687

Please sign in to comment.