diff options
| author | bors <bors@rust-lang.org> | 2018-08-31 03:35:33 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2018-08-31 03:35:33 +0000 |
| commit | 1114ab684fbad001c4e580326d8eb4d8c4e917d3 (patch) | |
| tree | ca7e8212e95a1a99912f17d9df0c0313f75b8a0b /src/libsyntax_ext | |
| parent | 8adc69a5a873dd7e840b7d002ae48a4c638ef7ee (diff) | |
| parent | 6b1fffae20ce2c542fb6ee860b3ecfadd055abd2 (diff) | |
| download | rust-1114ab684fbad001c4e580326d8eb4d8c4e917d3.tar.gz rust-1114ab684fbad001c4e580326d8eb4d8c4e917d3.zip | |
Auto merge of #53832 - pietroalbini:rollup, r=pietroalbini
Rollup of 20 pull requests
Successful merges:
- #51760 (Add another PartialEq example)
- #53113 (Add example for Cow)
- #53129 (remove `let x = baz` which was obscuring the real error)
- #53389 (document effect of join on memory ordering)
- #53472 (Use FxHash{Map,Set} instead of the default Hash{Map,Set} everywhere in rustc.)
- #53476 (Add partialeq implementation for TryFromIntError type)
- #53513 (Force-inline `shallow_resolve` at its hottest call site.)
- #53655 (set applicability)
- #53702 (Fix stabilisation version for macro_vis_matcher.)
- #53727 (Do not suggest dereferencing in macro)
- #53732 (save-analysis: Differentiate foreign functions and statics.)
- #53740 (add llvm-readobj to llvm-tools-preview)
- #53743 (fix a typo: taget_env -> target_env)
- #53747 (Rustdoc fixes)
- #53753 (expand keep-stage --help text)
- #53756 (Fix typo in comment)
- #53768 (move file-extension based .gitignore down to src/)
- #53785 (Fix a comment in src/libcore/slice/mod.rs)
- #53786 (Replace usages of 'bad_style' with 'nonstandard_style'.)
- #53806 (Fix UI issues on Implementations on Foreign types)
Failed merges:
r? @ghost
Diffstat (limited to 'src/libsyntax_ext')
| -rw-r--r-- | src/libsyntax_ext/format.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/libsyntax_ext/format.rs b/src/libsyntax_ext/format.rs index b23c2ec3db1..efe9c2cefde 100644 --- a/src/libsyntax_ext/format.rs +++ b/src/libsyntax_ext/format.rs @@ -24,9 +24,9 @@ use syntax::tokenstream; use syntax_pos::{MultiSpan, Span, DUMMY_SP}; use errors::Applicability; +use rustc_data_structures::fx::{FxHashMap, FxHashSet}; use std::borrow::Cow; use std::collections::hash_map::Entry; -use std::collections::{HashMap, HashSet}; #[derive(PartialEq)] enum ArgumentType { @@ -65,7 +65,7 @@ struct Context<'a, 'b: 'a> { /// Unique format specs seen for each argument. arg_unique_types: Vec<Vec<ArgumentType>>, /// Map from named arguments to their resolved indices. - names: HashMap<String, usize>, + names: FxHashMap<String, usize>, /// The latest consecutive literal strings, or empty if there weren't any. literal: String, @@ -104,7 +104,7 @@ struct Context<'a, 'b: 'a> { /// * `count_args`: `vec![Exact(0), Exact(5), Exact(3)]` count_args: Vec<Position>, /// Relative slot numbers for count arguments. - count_positions: HashMap<usize, usize>, + count_positions: FxHashMap<usize, usize>, /// Number of count slots assigned. count_positions_count: usize, @@ -134,9 +134,9 @@ struct Context<'a, 'b: 'a> { fn parse_args(ecx: &mut ExtCtxt, sp: Span, tts: &[tokenstream::TokenTree]) - -> Option<(P<ast::Expr>, Vec<P<ast::Expr>>, HashMap<String, usize>)> { + -> Option<(P<ast::Expr>, Vec<P<ast::Expr>>, FxHashMap<String, usize>)> { let mut args = Vec::<P<ast::Expr>>::new(); - let mut names = HashMap::<String, usize>::new(); + let mut names = FxHashMap::<String, usize>::default(); let mut p = ecx.new_parser_from_tts(tts); @@ -768,7 +768,7 @@ pub fn expand_preparsed_format_args(ecx: &mut ExtCtxt, sp: Span, efmt: P<ast::Expr>, args: Vec<P<ast::Expr>>, - names: HashMap<String, usize>, + names: FxHashMap<String, usize>, append_newline: bool) -> P<ast::Expr> { // NOTE: this verbose way of initializing `Vec<Vec<ArgumentType>>` is because @@ -852,7 +852,7 @@ pub fn expand_preparsed_format_args(ecx: &mut ExtCtxt, curpiece: 0, arg_index_map: Vec::new(), count_args: Vec::new(), - count_positions: HashMap::new(), + count_positions: FxHashMap::default(), count_positions_count: 0, count_args_index_offset: 0, literal: String::new(), @@ -952,7 +952,7 @@ pub fn expand_preparsed_format_args(ecx: &mut ExtCtxt, // The set of foreign substitutions we've explained. This prevents spamming the user // with `%d should be written as {}` over and over again. - let mut explained = HashSet::new(); + let mut explained = FxHashSet::default(); macro_rules! check_foreign { ($kind:ident) => {{ |
