}
}
- pub fn normalizing_infer_ctxt(self, projection_mode: Reveal)
- -> InferCtxtBuilder<'a, 'gcx, 'tcx> {
- InferCtxtBuilder {
- global_tcx: self,
- arenas: ty::CtxtArenas::new(),
- tables: None,
- param_env: None,
- projection_mode: projection_mode,
- }
- }
-
/// Fake InferCtxt with the global tcx. Used by pre-MIR borrowck
/// for MemCategorizationContext/ExprUseVisitor.
/// If any inference functionality is used, ICEs will occur.
.unwrap()
.subst(tcx, &penv.free_substs);
- let result = tcx.normalizing_infer_ctxt(Reveal::ExactMatch).enter(|mut infcx| {
+ let result = tcx.infer_ctxt(None, None, Reveal::ExactMatch).enter(|mut infcx| {
// Normalize the trait reference, adding any obligations
// that arise into the impl1 assumptions.
let Normalized { value: impl1_trait_ref, obligations: normalization_obligations } = {
if let hir::ItemEnum(ref enum_definition, ref gens) = it.node {
if gens.ty_params.is_empty() { // sizes only make sense for non-generic types
let t = cx.tcx.node_id_to_type(it.id);
- let layout = cx.tcx.normalizing_infer_ctxt(Reveal::All).enter(|infcx| {
+ let layout = cx.tcx.infer_ctxt(None, None, Reveal::All).enter(|infcx| {
let ty = cx.tcx.erase_regions(&t);
ty.layout(&infcx).unwrap_or_else(|e| {
bug!("failed to get layout for `{}`: {}", t, e)
// Do the initial selection for the obligation. This yields the
// shallow result we are looking for -- that is, what specific impl.
- tcx.normalizing_infer_ctxt(Reveal::All).enter(|infcx| {
+ tcx.infer_ctxt(None, None, Reveal::All).enter(|infcx| {
let mut selcx = SelectionContext::new(&infcx);
let obligation_cause = traits::ObligationCause::misc(span,
debug!("normalize_and_test_predicates(predicates={:?})",
predicates);
- tcx.normalizing_infer_ctxt(Reveal::All).enter(|infcx| {
+ tcx.infer_ctxt(None, None, Reveal::All).enter(|infcx| {
let mut selcx = SelectionContext::new(&infcx);
let mut fulfill_cx = traits::FulfillmentContext::new();
let cause = traits::ObligationCause::dummy();
}
pub fn layout_of(&self, ty: Ty<'tcx>) -> &'tcx ty::layout::Layout {
- self.tcx().normalizing_infer_ctxt(traits::Reveal::All).enter(|infcx| {
+ self.tcx().infer_ctxt(None, None, traits::Reveal::All).enter(|infcx| {
ty.layout(&infcx).unwrap_or_else(|e| {
bug!("failed to get layout for `{}`: {}", ty, e);
})
match t.sty {
ty::TyBox(typ) if !type_needs_drop(tcx, typ)
&& type_is_sized(tcx, typ) => {
- tcx.normalizing_infer_ctxt(traits::Reveal::All).enter(|infcx| {
+ tcx.infer_ctxt(None, None, traits::Reveal::All).enter(|infcx| {
let layout = t.layout(&infcx).unwrap();
if layout.size(&tcx.data_layout).bytes() == 0 {
// `Box<ZeroSizeType>` does not allocate.
match trait_def.ancestors(impl_def_id).fn_defs(tcx, name).next() {
Some(node_item) => {
- let substs = tcx.normalizing_infer_ctxt(Reveal::All).enter(|infcx| {
+ let substs = tcx.infer_ctxt(None, None, Reveal::All).enter(|infcx| {
let substs = substs.rebase_onto(tcx, trait_def_id, impl_substs);
let substs = traits::translate_substs(&infcx, impl_def_id,
substs, node_item.node);