use crate::hair::*;
use crate::hair::util::UserAnnotatedTyHelpers;
-use rustc_data_structures::indexed_vec::Idx;
+use rustc_index::vec::Idx;
use rustc::hir::def_id::DefId;
use rustc::hir::Node;
use rustc::middle::region;
use rustc::infer::InferCtxt;
use rustc::ty::subst::Subst;
use rustc::ty::{self, Ty, TyCtxt};
-use rustc::ty::subst::{Kind, InternalSubsts};
+use rustc::ty::subst::{GenericArg, InternalSubsts};
use rustc::ty::layout::VariantIdx;
use syntax::ast;
use syntax::attr;
infcx,
root_lint_level: src_id,
param_env: tcx.param_env(src_def_id),
- identity_substs: InternalSubsts::identity_for_item(tcx.global_tcx(), src_def_id),
+ identity_substs: InternalSubsts::identity_for_item(tcx, src_def_id),
region_scope_tree: tcx.region_scope_tree(src_def_id),
tables,
constness,
}
}
- pub fn pattern_from_hir(&mut self, p: &hir::Pat) -> Pattern<'tcx> {
- let tcx = self.tcx.global_tcx();
- let p = match tcx.hir().get(p.hir_id) {
+ pub fn pattern_from_hir(&mut self, p: &hir::Pat) -> Pat<'tcx> {
+ let p = match self.tcx.hir().get(p.hir_id) {
Node::Pat(p) | Node::Binding(p) => p,
node => bug!("pattern became {:?}", node)
};
- Pattern::from_hir(tcx,
- self.param_env.and(self.identity_substs),
- self.tables(),
- p)
+ Pat::from_hir(self.tcx, self.param_env.and(self.identity_substs), self.tables(), p)
}
pub fn trait_method(&mut self,
trait_def_id: DefId,
method_name: Symbol,
self_ty: Ty<'tcx>,
- params: &[Kind<'tcx>])
+ params: &[GenericArg<'tcx>])
-> &'tcx ty::Const<'tcx> {
let substs = self.tcx.mk_substs_trait(self_ty, params);
for item in self.tcx.associated_items(trait_def_id) {
}
pub fn needs_drop(&mut self, ty: Ty<'tcx>) -> bool {
- ty.needs_drop(self.tcx.global_tcx(), self.param_env)
+ ty.needs_drop(self.tcx, self.param_env)
}
pub fn tcx(&self) -> TyCtxt<'tcx> {