diff options
| author | bors <bors@rust-lang.org> | 2019-11-06 06:14:03 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2019-11-06 06:14:03 +0000 |
| commit | e8b190ac4ad79e58d21ee1d573529ff74d8eedaa (patch) | |
| tree | 4d022868d407cf1bed36883037e4e97d1fa5094a /src/libsyntax/parse/parser | |
| parent | e4931eaaa3d95189b30e90d3af9f0db17c41bbb0 (diff) | |
| parent | 4f9651b85409a1e6ad5199211947d124ebbab935 (diff) | |
| download | rust-e8b190ac4ad79e58d21ee1d573529ff74d8eedaa.tar.gz rust-e8b190ac4ad79e58d21ee1d573529ff74d8eedaa.zip | |
Auto merge of #66143 - Centril:rollup-qmzuex0, r=Centril
Rollup of 9 pull requests Successful merges: - #65776 (Rename `LocalInternedString` and more) - #65973 (caller_location: point to macro invocation sites, like file!/line!, and use in core::panic!.) - #66015 (librustc_lexer: Refactor the module) - #66062 (Configure LLVM module PIC level) - #66086 (bump smallvec to 1.0) - #66092 (Use KERN_ARND syscall for random numbers on NetBSD, same as FreeBSD.) - #66103 (Add target thumbv7neon-unknown-linux-musleabihf) - #66133 (Update the bundled `wasi-libc` repository) - #66139 (use American spelling for `pluralize!`) Failed merges: r? @ghost
Diffstat (limited to 'src/libsyntax/parse/parser')
| -rw-r--r-- | src/libsyntax/parse/parser/diagnostics.rs | 6 | ||||
| -rw-r--r-- | src/libsyntax/parse/parser/module.rs | 10 | ||||
| -rw-r--r-- | src/libsyntax/parse/parser/path.rs | 6 | ||||
| -rw-r--r-- | src/libsyntax/parse/parser/ty.rs | 4 |
4 files changed, 13 insertions, 13 deletions
diff --git a/src/libsyntax/parse/parser/diagnostics.rs b/src/libsyntax/parse/parser/diagnostics.rs index 453ef5963be..49a517a5c44 100644 --- a/src/libsyntax/parse/parser/diagnostics.rs +++ b/src/libsyntax/parse/parser/diagnostics.rs @@ -12,7 +12,7 @@ use crate::ptr::P; use crate::symbol::{kw, sym}; use crate::ThinVec; use crate::util::parser::AssocOp; -use errors::{Applicability, DiagnosticBuilder, DiagnosticId, pluralise}; +use errors::{Applicability, DiagnosticBuilder, DiagnosticId, pluralize}; use rustc_data_structures::fx::FxHashSet; use syntax_pos::{Span, DUMMY_SP, MultiSpan, SpanSnippetError}; use log::{debug, trace}; @@ -515,11 +515,11 @@ impl<'a> Parser<'a> { self.diagnostic() .struct_span_err( span, - &format!("unmatched angle bracket{}", pluralise!(total_num_of_gt)), + &format!("unmatched angle bracket{}", pluralize!(total_num_of_gt)), ) .span_suggestion( span, - &format!("remove extra angle bracket{}", pluralise!(total_num_of_gt)), + &format!("remove extra angle bracket{}", pluralize!(total_num_of_gt)), String::new(), Applicability::MachineApplicable, ) diff --git a/src/libsyntax/parse/parser/module.rs b/src/libsyntax/parse/parser/module.rs index a0e4d2bbb7a..242a17659a0 100644 --- a/src/libsyntax/parse/parser/module.rs +++ b/src/libsyntax/parse/parser/module.rs @@ -210,7 +210,7 @@ impl<'a> Parser<'a> { // `/` to `\`. #[cfg(windows)] let s = s.replace("/", "\\"); - Some(dir_path.join(s)) + Some(dir_path.join(&*s)) } else { None } @@ -229,7 +229,7 @@ impl<'a> Parser<'a> { // `./<id>.rs` and `./<id>/mod.rs`. let relative_prefix_string; let relative_prefix = if let Some(ident) = relative { - relative_prefix_string = format!("{}{}", ident.as_str(), path::MAIN_SEPARATOR); + relative_prefix_string = format!("{}{}", ident, path::MAIN_SEPARATOR); &relative_prefix_string } else { "" @@ -314,7 +314,7 @@ impl<'a> Parser<'a> { fn push_directory(&mut self, id: Ident, attrs: &[Attribute]) { if let Some(path) = attr::first_attr_value_str_by_name(attrs, sym::path) { - self.directory.path.to_mut().push(&path.as_str()); + self.directory.path.to_mut().push(&*path.as_str()); self.directory.ownership = DirectoryOwnership::Owned { relative: None }; } else { // We have to push on the current module name in the case of relative @@ -325,10 +325,10 @@ impl<'a> Parser<'a> { // directory path to `/x/y/z`, not `/x/z` with a relative offset of `y`. if let DirectoryOwnership::Owned { relative } = &mut self.directory.ownership { if let Some(ident) = relative.take() { // remove the relative offset - self.directory.path.to_mut().push(ident.as_str()); + self.directory.path.to_mut().push(&*ident.as_str()); } } - self.directory.path.to_mut().push(&id.as_str()); + self.directory.path.to_mut().push(&*id.as_str()); } } } diff --git a/src/libsyntax/parse/parser/path.rs b/src/libsyntax/parse/parser/path.rs index 38a28224dab..f9944e36e2f 100644 --- a/src/libsyntax/parse/parser/path.rs +++ b/src/libsyntax/parse/parser/path.rs @@ -9,7 +9,7 @@ use crate::symbol::kw; use std::mem; use log::debug; -use errors::{Applicability, pluralise}; +use errors::{Applicability, pluralize}; /// Specifies how to parse a path. #[derive(Copy, Clone, PartialEq)] @@ -368,14 +368,14 @@ impl<'a> Parser<'a> { span, &format!( "unmatched angle bracket{}", - pluralise!(snapshot.unmatched_angle_bracket_count) + pluralize!(snapshot.unmatched_angle_bracket_count) ), ) .span_suggestion( span, &format!( "remove extra angle bracket{}", - pluralise!(snapshot.unmatched_angle_bracket_count) + pluralize!(snapshot.unmatched_angle_bracket_count) ), String::new(), Applicability::MachineApplicable, diff --git a/src/libsyntax/parse/parser/ty.rs b/src/libsyntax/parse/parser/ty.rs index e8f718a2483..b770b90705c 100644 --- a/src/libsyntax/parse/parser/ty.rs +++ b/src/libsyntax/parse/parser/ty.rs @@ -10,7 +10,7 @@ use crate::parse::token::{self, Token}; use crate::source_map::Span; use crate::symbol::{kw}; -use errors::{Applicability, pluralise}; +use errors::{Applicability, pluralize}; /// Returns `true` if `IDENT t` can start a type -- `IDENT::a::b`, `IDENT<u8, u8>`, /// `IDENT<<u8 as Trait>::AssocTy>`. @@ -412,7 +412,7 @@ impl<'a> Parser<'a> { } err.span_suggestion_hidden( bound_list, - &format!("remove the trait bound{}", pluralise!(negative_bounds_len)), + &format!("remove the trait bound{}", pluralize!(negative_bounds_len)), new_bound_list, Applicability::MachineApplicable, ); |
