@@ -132,8 +132,8 @@ impl<'tcx> NewPermission {
132132 kind : RetagKind ,
133133 cx : & crate :: MiriInterpCx < ' tcx > ,
134134 ) -> 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 ( ) ) ;
137137 let is_protected = kind == RetagKind :: FnEntry ;
138138 // As demonstrated by `tests/fail/tree_borrows/reservedim_spurious_write.rs`,
139139 // interior mutability and protectors interact poorly.
@@ -164,10 +164,10 @@ impl<'tcx> NewPermission {
164164 zero_size : bool ,
165165 ) -> Option < Self > {
166166 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 ( |( ) | {
168168 // Regular `Unpin` box, give it `noalias` but only a weak protector
169169 // 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 ( ) ) ;
171171 let protected = kind == RetagKind :: FnEntry ;
172172 let initial_state = Permission :: new_reserved ( ty_is_freeze, protected) ;
173173 Self {
@@ -521,7 +521,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
521521 // Note: if we were to inline `new_reserved` below we would find out that
522522 // `ty_is_freeze` is eventually unused because it appears in a `ty_is_freeze || true`.
523523 // 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 ( ) ) ;
525525 // Retag it. With protection! That is the entire point.
526526 let new_perm = NewPermission {
527527 initial_state : Permission :: new_reserved ( ty_is_freeze, /* protected */ true ) ,
0 commit comments