Skip to content

Commit

Permalink
Rollup merge of #65602 - varkor:other-candidates, r=Centril
Browse files Browse the repository at this point in the history
Fix plural mistake in emitter.rs
  • Loading branch information
Centril authored Oct 20, 2019
2 parents 1c0e67a + f042687 commit ba42fc2
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 ba42fc2

Please sign in to comment.