@@ -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
@@ -215,6 +214,7 @@ fn intrinsic_operation_unsafety(tcx: TyCtxt<'_>, intrinsic_id: LocalDefId) -> hi
215214 | sym:: wrapping_add
216215 | sym:: wrapping_mul
217216 | sym:: wrapping_sub
217+ | sym:: write_box_via_move
218218 // tidy-alphabetical-end
219219 => hir:: Safety :: Safe ,
220220 _ => hir:: Safety :: Unsafe ,
@@ -553,6 +553,13 @@ pub(crate) fn check_intrinsic_type(
553553 sym:: write_via_move => {
554554 ( 1 , 0 , vec ! [ Ty :: new_mut_ptr( tcx, param( 0 ) ) , param( 0 ) ] , tcx. types . unit )
555555 }
556+ sym:: write_box_via_move => {
557+ let t = param ( 0 ) ;
558+ let maybe_uninit_t = Ty :: new_maybe_uninit ( tcx, t) ;
559+ let box_mu_t = Ty :: new_box ( tcx, maybe_uninit_t) ;
560+
561+ ( 1 , 0 , vec ! [ box_mu_t, param( 0 ) ] , box_mu_t)
562+ }
556563
557564 sym:: typed_swap_nonoverlapping => {
558565 ( 1 , 0 , vec ! [ Ty :: new_mut_ptr( tcx, param( 0 ) ) ; 2 ] , tcx. types . unit )
@@ -645,8 +652,6 @@ pub(crate) fn check_intrinsic_type(
645652
646653 sym:: ub_checks => ( 0 , 0 , Vec :: new ( ) , tcx. types . bool ) ,
647654
648- sym:: box_new => ( 1 , 0 , vec ! [ param( 0 ) ] , Ty :: new_box ( tcx, param ( 0 ) ) ) ,
649-
650655 // contract_check_requires::<C>(C) -> bool, where C: impl Fn() -> bool
651656 sym:: contract_check_requires => ( 1 , 0 , vec ! [ param( 0 ) ] , tcx. types . unit ) ,
652657 sym:: contract_check_ensures => {
0 commit comments