Skip to content

Commit 82c0527

Browse files
committed
auto merge of #16628 : pczarn/rust/hashmap-opt, r=nikomatsakis
This is #15720, rebased and reopened. cc @nikomatsakis
2 parents 074d3da + 0ad4644 commit 82c0527

File tree

9 files changed

+3800
-3108
lines changed

9 files changed

+3800
-3108
lines changed

Diff for: src/librustc/lint/context.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,9 @@ impl LintStore {
103103
}
104104

105105
pub fn get_lint_groups<'t>(&'t self) -> Vec<(&'static str, Vec<LintId>, bool)> {
106-
self.lint_groups.iter().map(|(k, &(ref v, b))| (*k, v.clone(), b)).collect()
106+
self.lint_groups.iter().map(|(k, v)| (*k,
107+
v.ref0().clone(),
108+
*v.ref1())).collect()
107109
}
108110

109111
pub fn register_pass(&mut self, sess: Option<&Session>,
@@ -210,7 +212,7 @@ impl LintStore {
210212
match self.by_name.find_equiv(&lint_name.as_slice()) {
211213
Some(&lint_id) => self.set_level(lint_id, (level, CommandLine)),
212214
None => {
213-
match self.lint_groups.iter().map(|(&x, &(ref y, _))| (x, y.clone()))
215+
match self.lint_groups.iter().map(|(&x, pair)| (x, pair.ref0().clone()))
214216
.collect::<HashMap<&'static str, Vec<LintId>>>()
215217
.find_equiv(&lint_name.as_slice()) {
216218
Some(v) => {

Diff for: src/librustdoc/html/render.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ pub fn run(mut krate: clean::Crate, external_html: &ExternalHtml, dst: Path) ->
312312
}).unwrap_or(HashMap::new());
313313
let mut cache = Cache {
314314
impls: HashMap::new(),
315-
external_paths: paths.iter().map(|(&k, &(ref v, _))| (k, v.clone()))
315+
external_paths: paths.iter().map(|(&k, v)| (k, v.ref0().clone()))
316316
.collect(),
317317
paths: paths,
318318
implementors: HashMap::new(),

0 commit comments

Comments
 (0)