@@ -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
@@ -217,6 +216,7 @@ fn intrinsic_operation_unsafety(tcx: TyCtxt<'_>, intrinsic_id: LocalDefId) -> hi
217216 | sym:: wrapping_add
218217 | sym:: wrapping_mul
219218 | sym:: wrapping_sub
219+ | sym:: write_box_via_move
220220 // tidy-alphabetical-end
221221 => hir:: Safety :: Safe ,
222222 _ => hir:: Safety :: Unsafe ,
@@ -556,6 +556,13 @@ pub(crate) fn check_intrinsic_type(
556556 sym:: write_via_move => {
557557 ( 1 , 0 , vec ! [ Ty :: new_mut_ptr( tcx, param( 0 ) ) , param( 0 ) ] , tcx. types . unit )
558558 }
559+ sym:: write_box_via_move => {
560+ let t = param ( 0 ) ;
561+ let maybe_uninit_t = Ty :: new_maybe_uninit ( tcx, t) ;
562+ let box_mu_t = Ty :: new_box ( tcx, maybe_uninit_t) ;
563+
564+ ( 1 , 0 , vec ! [ box_mu_t, param( 0 ) ] , box_mu_t)
565+ }
559566
560567 sym:: typed_swap_nonoverlapping => {
561568 ( 1 , 0 , vec ! [ Ty :: new_mut_ptr( tcx, param( 0 ) ) ; 2 ] , tcx. types . unit )
@@ -648,8 +655,6 @@ pub(crate) fn check_intrinsic_type(
648655
649656 sym:: ub_checks | sym:: overflow_checks => ( 0 , 0 , Vec :: new ( ) , tcx. types . bool ) ,
650657
651- sym:: box_new => ( 1 , 0 , vec ! [ param( 0 ) ] , Ty :: new_box ( tcx, param ( 0 ) ) ) ,
652-
653658 // contract_check_requires::<C>(C) -> bool, where C: impl Fn() -> bool
654659 sym:: contract_check_requires => ( 1 , 0 , vec ! [ param( 0 ) ] , tcx. types . unit ) ,
655660 sym:: contract_check_ensures => {
0 commit comments