bring TyCtxt into scope
This commit is contained in:
parent
94211416bc
commit
d3bbce79d0
1 changed files with 4 additions and 4 deletions
|
@ -9,7 +9,7 @@
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
use hir::def_id::DefId;
|
use hir::def_id::DefId;
|
||||||
use ty::{self, Ty, TypeFoldable, Substs};
|
use ty::{self, Ty, TypeFoldable, Substs, TyCtxt};
|
||||||
use util::ppaux;
|
use util::ppaux;
|
||||||
|
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
@ -57,12 +57,12 @@ impl<'tcx> InstanceDef<'tcx> {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn def_ty<'a>(&self, tcx: ty::TyCtxt<'a, 'tcx, 'tcx>) -> Ty<'tcx> {
|
pub fn def_ty<'a>(&self, tcx: TyCtxt<'a, 'tcx, 'tcx>) -> Ty<'tcx> {
|
||||||
tcx.type_of(self.def_id())
|
tcx.type_of(self.def_id())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn attrs<'a>(&self, tcx: ty::TyCtxt<'a, 'tcx, 'tcx>) -> ty::Attributes<'tcx> {
|
pub fn attrs<'a>(&self, tcx: TyCtxt<'a, 'tcx, 'tcx>) -> ty::Attributes<'tcx> {
|
||||||
tcx.get_attrs(self.def_id())
|
tcx.get_attrs(self.def_id())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -103,7 +103,7 @@ impl<'a, 'b, 'tcx> Instance<'tcx> {
|
||||||
Instance { def: InstanceDef::Item(def_id), substs: substs }
|
Instance { def: InstanceDef::Item(def_id), substs: substs }
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn mono(tcx: ty::TyCtxt<'a, 'tcx, 'b>, def_id: DefId) -> Instance<'tcx> {
|
pub fn mono(tcx: TyCtxt<'a, 'tcx, 'b>, def_id: DefId) -> Instance<'tcx> {
|
||||||
Instance::new(def_id, tcx.global_tcx().empty_substs_for_def_id(def_id))
|
Instance::new(def_id, tcx.global_tcx().empty_substs_for_def_id(def_id))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue