about summary refs log tree commit diff
diff options
context:
space:
mode:
authorlcnr <rust@lcnr.de>2024-11-19 17:07:19 +0100
committerlcnr <rust@lcnr.de>2024-11-19 18:06:20 +0100
commitffd7a50314c81a0137d5b2b04b5c31dfb017f7ea (patch)
tree637bb7d24b8e9d771d5fa1b0887aa5aa8e3bf182
parent07a527247661ef8ef31dacf9c28928c62f8bb586 (diff)
downloadrust-ffd7a50314c81a0137d5b2b04b5c31dfb017f7ea.tar.gz
rust-ffd7a50314c81a0137d5b2b04b5c31dfb017f7ea.zip
impl trait overcaptures, yeet ` TypingMode::from_param_env`
-rw-r--r--compiler/rustc_lint/src/impl_trait_overcaptures.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_lint/src/impl_trait_overcaptures.rs b/compiler/rustc_lint/src/impl_trait_overcaptures.rs
index beab4d4e6a9..1aacdbd448c 100644
--- a/compiler/rustc_lint/src/impl_trait_overcaptures.rs
+++ b/compiler/rustc_lint/src/impl_trait_overcaptures.rs
@@ -15,7 +15,7 @@ use rustc_middle::ty::relate::{
     Relate, RelateResult, TypeRelation, structurally_relate_consts, structurally_relate_tys,
 };
 use rustc_middle::ty::{
-    self, Ty, TyCtxt, TypeSuperVisitable, TypeVisitable, TypeVisitableExt, TypeVisitor, TypingMode,
+    self, Ty, TyCtxt, TypeSuperVisitable, TypeVisitable, TypeVisitableExt, TypeVisitor,
 };
 use rustc_middle::{bug, span_bug};
 use rustc_session::lint::FutureIncompatibilityReason;
@@ -186,8 +186,8 @@ fn check_fn(tcx: TyCtxt<'_>, parent_def_id: LocalDefId) {
             functional_variances.variances
         }),
         outlives_env: LazyCell::new(|| {
-            let param_env = tcx.param_env(parent_def_id);
-            let infcx = tcx.infer_ctxt().build(TypingMode::from_param_env(param_env));
+            let typing_env = ty::TypingEnv::non_body_analysis(tcx, parent_def_id);
+            let (infcx, param_env) = tcx.infer_ctxt().build_with_typing_env(typing_env);
             let ocx = ObligationCtxt::new(&infcx);
             let assumed_wf_tys = ocx.assumed_wf_types(param_env, parent_def_id).unwrap_or_default();
             let implied_bounds =