1
Fork 0

Fix plural mistake in emitter.rs

This commit is contained in:
varkor 2019-10-19 18:08:54 +01:00
parent e5b8c118a3
commit f042687959
2 changed files with 5 additions and 4 deletions

View file

@ -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;
@ -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";

View file

@ -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
@ -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