Skip to content

Commit

Permalink
Change concrete opaque type to be a VecMap
Browse files Browse the repository at this point in the history
  • Loading branch information
spastorino committed Jun 7, 2021
1 parent 2bc723f commit 3405725
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions compiler/rustc_middle/src/mir/query.rs
Expand Up @@ -2,8 +2,8 @@

use crate::mir::{abstract_const, Body, Promoted};
use crate::ty::{self, Ty, TyCtxt};
use rustc_data_structures::fx::FxHashMap;
use rustc_data_structures::sync::Lrc;
use rustc_data_structures::vec_map::VecMap;
use rustc_errors::ErrorReported;
use rustc_hir as hir;
use rustc_hir::def_id::{DefId, LocalDefId};
Expand Down Expand Up @@ -210,7 +210,7 @@ pub struct BorrowCheckResult<'tcx> {
/// All the opaque types that are restricted to concrete types
/// by this function. Unlike the value in `TypeckResults`, this has
/// unerased regions.
pub concrete_opaque_types: FxHashMap<DefId, ty::ResolvedOpaqueTy<'tcx>>,
pub concrete_opaque_types: VecMap<DefId, ty::ResolvedOpaqueTy<'tcx>>,
pub closure_requirements: Option<ClosureRegionRequirements<'tcx>>,
pub used_mut_upvars: SmallVec<[Field; 8]>,
}
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_middle/src/ty/context.rs
Expand Up @@ -34,6 +34,7 @@ use rustc_data_structures::sharded::{IntoPointer, ShardedHashMap};
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
use rustc_data_structures::steal::Steal;
use rustc_data_structures::sync::{self, Lock, Lrc, WorkerLocal};
use rustc_data_structures::vec_map::VecMap;
use rustc_errors::ErrorReported;
use rustc_hir as hir;
use rustc_hir::def::{DefKind, Res};
Expand Down Expand Up @@ -424,7 +425,7 @@ pub struct TypeckResults<'tcx> {

/// All the opaque types that are restricted to concrete types
/// by this function.
pub concrete_opaque_types: FxHashMap<DefId, ResolvedOpaqueTy<'tcx>>,
pub concrete_opaque_types: VecMap<DefId, ResolvedOpaqueTy<'tcx>>,

/// Tracks the minimum captures required for a closure;
/// see `MinCaptureInformationMap` for more details.
Expand Down
5 changes: 3 additions & 2 deletions compiler/rustc_mir/src/borrow_check/mod.rs
Expand Up @@ -2,6 +2,7 @@

use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use rustc_data_structures::graph::dominators::Dominators;
use rustc_data_structures::vec_map::VecMap;
use rustc_errors::{Applicability, Diagnostic, DiagnosticBuilder, ErrorReported};
use rustc_hir as hir;
use rustc_hir::def_id::LocalDefId;
Expand All @@ -25,7 +26,7 @@ use either::Either;
use smallvec::SmallVec;
use std::cell::RefCell;
use std::collections::BTreeMap;
use std::iter;
use std::iter::{self, FromIterator};
use std::mem;
use std::rc::Rc;

Expand Down Expand Up @@ -441,7 +442,7 @@ fn do_mir_borrowck<'a, 'tcx>(
}

let result = BorrowCheckResult {
concrete_opaque_types: opaque_type_values,
concrete_opaque_types: VecMap::from_iter(opaque_type_values.into_iter()),
closure_requirements: opt_closure_req,
used_mut_upvars: mbcx.used_mut_upvars,
};
Expand Down

0 comments on commit 3405725

Please sign in to comment.