1
Fork 0

assert_{inhabited,zero_valid,uninit_valid} intrinsics are safe

Those intrinsics either panic or do nothing. They are safe.
This commit is contained in:
Tomasz Miąsko 2022-08-13 00:00:00 +00:00
parent 75b7e52e92
commit 6b19a48e70
3 changed files with 9 additions and 6 deletions

View file

@ -69,6 +69,9 @@ pub fn intrinsic_operation_unsafety(intrinsic: Symbol) -> hir::Unsafety {
// to note that it's safe to call, since
// safe extern fns are otherwise unprecedented.
sym::abort
| sym::assert_inhabited
| sym::assert_zero_valid
| sym::assert_uninit_valid
| sym::size_of
| sym::min_align_of
| sym::needs_drop