@@ -9,7 +9,7 @@ use rustc_hir::def_id::LocalDefId;
9
9
use rustc_index:: bit_set:: BitSet ;
10
10
use rustc_middle:: mir:: visit:: { NonMutatingUseContext , PlaceContext , Visitor } ;
11
11
use rustc_middle:: mir:: { Body , Local , Location , Operand , Terminator , TerminatorKind , RETURN_PLACE } ;
12
- use rustc_middle:: ty:: { self , DeducedParamAttrs , ParamEnv , Ty , TyCtxt } ;
12
+ use rustc_middle:: ty:: { self , DeducedParamAttrs , Ty , TyCtxt } ;
13
13
use rustc_session:: config:: OptLevel ;
14
14
15
15
/// A visitor that determines which arguments have been mutated. We can't use the mutability field
@@ -198,11 +198,12 @@ pub fn deduced_param_attrs<'tcx>(
198
198
// see [1].
199
199
//
200
200
// [1]: https://github.com/rust-lang/rust/pull/103172#discussion_r999139997
201
+ let param_env = tcx. param_env_reveal_all_normalized ( def_id) ;
201
202
let mut deduced_param_attrs = tcx. arena . alloc_from_iter (
202
203
body. local_decls . iter ( ) . skip ( 1 ) . take ( body. arg_count ) . enumerate ( ) . map (
203
204
|( arg_index, local_decl) | DeducedParamAttrs {
204
205
read_only : !deduce_read_only. mutable_args . contains ( arg_index)
205
- && local_decl. ty . is_freeze ( tcx, ParamEnv :: reveal_all ( ) ) ,
206
+ && local_decl. ty . is_freeze ( tcx, param_env ) ,
206
207
} ,
207
208
) ,
208
209
) ;
0 commit comments