Skip to content

Commit 16b2acc

Browse files
committed
hir typeck: fulfillment_cx ignore regions
1 parent 5bd8c96 commit 16b2acc

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

Diff for: compiler/rustc_trait_selection/src/traits/engine.rs

+10
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ use rustc_middle::ty::{self, Ty, TyCtxt};
1515

1616
pub trait TraitEngineExt<'tcx> {
1717
fn new(tcx: TyCtxt<'tcx>) -> Box<Self>;
18+
19+
fn new_ignoring_regions(tcx: TyCtxt<'tcx>) -> Box<Self>;
1820
}
1921

2022
impl<'tcx> TraitEngineExt<'tcx> for dyn TraitEngine<'tcx> {
@@ -25,6 +27,14 @@ impl<'tcx> TraitEngineExt<'tcx> for dyn TraitEngine<'tcx> {
2527
Box::new(FulfillmentContext::new())
2628
}
2729
}
30+
31+
fn new_ignoring_regions(tcx: TyCtxt<'tcx>) -> Box<Self> {
32+
if tcx.sess.opts.unstable_opts.chalk {
33+
Box::new(ChalkFulfillmentContext::new())
34+
} else {
35+
Box::new(FulfillmentContext::new_ignoring_regions())
36+
}
37+
}
2838
}
2939

3040
/// Used if you want to have pleasant experience when dealing

Diff for: compiler/rustc_typeck/src/check/inherited.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ impl<'a, 'tcx> Inherited<'a, 'tcx> {
113113
maybe_typeck_results: infcx.in_progress_typeck_results,
114114
},
115115
infcx,
116-
fulfillment_cx: RefCell::new(<dyn TraitEngine<'_>>::new(tcx)),
116+
fulfillment_cx: RefCell::new(<dyn TraitEngine<'_>>::new_ignoring_regions(tcx)),
117117
locals: RefCell::new(Default::default()),
118118
deferred_sized_obligations: RefCell::new(Vec::new()),
119119
deferred_call_resolutions: RefCell::new(Default::default()),

0 commit comments

Comments
 (0)