@@ -77,7 +77,6 @@ fn intrinsic_operation_unsafety(tcx: TyCtxt<'_>, intrinsic_id: LocalDefId) -> hi
7777 | sym:: autodiff
7878 | sym:: bitreverse
7979 | sym:: black_box
80- | sym:: box_new
8180 | sym:: breakpoint
8281 | sym:: bswap
8382 | sym:: caller_location
@@ -223,6 +222,7 @@ fn intrinsic_operation_unsafety(tcx: TyCtxt<'_>, intrinsic_id: LocalDefId) -> hi
223222 | sym:: wrapping_add
224223 | sym:: wrapping_mul
225224 | sym:: wrapping_sub
225+ | sym:: write_box_via_move
226226 // tidy-alphabetical-end
227227 => hir:: Safety :: Safe ,
228228 _ => hir:: Safety :: Unsafe ,
@@ -584,6 +584,13 @@ pub(crate) fn check_intrinsic_type(
584584 sym:: write_via_move => {
585585 ( 1 , 0 , vec ! [ Ty :: new_mut_ptr( tcx, param( 0 ) ) , param( 0 ) ] , tcx. types . unit )
586586 }
587+ sym:: write_box_via_move => {
588+ let t = param ( 0 ) ;
589+ let maybe_uninit_t = Ty :: new_maybe_uninit ( tcx, t) ;
590+ let box_mu_t = Ty :: new_box ( tcx, maybe_uninit_t) ;
591+
592+ ( 1 , 0 , vec ! [ box_mu_t, param( 0 ) ] , box_mu_t)
593+ }
587594
588595 sym:: typed_swap_nonoverlapping => {
589596 ( 1 , 0 , vec ! [ Ty :: new_mut_ptr( tcx, param( 0 ) ) ; 2 ] , tcx. types . unit )
@@ -689,8 +696,6 @@ pub(crate) fn check_intrinsic_type(
689696
690697 sym:: ub_checks | sym:: overflow_checks => ( 0 , 0 , Vec :: new ( ) , tcx. types . bool ) ,
691698
692- sym:: box_new => ( 1 , 0 , vec ! [ param( 0 ) ] , Ty :: new_box ( tcx, param ( 0 ) ) ) ,
693-
694699 // contract_check_requires::<C>(C) -> bool, where C: impl Fn() -> bool
695700 sym:: contract_check_requires => ( 1 , 0 , vec ! [ param( 0 ) ] , tcx. types . unit ) ,
696701 sym:: contract_check_ensures => {
0 commit comments