diff options
| author | n-salim <53019816+n-salim@users.noreply.github.com> | 2019-09-23 14:12:26 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-09-23 14:12:26 -0700 |
| commit | cd88dae21174f37aa47a45e4b848c4a5ececf19e (patch) | |
| tree | 196ef2334e2f7787737af02f2e78ed53c10fb5a8 /src/libsyntax/parse/parser/ty.rs | |
| parent | 494d83c89279a955dfb559ded5d5ac2ac06fc255 (diff) | |
| parent | 66bf391c3aabfc77f5f7139fc9e6944f995d574e (diff) | |
| download | rust-cd88dae21174f37aa47a45e4b848c4a5ececf19e.tar.gz rust-cd88dae21174f37aa47a45e4b848c4a5ececf19e.zip | |
Merge pull request #26 from rust-lang/master
Sync to rust-lang/rust master
Diffstat (limited to 'src/libsyntax/parse/parser/ty.rs')
| -rw-r--r-- | src/libsyntax/parse/parser/ty.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libsyntax/parse/parser/ty.rs b/src/libsyntax/parse/parser/ty.rs index 465e31ac57e..5697edd8e48 100644 --- a/src/libsyntax/parse/parser/ty.rs +++ b/src/libsyntax/parse/parser/ty.rs @@ -11,7 +11,7 @@ use crate::symbol::{kw}; use rustc_target::spec::abi::Abi; -use errors::{Applicability}; +use errors::{Applicability, pluralise}; /// Returns `true` if `IDENT t` can start a type -- `IDENT::a::b`, `IDENT<u8, u8>`, /// `IDENT<<u8 as Trait>::AssocTy>`. @@ -397,7 +397,7 @@ impl<'a> Parser<'a> { } if !negative_bounds.is_empty() || was_negative { - let plural = negative_bounds.len() > 1; + let negative_bounds_len = negative_bounds.len(); let last_span = negative_bounds.last().map(|sp| *sp); let mut err = self.struct_span_err( negative_bounds, @@ -420,7 +420,7 @@ impl<'a> Parser<'a> { } err.span_suggestion_hidden( bound_list, - &format!("remove the trait bound{}", if plural { "s" } else { "" }), + &format!("remove the trait bound{}", pluralise!(negative_bounds_len)), new_bound_list, Applicability::MachineApplicable, ); |
