use the correct param env

This commit is contained in:
lcnr 2023-03-15 14:36:10 +01:00
parent c63861b9d5
commit b8541eb767

View File

@ -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,