diff options
| author | lcnr <rust@lcnr.de> | 2022-07-08 11:17:12 +0200 |
|---|---|---|
| committer | lcnr <rust@lcnr.de> | 2022-07-15 17:01:32 +0200 |
| commit | 16b2acc7c0d5188992065f369285a0fcd273dbfe (patch) | |
| tree | a54d76d29b7356ec82f3a4600d5a0e6c97f8d061 /compiler/rustc_trait_selection/src | |
| parent | 5bd8c960f5f7b07128ebdb12e7f788b1ba0a1902 (diff) | |
| download | rust-16b2acc7c0d5188992065f369285a0fcd273dbfe.tar.gz rust-16b2acc7c0d5188992065f369285a0fcd273dbfe.zip | |
hir typeck: `fulfillment_cx` ignore regions
Diffstat (limited to 'compiler/rustc_trait_selection/src')
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/engine.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/engine.rs b/compiler/rustc_trait_selection/src/traits/engine.rs index 6c177f63887..0f7dc6a1257 100644 --- a/compiler/rustc_trait_selection/src/traits/engine.rs +++ b/compiler/rustc_trait_selection/src/traits/engine.rs @@ -15,6 +15,8 @@ use rustc_middle::ty::{self, Ty, TyCtxt}; pub trait TraitEngineExt<'tcx> { fn new(tcx: TyCtxt<'tcx>) -> Box<Self>; + + fn new_ignoring_regions(tcx: TyCtxt<'tcx>) -> Box<Self>; } impl<'tcx> TraitEngineExt<'tcx> for dyn TraitEngine<'tcx> { @@ -25,6 +27,14 @@ impl<'tcx> TraitEngineExt<'tcx> for dyn TraitEngine<'tcx> { 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 |
