hir typeck: fulfillment_cx
ignore regions
This commit is contained in:
parent
5bd8c960f5
commit
16b2acc7c0
2 changed files with 11 additions and 1 deletions
|
@ -15,6 +15,8 @@ use rustc_middle::ty::{self, Ty, TyCtxt};
|
||||||
|
|
||||||
pub trait TraitEngineExt<'tcx> {
|
pub trait TraitEngineExt<'tcx> {
|
||||||
fn new(tcx: TyCtxt<'tcx>) -> Box<Self>;
|
fn new(tcx: TyCtxt<'tcx>) -> Box<Self>;
|
||||||
|
|
||||||
|
fn new_ignoring_regions(tcx: TyCtxt<'tcx>) -> Box<Self>;
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'tcx> TraitEngineExt<'tcx> for dyn TraitEngine<'tcx> {
|
impl<'tcx> TraitEngineExt<'tcx> for dyn TraitEngine<'tcx> {
|
||||||
|
@ -25,6 +27,14 @@ impl<'tcx> TraitEngineExt<'tcx> for dyn TraitEngine<'tcx> {
|
||||||
Box::new(FulfillmentContext::new())
|
Box::new(FulfillmentContext::new())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn new_ignoring_regions(tcx: TyCtxt<'tcx>) -> Box<Self> {
|
||||||
|
if tcx.sess.opts.unstable_opts.chalk {
|
||||||
|
Box::new(ChalkFulfillmentContext::new())
|
||||||
|
} else {
|
||||||
|
Box::new(FulfillmentContext::new_ignoring_regions())
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Used if you want to have pleasant experience when dealing
|
/// Used if you want to have pleasant experience when dealing
|
||||||
|
|
|
@ -113,7 +113,7 @@ impl<'a, 'tcx> Inherited<'a, 'tcx> {
|
||||||
maybe_typeck_results: infcx.in_progress_typeck_results,
|
maybe_typeck_results: infcx.in_progress_typeck_results,
|
||||||
},
|
},
|
||||||
infcx,
|
infcx,
|
||||||
fulfillment_cx: RefCell::new(<dyn TraitEngine<'_>>::new(tcx)),
|
fulfillment_cx: RefCell::new(<dyn TraitEngine<'_>>::new_ignoring_regions(tcx)),
|
||||||
locals: RefCell::new(Default::default()),
|
locals: RefCell::new(Default::default()),
|
||||||
deferred_sized_obligations: RefCell::new(Vec::new()),
|
deferred_sized_obligations: RefCell::new(Vec::new()),
|
||||||
deferred_call_resolutions: RefCell::new(Default::default()),
|
deferred_call_resolutions: RefCell::new(Default::default()),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue