Skip to content

Commit 96e6b2f

Browse files
author
Ariel Ben-Yehuda
committed
use an FnvHashSet instead of an HashSet in fulfill
this doesn't cause a measurable perf increase, but it makes callgrind output cleaner. Anyway, rustc should be using FNV everywhere.
1 parent 9b75a2b commit 96e6b2f

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/librustc/middle/traits/fulfill.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,10 @@ use middle::infer::InferCtxt;
1212
use middle::ty::{self, RegionEscape, Ty, HasTypeFlags};
1313
use middle::wf;
1414

15-
use std::collections::HashSet;
1615
use std::fmt;
1716
use syntax::ast;
1817
use util::common::ErrorReported;
19-
use util::nodemap::NodeMap;
18+
use util::nodemap::{FnvHashSet, NodeMap};
2019

2120
use super::CodeAmbiguity;
2221
use super::CodeProjectionError;
@@ -33,7 +32,7 @@ use super::Unimplemented;
3332
use super::util::predicate_for_builtin_bound;
3433

3534
pub struct FulfilledPredicates<'tcx> {
36-
set: HashSet<(RFC1214Warning, ty::Predicate<'tcx>)>
35+
set: FnvHashSet<(RFC1214Warning, ty::Predicate<'tcx>)>
3736
}
3837

3938
/// The fulfillment context is used to drive trait resolution. It
@@ -540,7 +539,7 @@ fn register_region_obligation<'tcx>(t_a: Ty<'tcx>,
540539
impl<'tcx> FulfilledPredicates<'tcx> {
541540
pub fn new() -> FulfilledPredicates<'tcx> {
542541
FulfilledPredicates {
543-
set: HashSet::new()
542+
set: FnvHashSet()
544543
}
545544
}
546545

0 commit comments

Comments
 (0)