about summary refs log tree commit diff
path: root/compiler/rustc_lint/src
diff options
context:
space:
mode:
authorlcnr <rust@lcnr.de>2023-03-15 14:36:10 +0100
committerlcnr <rust@lcnr.de>2023-03-21 09:57:22 +0100
commitb8541eb76769798cc34908dc815cc17b6a7a91bc (patch)
tree1b38d11c6a6ac2045545e9c04b138c298d4aeef1 /compiler/rustc_lint/src
parentc63861b9d5a91b827c5c8164e24ee556dd790bbe (diff)
downloadrust-b8541eb76769798cc34908dc815cc17b6a7a91bc.tar.gz
rust-b8541eb76769798cc34908dc815cc17b6a7a91bc.zip
use the correct param env
Diffstat (limited to 'compiler/rustc_lint/src')
-rw-r--r--compiler/rustc_lint/src/for_loops_over_fallibles.rs3
1 files changed, 1 insertions, 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 cb7711034ed..7b58bf03bbe 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,