Skip to content

Commit ffd7a50

Browse files
committed
impl trait overcaptures, yeet TypingMode::from_param_env
1 parent 07a5272 commit ffd7a50

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: compiler/rustc_lint/src/impl_trait_overcaptures.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use rustc_middle::ty::relate::{
1515
Relate, RelateResult, TypeRelation, structurally_relate_consts, structurally_relate_tys,
1616
};
1717
use rustc_middle::ty::{
18-
self, Ty, TyCtxt, TypeSuperVisitable, TypeVisitable, TypeVisitableExt, TypeVisitor, TypingMode,
18+
self, Ty, TyCtxt, TypeSuperVisitable, TypeVisitable, TypeVisitableExt, TypeVisitor,
1919
};
2020
use rustc_middle::{bug, span_bug};
2121
use rustc_session::lint::FutureIncompatibilityReason;
@@ -186,8 +186,8 @@ fn check_fn(tcx: TyCtxt<'_>, parent_def_id: LocalDefId) {
186186
functional_variances.variances
187187
}),
188188
outlives_env: LazyCell::new(|| {
189-
let param_env = tcx.param_env(parent_def_id);
190-
let infcx = tcx.infer_ctxt().build(TypingMode::from_param_env(param_env));
189+
let typing_env = ty::TypingEnv::non_body_analysis(tcx, parent_def_id);
190+
let (infcx, param_env) = tcx.infer_ctxt().build_with_typing_env(typing_env);
191191
let ocx = ObligationCtxt::new(&infcx);
192192
let assumed_wf_tys = ocx.assumed_wf_types(param_env, parent_def_id).unwrap_or_default();
193193
let implied_bounds =

0 commit comments

Comments
 (0)