@@ -76,7 +76,6 @@ fn intrinsic_operation_unsafety(tcx: TyCtxt<'_>, intrinsic_id: LocalDefId) -> hi
7676 | sym:: autodiff
7777 | sym:: bitreverse
7878 | sym:: black_box
79- | sym:: box_new
8079 | sym:: breakpoint
8180 | sym:: bswap
8281 | sym:: caller_location
@@ -218,6 +217,7 @@ fn intrinsic_operation_unsafety(tcx: TyCtxt<'_>, intrinsic_id: LocalDefId) -> hi
218217 | sym:: wrapping_add
219218 | sym:: wrapping_mul
220219 | sym:: wrapping_sub
220+ | sym:: write_box_via_move
221221 // tidy-alphabetical-end
222222 => hir:: Safety :: Safe ,
223223 _ => hir:: Safety :: Unsafe ,
@@ -558,6 +558,13 @@ pub(crate) fn check_intrinsic_type(
558558 sym:: write_via_move => {
559559 ( 1 , 0 , vec ! [ Ty :: new_mut_ptr( tcx, param( 0 ) ) , param( 0 ) ] , tcx. types . unit )
560560 }
561+ sym:: write_box_via_move => {
562+ let t = param ( 0 ) ;
563+ let maybe_uninit_t = Ty :: new_maybe_uninit ( tcx, t) ;
564+ let box_mu_t = Ty :: new_box ( tcx, maybe_uninit_t) ;
565+
566+ ( 1 , 0 , vec ! [ box_mu_t, param( 0 ) ] , box_mu_t)
567+ }
561568
562569 sym:: typed_swap_nonoverlapping => {
563570 ( 1 , 0 , vec ! [ Ty :: new_mut_ptr( tcx, param( 0 ) ) ; 2 ] , tcx. types . unit )
@@ -650,8 +657,6 @@ pub(crate) fn check_intrinsic_type(
650657
651658 sym:: ub_checks | sym:: overflow_checks => ( 0 , 0 , Vec :: new ( ) , tcx. types . bool ) ,
652659
653- sym:: box_new => ( 1 , 0 , vec ! [ param( 0 ) ] , Ty :: new_box ( tcx, param ( 0 ) ) ) ,
654-
655660 // contract_check_requires::<C>(C) -> bool, where C: impl Fn() -> bool
656661 sym:: contract_check_requires => ( 1 , 0 , vec ! [ param( 0 ) ] , tcx. types . unit ) ,
657662 sym:: contract_check_ensures => {
0 commit comments