use middle::lang_items;
use middle::resolve_lifetime::{self, ObjectLifetimeDefault};
use middle::stability;
-use mir::{self, Mir, interpret};
+use mir::{self, Mir, interpret, ProjectionKind};
use mir::interpret::Allocation;
use ty::subst::{CanonicalUserSubsts, Kind, Substs, Subst};
use ty::ReprOptions;
clauses: InternedSet<'tcx, List<Clause<'tcx>>>,
goal: InternedSet<'tcx, GoalKind<'tcx>>,
goal_list: InternedSet<'tcx, List<Goal<'tcx>>>,
+ projs: InternedSet<'tcx, List<ProjectionKind<'tcx>>>,
}
impl<'gcx: 'tcx, 'tcx> CtxtInterners<'tcx> {
clauses: Default::default(),
goal: Default::default(),
goal_list: Default::default(),
+ projs: Default::default(),
}
}
cstore,
global_arenas: &arenas.global,
global_interners: interners,
- dep_graph: dep_graph.clone(),
+ dep_graph,
types: common_types,
trait_map,
export_map: resolutions.export_map.into_iter().map(|(k, v)| {
}
}
+impl<'tcx: 'lcx, 'lcx> Borrow<[ProjectionKind<'lcx>]>
+ for Interned<'tcx, List<ProjectionKind<'tcx>>> {
+ fn borrow<'a>(&'a self) -> &'a [ProjectionKind<'lcx>] {
+ &self.0[..]
+ }
+}
+
impl<'tcx> Borrow<RegionKind> for Interned<'tcx, RegionKind> {
fn borrow<'a>(&'a self) -> &'a RegionKind {
&self.0
type_list: _intern_type_list(Ty),
substs: _intern_substs(Kind),
clauses: _intern_clauses(Clause),
- goal_list: _intern_goals(Goal)
+ goal_list: _intern_goals(Goal),
+ projs: _intern_projs(ProjectionKind)
);
// This isn't a perfect fit: CanonicalVarInfo slices are always
}
}
+ pub fn intern_projs(self, ps: &[ProjectionKind<'tcx>]) -> &'tcx List<ProjectionKind<'tcx>> {
+ if ps.len() == 0 {
+ List::empty()
+ } else {
+ self._intern_projs(ps)
+ }
+ }
+
pub fn intern_canonical_var_infos(self, ts: &[CanonicalVarInfo]) -> CanonicalVarInfos<'gcx> {
if ts.len() == 0 {
List::empty()