From b8541eb76769798cc34908dc815cc17b6a7a91bc Mon Sep 17 00:00:00 2001 From: lcnr Date: Wed, 15 Mar 2023 14:36:10 +0100 Subject: [PATCH] use the correct param env --- compiler/rustc_lint/src/for_loops_over_fallibles.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/compiler/rustc_lint/src/for_loops_over_fallibles.rs b/compiler/rustc_lint/src/for_loops_over_fallibles.rs index cb7711034ed6..7b58bf03bbea 100644 --- a/compiler/rustc_lint/src/for_loops_over_fallibles.rs +++ b/compiler/rustc_lint/src/for_loops_over_fallibles.rs @@ -148,8 +148,7 @@ fn suggest_question_mark<'tcx>( ocx.register_bound( cause, - // FIXME: using the empty param env is wrong, should use the one from `body_id`. - ty::ParamEnv::empty(), + cx.param_env, // Erase any region vids from the type, which may not be resolved infcx.tcx.erase_regions(ty), into_iterator_did,