From c17f89d6ede71cb0f8f0286307b1b83a642aff91 Mon Sep 17 00:00:00 2001 From: Eduard-Mihai Burtescu Date: Wed, 30 Oct 2019 18:54:40 +0200 Subject: caller_location: point to macro invocation sites, like file!/line!. --- src/libsyntax_expand/base.rs | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'src/libsyntax_expand') diff --git a/src/libsyntax_expand/base.rs b/src/libsyntax_expand/base.rs index a66263a9a02..e8be57dfd4c 100644 --- a/src/libsyntax_expand/base.rs +++ b/src/libsyntax_expand/base.rs @@ -954,18 +954,7 @@ impl<'a> ExtCtxt<'a> { /// /// Stops backtracing at include! boundary. pub fn expansion_cause(&self) -> Option { - let mut expn_id = self.current_expansion.id; - let mut last_macro = None; - loop { - let expn_data = expn_id.expn_data(); - // Stop going up the backtrace once include! is encountered - if expn_data.is_root() || expn_data.kind.descr() == sym::include { - break; - } - expn_id = expn_data.call_site.ctxt().outer_expn(); - last_macro = Some(expn_data.call_site); - } - last_macro + self.current_expansion.id.expansion_cause() } pub fn struct_span_warn>(&self, -- cgit 1.4.1-3-g733a5 From 5bc7084f7e1be9da93bb014e05f19a80ff6fa188 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Tue, 22 Oct 2019 08:31:37 +1100 Subject: Convert `x.as_str().to_string()` to `x.to_string()` where possible. --- src/librustc/dep_graph/dep_node.rs | 2 +- src/librustc/hir/lowering.rs | 2 +- src/librustc/hir/print.rs | 4 ++-- src/librustc/traits/on_unimplemented.rs | 2 +- src/librustc/ty/query/on_disk_cache.rs | 2 +- src/librustc_codegen_ssa/base.rs | 6 ++---- src/librustc_incremental/assert_module_sources.rs | 6 +++--- src/librustdoc/clean/mod.rs | 2 +- src/libsyntax/print/pprust.rs | 6 +++--- src/libsyntax_expand/mbe/macro_rules.rs | 2 +- 10 files changed, 16 insertions(+), 18 deletions(-) (limited to 'src/libsyntax_expand') diff --git a/src/librustc/dep_graph/dep_node.rs b/src/librustc/dep_graph/dep_node.rs index dea8d70aaf4..cea790375fc 100644 --- a/src/librustc/dep_graph/dep_node.rs +++ b/src/librustc/dep_graph/dep_node.rs @@ -525,7 +525,7 @@ impl<'tcx> DepNodeParams<'tcx> for CrateNum { } fn to_debug_str(&self, tcx: TyCtxt<'tcx>) -> String { - tcx.crate_name(*self).as_str().to_string() + tcx.crate_name(*self).to_string() } } diff --git a/src/librustc/hir/lowering.rs b/src/librustc/hir/lowering.rs index 12ab44515c3..9ff52727187 100644 --- a/src/librustc/hir/lowering.rs +++ b/src/librustc/hir/lowering.rs @@ -3382,7 +3382,7 @@ pub fn is_range_literal(sess: &Session, expr: &hir::Expr) -> bool { // either in std or core, i.e. has either a `::std::ops::Range` or // `::core::ops::Range` prefix. fn is_range_path(path: &Path) -> bool { - let segs: Vec<_> = path.segments.iter().map(|seg| seg.ident.as_str().to_string()).collect(); + let segs: Vec<_> = path.segments.iter().map(|seg| seg.ident.to_string()).collect(); let segs: Vec<_> = segs.iter().map(|seg| &**seg).collect(); // "{{root}}" is the equivalent of `::` prefix in `Path`. diff --git a/src/librustc/hir/print.rs b/src/librustc/hir/print.rs index 64b355f6ec9..328d475be06 100644 --- a/src/librustc/hir/print.rs +++ b/src/librustc/hir/print.rs @@ -564,7 +564,7 @@ impl<'a> State<'a> { } hir::ItemKind::GlobalAsm(ref ga) => { self.head(visibility_qualified(&item.vis, "global asm")); - self.s.word(ga.asm.as_str().to_string()); + self.s.word(ga.asm.to_string()); self.end() } hir::ItemKind::TyAlias(ref ty, ref generics) => { @@ -1855,7 +1855,7 @@ impl<'a> State<'a> { self.commasep(Inconsistent, &decl.inputs, |s, ty| { s.ibox(INDENT_UNIT); if let Some(arg_name) = arg_names.get(i) { - s.s.word(arg_name.as_str().to_string()); + s.s.word(arg_name.to_string()); s.s.word(":"); s.s.space(); } else if let Some(body_id) = body_id { diff --git a/src/librustc/traits/on_unimplemented.rs b/src/librustc/traits/on_unimplemented.rs index b39c00a56e3..b64e44b6a5a 100644 --- a/src/librustc/traits/on_unimplemented.rs +++ b/src/librustc/traits/on_unimplemented.rs @@ -180,7 +180,7 @@ impl<'tcx> OnUnimplementedDirective { c.ident().map_or(false, |ident| { options.contains(&( ident.name, - c.value_str().map(|s| s.as_str().to_string()) + c.value_str().map(|s| s.to_string()) )) }) }) { diff --git a/src/librustc/ty/query/on_disk_cache.rs b/src/librustc/ty/query/on_disk_cache.rs index 21a7cf00b28..039949d915a 100644 --- a/src/librustc/ty/query/on_disk_cache.rs +++ b/src/librustc/ty/query/on_disk_cache.rs @@ -264,7 +264,7 @@ impl<'sess> OnDiskCache<'sess> { let sorted_cnums = sorted_cnums_including_local_crate(tcx); let prev_cnums: Vec<_> = sorted_cnums.iter() .map(|&cnum| { - let crate_name = tcx.original_crate_name(cnum).as_str().to_string(); + let crate_name = tcx.original_crate_name(cnum).to_string(); let crate_disambiguator = tcx.crate_disambiguator(cnum); (cnum.as_u32(), crate_name, crate_disambiguator) }) diff --git a/src/librustc_codegen_ssa/base.rs b/src/librustc_codegen_ssa/base.rs index ee4ec7fb41e..c3f2a5161ae 100644 --- a/src/librustc_codegen_ssa/base.rs +++ b/src/librustc_codegen_ssa/base.rs @@ -552,8 +552,7 @@ pub fn codegen_crate( } else if let Some(kind) = *tcx.sess.allocator_kind.get() { let llmod_id = cgu_name_builder.build_cgu_name(LOCAL_CRATE, &["crate"], - Some("allocator")).as_str() - .to_string(); + Some("allocator")).to_string(); let mut modules = backend.new_metadata(tcx, &llmod_id); time(tcx.sess, "write allocator module", || { backend.codegen_allocator(tcx, &mut modules, kind) @@ -576,8 +575,7 @@ pub fn codegen_crate( // Codegen the encoded metadata. let metadata_cgu_name = cgu_name_builder.build_cgu_name(LOCAL_CRATE, &["crate"], - Some("metadata")).as_str() - .to_string(); + Some("metadata")).to_string(); let mut metadata_llvm_module = backend.new_metadata(tcx, &metadata_cgu_name); time(tcx.sess, "write compressed metadata", || { backend.write_compressed_metadata(tcx, &ongoing_codegen.metadata, diff --git a/src/librustc_incremental/assert_module_sources.rs b/src/librustc_incremental/assert_module_sources.rs index 6150017f957..f740d1a9bfa 100644 --- a/src/librustc_incremental/assert_module_sources.rs +++ b/src/librustc_incremental/assert_module_sources.rs @@ -94,8 +94,8 @@ impl AssertModuleSource<'tcx> { return; } - let user_path = self.field(attr, sym::module).as_str().to_string(); - let crate_name = self.tcx.crate_name(LOCAL_CRATE).as_str().to_string(); + let user_path = self.field(attr, sym::module).to_string(); + let crate_name = self.tcx.crate_name(LOCAL_CRATE).to_string(); if !user_path.starts_with(&crate_name) { let msg = format!("Found malformed codegen unit name `{}`. \ @@ -131,7 +131,7 @@ impl AssertModuleSource<'tcx> { cgu_name, self.available_cgus .iter() - .map(|cgu| cgu.as_str().to_string()) + .map(|cgu| cgu.to_string()) .collect::>() .join(", "))); } diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index bdc02062230..cc1d1503c43 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -1167,7 +1167,7 @@ fn external_path(cx: &DocContext<'_>, name: Symbol, trait_did: Option, ha global: false, res: Res::Err, segments: vec![PathSegment { - name: name.as_str().to_string(), + name: name.to_string(), args: external_generic_args(cx, trait_did, has_self, bindings, substs) }], } diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index 136fc355f89..74ab5c79019 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -623,7 +623,7 @@ pub trait PrintState<'a>: std::ops::Deref + std::ops::Dere } self.maybe_print_comment(attr.span.lo()); if attr.is_sugared_doc { - self.word(attr.value_str().unwrap().as_str().to_string()); + self.word(attr.value_str().unwrap().to_string()); self.hardbreak() } else { match attr.style { @@ -1234,7 +1234,7 @@ impl<'a> State<'a> { } ast::ItemKind::GlobalAsm(ref ga) => { self.head(visibility_qualified(&item.vis, "global_asm!")); - self.s.word(ga.asm.as_str().to_string()); + self.s.word(ga.asm.to_string()); self.end(); } ast::ItemKind::TyAlias(ref ty, ref generics) => { @@ -2335,7 +2335,7 @@ impl<'a> State<'a> { } crate fn print_name(&mut self, name: ast::Name) { - self.s.word(name.as_str().to_string()); + self.s.word(name.to_string()); self.ann.post(self, AnnNode::Name(&name)) } diff --git a/src/libsyntax_expand/mbe/macro_rules.rs b/src/libsyntax_expand/mbe/macro_rules.rs index 9a4130b2d8d..2a8c455d7f0 100644 --- a/src/libsyntax_expand/mbe/macro_rules.rs +++ b/src/libsyntax_expand/mbe/macro_rules.rs @@ -225,7 +225,7 @@ fn generic_extension<'cx>( }; let mut p = Parser::new(cx.parse_sess(), tts, Some(directory), true, false, None); p.root_module_name = - cx.current_expansion.module.mod_path.last().map(|id| id.as_str().to_string()); + cx.current_expansion.module.mod_path.last().map(|id| id.to_string()); p.last_type_ascription = cx.current_expansion.prior_type_ascription; p.process_potential_macro_variable(); -- cgit 1.4.1-3-g733a5 From 90b8d34c9f0d17c948801f676a96800e8b038508 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Mon, 4 Nov 2019 15:59:09 +0100 Subject: bump smallvec to 1.0 --- Cargo.lock | 56 ++++++++++++++------------ src/libarena/Cargo.toml | 2 +- src/librustc/Cargo.toml | 2 +- src/librustc/arena.rs | 2 +- src/librustc/ty/inhabitedness/def_id_forest.rs | 10 ++--- src/librustc_apfloat/Cargo.toml | 2 +- src/librustc_data_structures/Cargo.toml | 2 +- src/librustc_index/Cargo.toml | 2 +- src/librustc_interface/Cargo.toml | 2 +- src/librustc_metadata/Cargo.toml | 2 +- src/librustc_mir/Cargo.toml | 2 +- src/librustc_resolve/Cargo.toml | 2 +- src/librustc_traits/Cargo.toml | 2 +- src/librustc_typeck/Cargo.toml | 2 +- src/libserialize/Cargo.toml | 2 +- src/libsyntax/Cargo.toml | 2 +- src/libsyntax/tokenstream.rs | 2 +- src/libsyntax_expand/Cargo.toml | 2 +- src/libsyntax_ext/Cargo.toml | 2 +- 19 files changed, 53 insertions(+), 47 deletions(-) (limited to 'src/libsyntax_expand') diff --git a/Cargo.lock b/Cargo.lock index 46480aeb447..e15c0f85abb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -68,7 +68,7 @@ name = "arena" version = "0.0.0" dependencies = [ "rustc_data_structures", - "smallvec", + "smallvec 1.0.0", ] [[package]] @@ -486,7 +486,7 @@ dependencies = [ "regex-syntax", "semver", "serde", - "smallvec", + "smallvec 0.6.10", "toml", "unicode-normalization", "url 2.1.0", @@ -654,7 +654,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0f0ed1a4de2235cabda8558ff5840bffb97fcb64c97827f354a451307df5f72b" dependencies = [ "crossbeam-utils 0.6.5", - "smallvec", + "smallvec 0.6.10", ] [[package]] @@ -2391,7 +2391,7 @@ dependencies = [ "libc", "rand 0.6.1", "rustc_version", - "smallvec", + "smallvec 0.6.10", "winapi 0.3.6", ] @@ -2406,7 +2406,7 @@ dependencies = [ "libc", "redox_syscall", "rustc_version", - "smallvec", + "smallvec 0.6.10", "winapi 0.3.6", ] @@ -3134,7 +3134,7 @@ dependencies = [ "rustc_target", "scoped-tls", "serialize", - "smallvec", + "smallvec 1.0.0", "syntax", "syntax_pos", ] @@ -3146,7 +3146,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a623fd4805842e9bd0bb6e6dace63efede0ee22de4522a0b03b7c3d15a22f009" dependencies = [ "rustc-ap-rustc_data_structures", - "smallvec", + "smallvec 0.6.10", ] [[package]] @@ -3175,7 +3175,7 @@ dependencies = [ "rustc-hash", "rustc-rayon 0.2.0", "rustc-rayon-core 0.2.0", - "smallvec", + "smallvec 0.6.10", "stable_deref_trait", ] @@ -3203,7 +3203,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "457a5c204ae2fdaa5bdb5b196e58ca59896870d80445fe423063c9453496e3ea" dependencies = [ "rustc-ap-serialize", - "smallvec", + "smallvec 0.6.10", ] [[package]] @@ -3249,7 +3249,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "92679240e86f4583cc05f8dcf6439bdab87bac9e6555718469176de9bd52ba20" dependencies = [ "indexmap", - "smallvec", + "smallvec 0.6.10", ] [[package]] @@ -3269,7 +3269,7 @@ dependencies = [ "rustc-ap-serialize", "rustc-ap-syntax_pos", "scoped-tls", - "smallvec", + "smallvec 0.6.10", ] [[package]] @@ -3392,7 +3392,7 @@ dependencies = [ "crossbeam-utils 0.6.5", "serde", "serde_json", - "smallvec", + "smallvec 0.6.10", "syn 0.15.35", "url 2.1.0", "winapi 0.3.6", @@ -3403,7 +3403,7 @@ name = "rustc_apfloat" version = "0.0.0" dependencies = [ "bitflags", - "smallvec", + "smallvec 1.0.0", ] [[package]] @@ -3483,7 +3483,7 @@ dependencies = [ "rustc-rayon-core 0.3.0", "rustc_index", "serialize", - "smallvec", + "smallvec 1.0.0", "stable_deref_trait", ] @@ -3551,7 +3551,7 @@ name = "rustc_index" version = "0.0.0" dependencies = [ "serialize", - "smallvec", + "smallvec 1.0.0", ] [[package]] @@ -3578,7 +3578,7 @@ dependencies = [ "rustc_traits", "rustc_typeck", "serialize", - "smallvec", + "smallvec 1.0.0", "syntax", "syntax_expand", "syntax_ext", @@ -3649,7 +3649,7 @@ dependencies = [ "rustc_index", "rustc_target", "serialize", - "smallvec", + "smallvec 1.0.0", "stable_deref_trait", "syntax", "syntax_expand", @@ -3674,7 +3674,7 @@ dependencies = [ "rustc_lexer", "rustc_target", "serialize", - "smallvec", + "smallvec 1.0.0", "syntax", "syntax_pos", ] @@ -3745,7 +3745,7 @@ dependencies = [ "rustc_data_structures", "rustc_errors", "rustc_metadata", - "smallvec", + "smallvec 1.0.0", "syntax", "syntax_expand", "syntax_pos", @@ -3798,7 +3798,7 @@ dependencies = [ "rustc", "rustc_data_structures", "rustc_target", - "smallvec", + "smallvec 1.0.0", "syntax", "syntax_pos", ] @@ -3825,7 +3825,7 @@ dependencies = [ "rustc_errors", "rustc_index", "rustc_target", - "smallvec", + "smallvec 1.0.0", "syntax", "syntax_pos", ] @@ -4069,7 +4069,7 @@ name = "serialize" version = "0.0.0" dependencies = [ "indexmap", - "smallvec", + "smallvec 1.0.0", ] [[package]] @@ -4133,6 +4133,12 @@ version = "0.6.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab606a9c5e214920bb66c458cd7be8ef094f813f20fe77a54cc7dbfff220d4b7" +[[package]] +name = "smallvec" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ecf3b85f68e8abaa7555aa5abdb1153079387e60b718283d732f03897fcfc86" + [[package]] name = "socket2" version = "0.3.8" @@ -4358,7 +4364,7 @@ dependencies = [ "rustc_target", "scoped-tls", "serialize", - "smallvec", + "smallvec 1.0.0", "syntax_pos", ] @@ -4376,7 +4382,7 @@ dependencies = [ "rustc_target", "scoped-tls", "serialize", - "smallvec", + "smallvec 1.0.0", "syntax", "syntax_pos", ] @@ -4390,7 +4396,7 @@ dependencies = [ "rustc_data_structures", "rustc_errors", "rustc_target", - "smallvec", + "smallvec 1.0.0", "syntax", "syntax_expand", "syntax_pos", diff --git a/src/libarena/Cargo.toml b/src/libarena/Cargo.toml index 2643912f6d7..5158aab8b7d 100644 --- a/src/libarena/Cargo.toml +++ b/src/libarena/Cargo.toml @@ -10,4 +10,4 @@ path = "lib.rs" [dependencies] rustc_data_structures = { path = "../librustc_data_structures" } -smallvec = { version = "0.6.7", features = ["union", "may_dangle"] } +smallvec = { version = "1.0", features = ["union", "may_dangle"] } diff --git a/src/librustc/Cargo.toml b/src/librustc/Cargo.toml index de67f46eba6..92b94af75d7 100644 --- a/src/librustc/Cargo.toml +++ b/src/librustc/Cargo.toml @@ -39,5 +39,5 @@ parking_lot = "0.9" byteorder = { version = "1.3" } chalk-engine = { version = "0.9.0", default-features=false } rustc_fs_util = { path = "../librustc_fs_util" } -smallvec = { version = "0.6.8", features = ["union", "may_dangle"] } +smallvec = { version = "1.0", features = ["union", "may_dangle"] } measureme = "0.4" diff --git a/src/librustc/arena.rs b/src/librustc/arena.rs index 3daf0fc9df7..9b13a910c61 100644 --- a/src/librustc/arena.rs +++ b/src/librustc/arena.rs @@ -304,7 +304,7 @@ impl DropArena { // Move the content to the arena by copying it and then forgetting // the content of the SmallVec vec.as_ptr().copy_to_nonoverlapping(start_ptr, len); - mem::forget(vec.drain()); + mem::forget(vec.drain(..)); // Record the destructors after doing the allocation as that may panic // and would cause `object`'s destuctor to run twice if it was recorded before diff --git a/src/librustc/ty/inhabitedness/def_id_forest.rs b/src/librustc/ty/inhabitedness/def_id_forest.rs index 63cc60d80aa..227fbf967c0 100644 --- a/src/librustc/ty/inhabitedness/def_id_forest.rs +++ b/src/librustc/ty/inhabitedness/def_id_forest.rs @@ -76,19 +76,19 @@ impl<'tcx> DefIdForest { break; } - for id in ret.root_ids.drain() { + for id in ret.root_ids.drain(..) { if next_forest.contains(tcx, id) { next_ret.push(id); } else { old_ret.push(id); } } - ret.root_ids.extend(old_ret.drain()); + ret.root_ids.extend(old_ret.drain(..)); next_ret.extend(next_forest.root_ids.into_iter().filter(|&id| ret.contains(tcx, id))); mem::swap(&mut next_ret, &mut ret.root_ids); - next_ret.drain(); + next_ret.drain(..); } ret } @@ -101,7 +101,7 @@ impl<'tcx> DefIdForest { let mut ret = DefIdForest::empty(); let mut next_ret = SmallVec::new(); for next_forest in iter { - next_ret.extend(ret.root_ids.drain().filter(|&id| !next_forest.contains(tcx, id))); + next_ret.extend(ret.root_ids.drain(..).filter(|&id| !next_forest.contains(tcx, id))); for id in next_forest.root_ids { if !next_ret.contains(&id) { @@ -110,7 +110,7 @@ impl<'tcx> DefIdForest { } mem::swap(&mut next_ret, &mut ret.root_ids); - next_ret.drain(); + next_ret.drain(..); } ret } diff --git a/src/librustc_apfloat/Cargo.toml b/src/librustc_apfloat/Cargo.toml index 4fc15f99e48..726965e1e71 100644 --- a/src/librustc_apfloat/Cargo.toml +++ b/src/librustc_apfloat/Cargo.toml @@ -10,4 +10,4 @@ path = "lib.rs" [dependencies] bitflags = "1.2.1" -smallvec = { version = "0.6.7", features = ["union", "may_dangle"] } +smallvec = { version = "1.0", features = ["union", "may_dangle"] } diff --git a/src/librustc_data_structures/Cargo.toml b/src/librustc_data_structures/Cargo.toml index 065c8436ae0..e79b3a81b96 100644 --- a/src/librustc_data_structures/Cargo.toml +++ b/src/librustc_data_structures/Cargo.toml @@ -23,7 +23,7 @@ stable_deref_trait = "1.0.0" rayon = { version = "0.3.0", package = "rustc-rayon" } rayon-core = { version = "0.3.0", package = "rustc-rayon-core" } rustc-hash = "1.0.1" -smallvec = { version = "0.6.7", features = ["union", "may_dangle"] } +smallvec = { version = "1.0", features = ["union", "may_dangle"] } rustc_index = { path = "../librustc_index", package = "rustc_index" } [dependencies.parking_lot] diff --git a/src/librustc_index/Cargo.toml b/src/librustc_index/Cargo.toml index b1ebc95e488..1435297f27a 100644 --- a/src/librustc_index/Cargo.toml +++ b/src/librustc_index/Cargo.toml @@ -11,4 +11,4 @@ doctest = false [dependencies] rustc_serialize = { path = "../libserialize", package = "serialize" } -smallvec = { version = "0.6.7", features = ["union", "may_dangle"] } +smallvec = { version = "1.0", features = ["union", "may_dangle"] } diff --git a/src/librustc_interface/Cargo.toml b/src/librustc_interface/Cargo.toml index 0d8d765a572..98e4f974a9f 100644 --- a/src/librustc_interface/Cargo.toml +++ b/src/librustc_interface/Cargo.toml @@ -12,7 +12,7 @@ doctest = false [dependencies] log = "0.4" rayon = { version = "0.3.0", package = "rustc-rayon" } -smallvec = { version = "0.6.7", features = ["union", "may_dangle"] } +smallvec = { version = "1.0", features = ["union", "may_dangle"] } syntax = { path = "../libsyntax" } syntax_ext = { path = "../libsyntax_ext" } syntax_expand = { path = "../libsyntax_expand" } diff --git a/src/librustc_metadata/Cargo.toml b/src/librustc_metadata/Cargo.toml index 18192e35f8a..5bc047e001b 100644 --- a/src/librustc_metadata/Cargo.toml +++ b/src/librustc_metadata/Cargo.toml @@ -13,7 +13,7 @@ doctest = false flate2 = "1.0" log = "0.4" memmap = "0.6" -smallvec = { version = "0.6.7", features = ["union", "may_dangle"] } +smallvec = { version = "1.0", features = ["union", "may_dangle"] } rustc = { path = "../librustc" } rustc_data_structures = { path = "../librustc_data_structures" } errors = { path = "../librustc_errors", package = "rustc_errors" } diff --git a/src/librustc_mir/Cargo.toml b/src/librustc_mir/Cargo.toml index f0cdcf2136b..8c62640353a 100644 --- a/src/librustc_mir/Cargo.toml +++ b/src/librustc_mir/Cargo.toml @@ -26,4 +26,4 @@ rustc_serialize = { path = "../libserialize", package = "serialize" } syntax = { path = "../libsyntax" } syntax_pos = { path = "../libsyntax_pos" } rustc_apfloat = { path = "../librustc_apfloat" } -smallvec = { version = "0.6.7", features = ["union", "may_dangle"] } +smallvec = { version = "1.0", features = ["union", "may_dangle"] } diff --git a/src/librustc_resolve/Cargo.toml b/src/librustc_resolve/Cargo.toml index 08ce7fd520e..33b2bd36b7d 100644 --- a/src/librustc_resolve/Cargo.toml +++ b/src/librustc_resolve/Cargo.toml @@ -21,4 +21,4 @@ errors = { path = "../librustc_errors", package = "rustc_errors" } syntax_pos = { path = "../libsyntax_pos" } rustc_data_structures = { path = "../librustc_data_structures" } rustc_metadata = { path = "../librustc_metadata" } -smallvec = { version = "0.6.7", features = ["union", "may_dangle"] } +smallvec = { version = "1.0", features = ["union", "may_dangle"] } diff --git a/src/librustc_traits/Cargo.toml b/src/librustc_traits/Cargo.toml index b86a3a5e963..a9b184a7b30 100644 --- a/src/librustc_traits/Cargo.toml +++ b/src/librustc_traits/Cargo.toml @@ -16,4 +16,4 @@ rustc_target = { path = "../librustc_target" } syntax = { path = "../libsyntax" } syntax_pos = { path = "../libsyntax_pos" } chalk-engine = { version = "0.9.0", default-features=false } -smallvec = { version = "0.6.7", features = ["union", "may_dangle"] } +smallvec = { version = "1.0", features = ["union", "may_dangle"] } diff --git a/src/librustc_typeck/Cargo.toml b/src/librustc_typeck/Cargo.toml index a6644258be2..60a7a2f4598 100644 --- a/src/librustc_typeck/Cargo.toml +++ b/src/librustc_typeck/Cargo.toml @@ -17,7 +17,7 @@ rustc = { path = "../librustc" } rustc_data_structures = { path = "../librustc_data_structures" } errors = { path = "../librustc_errors", package = "rustc_errors" } rustc_target = { path = "../librustc_target" } -smallvec = { version = "0.6.7", features = ["union", "may_dangle"] } +smallvec = { version = "1.0", features = ["union", "may_dangle"] } syntax = { path = "../libsyntax" } syntax_pos = { path = "../libsyntax_pos" } rustc_index = { path = "../librustc_index" } diff --git a/src/libserialize/Cargo.toml b/src/libserialize/Cargo.toml index c302bcf95dc..96a0d51bc71 100644 --- a/src/libserialize/Cargo.toml +++ b/src/libserialize/Cargo.toml @@ -10,4 +10,4 @@ path = "lib.rs" [dependencies] indexmap = "1" -smallvec = { version = "0.6.7", features = ["union", "may_dangle"] } +smallvec = { version = "1.0", features = ["union", "may_dangle"] } diff --git a/src/libsyntax/Cargo.toml b/src/libsyntax/Cargo.toml index 3ce47e6a7b8..b1839cc05cd 100644 --- a/src/libsyntax/Cargo.toml +++ b/src/libsyntax/Cargo.toml @@ -21,4 +21,4 @@ rustc_data_structures = { path = "../librustc_data_structures" } rustc_index = { path = "../librustc_index" } rustc_lexer = { path = "../librustc_lexer" } rustc_target = { path = "../librustc_target" } -smallvec = { version = "0.6.7", features = ["union", "may_dangle"] } +smallvec = { version = "1.0", features = ["union", "may_dangle"] } diff --git a/src/libsyntax/tokenstream.rs b/src/libsyntax/tokenstream.rs index 0559f224f1f..a220ba0a5ea 100644 --- a/src/libsyntax/tokenstream.rs +++ b/src/libsyntax/tokenstream.rs @@ -253,7 +253,7 @@ impl TokenStream { // Get the first stream. If it's `None`, create an empty // stream. - let mut iter = streams.drain(); + let mut iter = streams.drain(..); let mut first_stream_lrc = iter.next().unwrap().0; // Append the elements to the first stream, after reserving diff --git a/src/libsyntax_expand/Cargo.toml b/src/libsyntax_expand/Cargo.toml index f063753f599..d98b9457a62 100644 --- a/src/libsyntax_expand/Cargo.toml +++ b/src/libsyntax_expand/Cargo.toml @@ -22,5 +22,5 @@ rustc_data_structures = { path = "../librustc_data_structures" } rustc_index = { path = "../librustc_index" } rustc_lexer = { path = "../librustc_lexer" } rustc_target = { path = "../librustc_target" } -smallvec = { version = "0.6.7", features = ["union", "may_dangle"] } +smallvec = { version = "1.0", features = ["union", "may_dangle"] } syntax = { path = "../libsyntax" } diff --git a/src/libsyntax_ext/Cargo.toml b/src/libsyntax_ext/Cargo.toml index 440873f3c2b..703d51e1c4c 100644 --- a/src/libsyntax_ext/Cargo.toml +++ b/src/libsyntax_ext/Cargo.toml @@ -15,7 +15,7 @@ fmt_macros = { path = "../libfmt_macros" } log = "0.4" rustc_data_structures = { path = "../librustc_data_structures" } rustc_target = { path = "../librustc_target" } -smallvec = { version = "0.6.7", features = ["union", "may_dangle"] } +smallvec = { version = "1.0", features = ["union", "may_dangle"] } syntax = { path = "../libsyntax" } syntax_expand = { path = "../libsyntax_expand" } syntax_pos = { path = "../libsyntax_pos" } -- cgit 1.4.1-3-g733a5 From ad550b8ef32e336ad74a87669de041eba9f7d1c6 Mon Sep 17 00:00:00 2001 From: Andy Russell Date: Tue, 5 Nov 2019 15:10:24 -0500 Subject: use American spelling for `pluralize!` --- src/librustc/lint/builtin.rs | 4 ++-- src/librustc/middle/resolve_lifetime.rs | 4 ++-- src/librustc/traits/error_reporting.rs | 4 ++-- src/librustc/ty/error.rs | 14 +++++++------- src/librustc_errors/emitter.rs | 4 ++-- src/librustc_errors/lib.rs | 2 +- src/librustc_lint/unused.rs | 4 ++-- src/librustc_mir/hair/pattern/check_match.rs | 2 +- src/librustc_resolve/check_unused.rs | 4 ++-- src/librustc_resolve/resolve_imports.rs | 4 ++-- src/librustc_typeck/astconv.rs | 6 +++--- src/librustc_typeck/check/compare_method.rs | 10 +++++----- src/librustc_typeck/check/expr.rs | 4 ++-- src/librustc_typeck/check/method/suggest.rs | 4 ++-- src/librustc_typeck/check/mod.rs | 4 ++-- src/librustc_typeck/check/pat.rs | 14 +++++++------- src/libsyntax/parse/parser/diagnostics.rs | 6 +++--- src/libsyntax/parse/parser/path.rs | 6 +++--- src/libsyntax/parse/parser/ty.rs | 4 ++-- src/libsyntax_expand/mbe/transcribe.rs | 6 +++--- src/libsyntax_ext/format.rs | 4 ++-- 21 files changed, 57 insertions(+), 57 deletions(-) (limited to 'src/libsyntax_expand') diff --git a/src/librustc/lint/builtin.rs b/src/librustc/lint/builtin.rs index 5c871bb6b69..65777fe78db 100644 --- a/src/librustc/lint/builtin.rs +++ b/src/librustc/lint/builtin.rs @@ -7,7 +7,7 @@ use crate::lint::{LintPass, LateLintPass, LintArray, FutureIncompatibleInfo}; use crate::middle::stability; use crate::session::Session; -use errors::{Applicability, DiagnosticBuilder, pluralise}; +use errors::{Applicability, DiagnosticBuilder, pluralize}; use syntax::ast; use syntax::edition::Edition; use syntax::source_map::Span; @@ -651,7 +651,7 @@ pub(crate) fn add_elided_lifetime_in_path_suggestion( }; db.span_suggestion( replace_span, - &format!("indicate the anonymous lifetime{}", pluralise!(n)), + &format!("indicate the anonymous lifetime{}", pluralize!(n)), suggestion, Applicability::MachineApplicable ); diff --git a/src/librustc/middle/resolve_lifetime.rs b/src/librustc/middle/resolve_lifetime.rs index a122d84a5aa..488d6332f7e 100644 --- a/src/librustc/middle/resolve_lifetime.rs +++ b/src/librustc/middle/resolve_lifetime.rs @@ -17,7 +17,7 @@ use crate::ty::{self, DefIdTree, GenericParamDefKind, TyCtxt}; use crate::rustc::lint; use crate::session::Session; use crate::util::nodemap::{DefIdMap, FxHashMap, FxHashSet, HirIdMap, HirIdSet}; -use errors::{Applicability, DiagnosticBuilder, pluralise}; +use errors::{Applicability, DiagnosticBuilder, pluralize}; use rustc_macros::HashStable; use std::borrow::Cow; use std::cell::Cell; @@ -3044,7 +3044,7 @@ pub fn report_missing_lifetime_specifiers( span, E0106, "missing lifetime specifier{}", - pluralise!(count) + pluralize!(count) ) } diff --git a/src/librustc/traits/error_reporting.rs b/src/librustc/traits/error_reporting.rs index 1f7bce1c644..080ca8dfa73 100644 --- a/src/librustc/traits/error_reporting.rs +++ b/src/librustc/traits/error_reporting.rs @@ -33,7 +33,7 @@ use crate::ty::subst::Subst; use crate::ty::SubtypePredicate; use crate::util::nodemap::{FxHashMap, FxHashSet}; -use errors::{Applicability, DiagnosticBuilder, pluralise}; +use errors::{Applicability, DiagnosticBuilder, pluralize}; use std::fmt; use syntax::ast; use syntax::symbol::{sym, kw}; @@ -1553,7 +1553,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> { _ => format!("{} {}argument{}", arg_length, if distinct && arg_length > 1 { "distinct " } else { "" }, - pluralise!(arg_length)) + pluralize!(arg_length)) } }; diff --git a/src/librustc/ty/error.rs b/src/librustc/ty/error.rs index 77613b548cf..6af265f4901 100644 --- a/src/librustc/ty/error.rs +++ b/src/librustc/ty/error.rs @@ -4,7 +4,7 @@ use std::borrow::Cow; use std::fmt; use rustc_target::spec::abi; use syntax::ast; -use syntax::errors::pluralise; +use syntax::errors::pluralize; use errors::{Applicability, DiagnosticBuilder}; use syntax_pos::Span; @@ -100,17 +100,17 @@ impl<'tcx> fmt::Display for TypeError<'tcx> { write!(f, "expected a tuple with {} element{}, \ found one with {} element{}", values.expected, - pluralise!(values.expected), + pluralize!(values.expected), values.found, - pluralise!(values.found)) + pluralize!(values.found)) } FixedArraySize(values) => { write!(f, "expected an array with a fixed size of {} element{}, \ found one with {} element{}", values.expected, - pluralise!(values.expected), + pluralize!(values.expected), values.found, - pluralise!(values.found)) + pluralize!(values.found)) } ArgCount => { write!(f, "incorrect number of function parameters") @@ -165,7 +165,7 @@ impl<'tcx> fmt::Display for TypeError<'tcx> { ProjectionBoundsLength(ref values) => { write!(f, "expected {} associated type binding{}, found {}", values.expected, - pluralise!(values.expected), + pluralize!(values.expected), values.found) }, ExistentialMismatch(ref values) => { @@ -196,7 +196,7 @@ impl<'tcx> ty::TyS<'tcx> { let n = tcx.lift(&n).unwrap(); match n.try_eval_usize(tcx, ty::ParamEnv::empty()) { Some(n) => { - format!("array of {} element{}", n, pluralise!(n)).into() + format!("array of {} element{}", n, pluralize!(n)).into() } None => "array".into(), } diff --git a/src/librustc_errors/emitter.rs b/src/librustc_errors/emitter.rs index b153f0f0e82..de00df2765a 100644 --- a/src/librustc_errors/emitter.rs +++ b/src/librustc_errors/emitter.rs @@ -12,7 +12,7 @@ use Destination::*; use syntax_pos::{SourceFile, Span, MultiSpan}; use crate::{ - Level, CodeSuggestion, Diagnostic, SubDiagnostic, pluralise, + Level, CodeSuggestion, Diagnostic, SubDiagnostic, pluralize, SuggestionStyle, SourceMapper, SourceMapperDyn, DiagnosticId, }; use crate::Level::Error; @@ -1573,7 +1573,7 @@ impl EmitterWriter { } if suggestions.len() > MAX_SUGGESTIONS { let others = suggestions.len() - MAX_SUGGESTIONS; - let msg = format!("and {} other candidate{}", others, pluralise!(others)); + let msg = format!("and {} other candidate{}", others, pluralize!(others)); buffer.puts(row_num, max_line_num_len + 3, &msg, Style::NoStyle); } else if notice_capitalization { let msg = "notice the capitalization difference"; diff --git a/src/librustc_errors/lib.rs b/src/librustc_errors/lib.rs index 9743cf0d805..67c180a05e9 100644 --- a/src/librustc_errors/lib.rs +++ b/src/librustc_errors/lib.rs @@ -1027,7 +1027,7 @@ impl Level { } #[macro_export] -macro_rules! pluralise { +macro_rules! pluralize { ($x:expr) => { if $x != 1 { "s" } else { "" } }; diff --git a/src/librustc_lint/unused.rs b/src/librustc_lint/unused.rs index 3f85e6d772e..642b8e3279d 100644 --- a/src/librustc_lint/unused.rs +++ b/src/librustc_lint/unused.rs @@ -10,7 +10,7 @@ use lint::{LintPass, EarlyLintPass, LateLintPass}; use syntax::ast; use syntax::attr; -use syntax::errors::{Applicability, pluralise}; +use syntax::errors::{Applicability, pluralize}; use syntax::feature_gate::{AttributeType, BuiltinAttribute, BUILTIN_ATTRIBUTE_MAP}; use syntax::print::pprust; use syntax::symbol::{kw, sym}; @@ -144,7 +144,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnusedResults { return true; } - let plural_suffix = pluralise!(plural_len); + let plural_suffix = pluralize!(plural_len); match ty.kind { ty::Adt(..) if ty.is_box() => { diff --git a/src/librustc_mir/hair/pattern/check_match.rs b/src/librustc_mir/hair/pattern/check_match.rs index 9d370554e86..29423536e65 100644 --- a/src/librustc_mir/hair/pattern/check_match.rs +++ b/src/librustc_mir/hair/pattern/check_match.rs @@ -548,7 +548,7 @@ fn joined_uncovered_patterns(witnesses: &[super::Pat<'_>]) -> String { } fn pattern_not_covered_label(witnesses: &[super::Pat<'_>], joined_patterns: &str) -> String { - format!("pattern{} {} not covered", rustc_errors::pluralise!(witnesses.len()), joined_patterns) + format!("pattern{} {} not covered", rustc_errors::pluralize!(witnesses.len()), joined_patterns) } /// Point at the definition of non-covered `enum` variants. diff --git a/src/librustc_resolve/check_unused.rs b/src/librustc_resolve/check_unused.rs index 44b7a9fa047..0624b5eedfb 100644 --- a/src/librustc_resolve/check_unused.rs +++ b/src/librustc_resolve/check_unused.rs @@ -26,7 +26,7 @@ use crate::Resolver; use crate::resolve_imports::ImportDirectiveSubclass; -use errors::pluralise; +use errors::pluralize; use rustc::util::nodemap::NodeMap; use rustc::{lint, ty}; @@ -297,7 +297,7 @@ impl Resolver<'_> { }).collect::>(); span_snippets.sort(); let msg = format!("unused import{}{}", - pluralise!(len), + pluralize!(len), if !span_snippets.is_empty() { format!(": {}", span_snippets.join(", ")) } else { diff --git a/src/librustc_resolve/resolve_imports.rs b/src/librustc_resolve/resolve_imports.rs index c39f0c90f98..c06be18dc2c 100644 --- a/src/librustc_resolve/resolve_imports.rs +++ b/src/librustc_resolve/resolve_imports.rs @@ -11,7 +11,7 @@ use crate::{Resolver, ResolutionError, BindingKey, Segment, ModuleKind}; use crate::{names_to_string, module_to_string}; use crate::diagnostics::Suggestion; -use errors::{Applicability, pluralise}; +use errors::{Applicability, pluralize}; use rustc_data_structures::ptr_key::PtrKey; use rustc::ty; @@ -730,7 +730,7 @@ impl<'a, 'b> ImportResolver<'a, 'b> { let msg = format!( "unresolved import{} {}", - pluralise!(paths.len()), + pluralize!(paths.len()), paths.join(", "), ); diff --git a/src/librustc_typeck/astconv.rs b/src/librustc_typeck/astconv.rs index b14121da79f..5c661513382 100644 --- a/src/librustc_typeck/astconv.rs +++ b/src/librustc_typeck/astconv.rs @@ -23,7 +23,7 @@ use rustc_target::spec::abi; use crate::require_c_abi_if_c_variadic; use smallvec::SmallVec; use syntax::ast; -use syntax::errors::pluralise; +use syntax::errors::pluralize; use syntax::feature_gate::{GateIssue, emit_feature_err}; use syntax::util::lev_distance::find_best_match_for_name; use syntax::symbol::sym; @@ -392,7 +392,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o { quantifier, bound, kind, - pluralise!(bound), + pluralize!(bound), )) }; @@ -1360,7 +1360,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o { span, E0191, "the value of the associated type{} {} must be specified", - pluralise!(associated_types.len()), + pluralize!(associated_types.len()), names, ); let (suggest, potential_assoc_types_spans) = diff --git a/src/librustc_typeck/check/compare_method.rs b/src/librustc_typeck/check/compare_method.rs index 6818d5f521d..af0943db4cc 100644 --- a/src/librustc_typeck/check/compare_method.rs +++ b/src/librustc_typeck/check/compare_method.rs @@ -10,7 +10,7 @@ use rustc::util::common::ErrorReported; use errors::{Applicability, DiagnosticId}; use syntax_pos::Span; -use syntax::errors::pluralise; +use syntax::errors::pluralize; use super::{Inherited, FnCtxt, potentially_plural_count}; @@ -649,9 +649,9 @@ fn compare_number_of_generics<'tcx>( declaration has {} {kind} parameter{}", trait_.ident, impl_count, - pluralise!(impl_count), + pluralize!(impl_count), trait_count, - pluralise!(trait_count), + pluralize!(trait_count), kind = kind, ), DiagnosticId::Error("E0049".into()), @@ -666,7 +666,7 @@ fn compare_number_of_generics<'tcx>( "expected {} {} parameter{}", trait_count, kind, - pluralise!(trait_count), + pluralize!(trait_count), )); } for span in spans { @@ -681,7 +681,7 @@ fn compare_number_of_generics<'tcx>( "found {} {} parameter{}{}", impl_count, kind, - pluralise!(impl_count), + pluralize!(impl_count), suffix.unwrap_or_else(|| String::new()), )); } diff --git a/src/librustc_typeck/check/expr.rs b/src/librustc_typeck/check/expr.rs index 8668dd99a8c..2428429c4dd 100644 --- a/src/librustc_typeck/check/expr.rs +++ b/src/librustc_typeck/check/expr.rs @@ -17,7 +17,7 @@ use crate::util::common::ErrorReported; use crate::util::nodemap::FxHashMap; use crate::astconv::AstConv as _; -use errors::{Applicability, DiagnosticBuilder, pluralise}; +use errors::{Applicability, DiagnosticBuilder, pluralize}; use syntax_pos::hygiene::DesugaringKind; use syntax::ast; use syntax::symbol::{Symbol, kw, sym}; @@ -1210,7 +1210,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { struct_span_err!(tcx.sess, span, E0063, "missing field{} {}{} in initializer of `{}`", - pluralise!(remaining_fields.len()), + pluralize!(remaining_fields.len()), remaining_fields_names, truncated_fields_error, adt_ty) diff --git a/src/librustc_typeck/check/method/suggest.rs b/src/librustc_typeck/check/method/suggest.rs index d90ed2a790b..9e22979b855 100644 --- a/src/librustc_typeck/check/method/suggest.rs +++ b/src/librustc_typeck/check/method/suggest.rs @@ -5,7 +5,7 @@ use crate::check::FnCtxt; use crate::middle::lang_items::FnOnceTraitLangItem; use crate::namespace::Namespace; use crate::util::nodemap::FxHashSet; -use errors::{Applicability, DiagnosticBuilder, pluralise}; +use errors::{Applicability, DiagnosticBuilder, pluralize}; use rustc::hir::{self, ExprKind, Node, QPath}; use rustc::hir::def::{Res, DefKind}; use rustc::hir::def_id::{CRATE_DEF_INDEX, LOCAL_CRATE, DefId}; @@ -601,7 +601,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { "{an}other candidate{s} {were} found in the following trait{s}, perhaps \ add a `use` for {one_of_them}:", an = if candidates.len() == 1 {"an" } else { "" }, - s = pluralise!(candidates.len()), + s = pluralize!(candidates.len()), were = if candidates.len() == 1 { "was" } else { "were" }, one_of_them = if candidates.len() == 1 { "it" diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs index a2af29aef09..14d21fc217f 100644 --- a/src/librustc_typeck/check/mod.rs +++ b/src/librustc_typeck/check/mod.rs @@ -88,7 +88,7 @@ pub mod intrinsic; mod op; use crate::astconv::{AstConv, PathSeg}; -use errors::{Applicability, DiagnosticBuilder, DiagnosticId, pluralise}; +use errors::{Applicability, DiagnosticBuilder, DiagnosticId, pluralize}; use rustc::hir::{self, ExprKind, GenericArg, ItemKind, Node, PatKind, QPath}; use rustc::hir::def::{CtorOf, Res, DefKind}; use rustc::hir::def_id::{CrateNum, DefId, LOCAL_CRATE}; @@ -5167,5 +5167,5 @@ fn fatally_break_rust(sess: &Session) { } fn potentially_plural_count(count: usize, word: &str) -> String { - format!("{} {}{}", count, word, pluralise!(count)) + format!("{} {}{}", count, word, pluralize!(count)) } diff --git a/src/librustc_typeck/check/pat.rs b/src/librustc_typeck/check/pat.rs index 950ae7c1d62..292e55e6608 100644 --- a/src/librustc_typeck/check/pat.rs +++ b/src/librustc_typeck/check/pat.rs @@ -1,6 +1,6 @@ use crate::check::FnCtxt; use crate::util::nodemap::FxHashMap; -use errors::{Applicability, DiagnosticBuilder, pluralise}; +use errors::{Applicability, DiagnosticBuilder, pluralize}; use rustc::hir::{self, PatKind, Pat, HirId}; use rustc::hir::def::{Res, DefKind, CtorKind}; use rustc::hir::pat_util::EnumerateAndAdjustIterator; @@ -703,8 +703,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { fields: &[ty::FieldDef], expected: Ty<'tcx> ) { - let subpats_ending = pluralise!(subpats.len()); - let fields_ending = pluralise!(fields.len()); + let subpats_ending = pluralize!(subpats.len()); + let fields_ending = pluralize!(fields.len()); let res_span = self.tcx.def_span(res.def_id()); let mut err = struct_span_err!( self.tcx.sess, @@ -1174,10 +1174,10 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { E0527, "pattern requires {} element{} but array has {}", min_len, - pluralise!(min_len), + pluralize!(min_len), size, ) - .span_label(span, format!("expected {} element{}", size, pluralise!(size))) + .span_label(span, format!("expected {} element{}", size, pluralize!(size))) .emit(); } @@ -1188,14 +1188,14 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { E0528, "pattern requires at least {} element{} but array has {}", min_len, - pluralise!(min_len), + pluralize!(min_len), size, ).span_label( span, format!( "pattern cannot match array of {} element{}", size, - pluralise!(size), + pluralize!(size), ), ).emit(); } diff --git a/src/libsyntax/parse/parser/diagnostics.rs b/src/libsyntax/parse/parser/diagnostics.rs index fcf3b4c0aa8..376916c371f 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/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`, /// `IDENT<::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, ); diff --git a/src/libsyntax_expand/mbe/transcribe.rs b/src/libsyntax_expand/mbe/transcribe.rs index 94523bbf91b..6f060103ef4 100644 --- a/src/libsyntax_expand/mbe/transcribe.rs +++ b/src/libsyntax_expand/mbe/transcribe.rs @@ -9,7 +9,7 @@ use syntax::tokenstream::{DelimSpan, TokenStream, TokenTree, TreeAndJoint}; use smallvec::{smallvec, SmallVec}; -use errors::pluralise; +use errors::pluralize; use rustc_data_structures::fx::FxHashMap; use rustc_data_structures::sync::Lrc; use syntax_pos::hygiene::{ExpnId, Transparency}; @@ -350,10 +350,10 @@ impl LockstepIterSize { "meta-variable `{}` repeats {} time{}, but `{}` repeats {} time{}", l_id, l_len, - pluralise!(l_len), + pluralize!(l_len), r_id, r_len, - pluralise!(r_len), + pluralize!(r_len), ); LockstepIterSize::Contradiction(msg) } diff --git a/src/libsyntax_ext/format.rs b/src/libsyntax_ext/format.rs index 37310f46f7e..bdc8b959191 100644 --- a/src/libsyntax_ext/format.rs +++ b/src/libsyntax_ext/format.rs @@ -5,7 +5,7 @@ use fmt_macros as parse; use errors::DiagnosticBuilder; use errors::Applicability; -use errors::pluralise; +use errors::pluralize; use syntax::ast; use syntax_expand::base::{self, *}; @@ -300,7 +300,7 @@ impl<'a, 'b> Context<'a, 'b> { &format!( "{} positional argument{} in format string, but {}", count, - pluralise!(count), + pluralize!(count), self.describe_num_args(), ), ); -- cgit 1.4.1-3-g733a5