1
Fork 0

Rollup merge of #135046 - RalfJung:rustc_box_intrinsic, r=compiler-errors

turn rustc_box into an intrinsic

I am not entirely sure why this was made a special magic attribute, but an intrinsic seems like a more natural way to add magic expressions to the language.
This commit is contained in:
Jubilee 2025-01-04 07:57:33 -08:00 committed by GitHub
commit 7cf3b96a83
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
25 changed files with 198 additions and 208 deletions

View file

@ -86,6 +86,7 @@ pub fn intrinsic_operation_unsafety(tcx: TyCtxt<'_>, intrinsic_id: LocalDefId) -
| sym::assert_inhabited
| sym::assert_zero_valid
| sym::assert_mem_uninitialized_valid
| sym::box_new
| sym::breakpoint
| sym::size_of
| sym::min_align_of
@ -606,6 +607,8 @@ pub fn check_intrinsic_type(
sym::ub_checks => (0, 0, Vec::new(), tcx.types.bool),
sym::box_new => (1, 0, vec![param(0)], Ty::new_box(tcx, param(0))),
sym::simd_eq
| sym::simd_ne
| sym::simd_lt