Skip to content

Commit da79a56

Browse files
committed
Replace incorrect ArenaMap use with FxHashMap
1 parent 3148a4a commit da79a56

File tree

1 file changed

+3
-3
lines changed
  • src/tools/rust-analyzer/crates/hir-ty/src

1 file changed

+3
-3
lines changed

src/tools/rust-analyzer/crates/hir-ty/src/infer.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ pub struct InferenceResult<'db> {
498498
/// unresolved or missing subpatterns or subpatterns of mismatched types.
499499
pub(crate) type_of_pat: ArenaMap<PatId, Ty<'db>>,
500500
pub(crate) type_of_binding: ArenaMap<BindingId, Ty<'db>>,
501-
pub(crate) type_of_type_placeholder: ArenaMap<TypeRefId, Ty<'db>>,
501+
pub(crate) type_of_type_placeholder: FxHashMap<TypeRefId, Ty<'db>>,
502502
pub(crate) type_of_opaque: FxHashMap<InternedOpaqueTyId, Ty<'db>>,
503503

504504
pub(crate) type_mismatches: Option<Box<FxHashMap<ExprOrPatId, TypeMismatch<'db>>>>,
@@ -623,10 +623,10 @@ impl<'db> InferenceResult<'db> {
623623
)
624624
}
625625
pub fn placeholder_types(&self) -> impl Iterator<Item = (TypeRefId, &Ty<'db>)> {
626-
self.type_of_type_placeholder.iter()
626+
self.type_of_type_placeholder.iter().map(|(&type_ref, ty)| (type_ref, ty))
627627
}
628628
pub fn type_of_type_placeholder(&self, type_ref: TypeRefId) -> Option<Ty<'db>> {
629-
self.type_of_type_placeholder.get(type_ref).copied()
629+
self.type_of_type_placeholder.get(&type_ref).copied()
630630
}
631631
pub fn closure_info(&self, closure: InternedClosureId) -> &(Vec<CapturedItem<'db>>, FnTrait) {
632632
self.closure_info.get(&closure).unwrap()

0 commit comments

Comments
 (0)