@@ -132,8 +132,8 @@ impl<'tcx> NewPermission {
132
132
kind : RetagKind ,
133
133
cx : & crate :: MiriInterpCx < ' tcx > ,
134
134
) -> Option < Self > {
135
- let ty_is_freeze = pointee. is_freeze ( * cx. tcx , cx. param_env ( ) ) ;
136
- let ty_is_unpin = pointee. is_unpin ( * cx. tcx , cx. param_env ( ) ) ;
135
+ let ty_is_freeze = pointee. is_freeze ( * cx. tcx , cx. typing_env ( ) ) ;
136
+ let ty_is_unpin = pointee. is_unpin ( * cx. tcx , cx. typing_env ( ) ) ;
137
137
let is_protected = kind == RetagKind :: FnEntry ;
138
138
// As demonstrated by `tests/fail/tree_borrows/reservedim_spurious_write.rs`,
139
139
// interior mutability and protectors interact poorly.
@@ -164,10 +164,10 @@ impl<'tcx> NewPermission {
164
164
zero_size : bool ,
165
165
) -> Option < Self > {
166
166
let pointee = ty. builtin_deref ( true ) . unwrap ( ) ;
167
- pointee. is_unpin ( * cx. tcx , cx. param_env ( ) ) . then_some ( ( ) ) . map ( |( ) | {
167
+ pointee. is_unpin ( * cx. tcx , cx. typing_env ( ) ) . then_some ( ( ) ) . map ( |( ) | {
168
168
// Regular `Unpin` box, give it `noalias` but only a weak protector
169
169
// because it is valid to deallocate it within the function.
170
- let ty_is_freeze = ty. is_freeze ( * cx. tcx , cx. param_env ( ) ) ;
170
+ let ty_is_freeze = ty. is_freeze ( * cx. tcx , cx. typing_env ( ) ) ;
171
171
let protected = kind == RetagKind :: FnEntry ;
172
172
let initial_state = Permission :: new_reserved ( ty_is_freeze, protected) ;
173
173
Self {
@@ -521,7 +521,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
521
521
// Note: if we were to inline `new_reserved` below we would find out that
522
522
// `ty_is_freeze` is eventually unused because it appears in a `ty_is_freeze || true`.
523
523
// We are nevertheless including it here for clarity.
524
- let ty_is_freeze = place. layout . ty . is_freeze ( * this. tcx , this. param_env ( ) ) ;
524
+ let ty_is_freeze = place. layout . ty . is_freeze ( * this. tcx , this. typing_env ( ) ) ;
525
525
// Retag it. With protection! That is the entire point.
526
526
let new_perm = NewPermission {
527
527
initial_state : Permission :: new_reserved ( ty_is_freeze, /* protected */ true ) ,
0 commit comments