From 6b19a48e708609b456d3a6e90cafd63a6c348e86 Mon Sep 17 00:00:00 2001 From: Tomasz Miąsko Date: Sat, 13 Aug 2022 00:00:00 +0000 Subject: `assert_{inhabited,zero_valid,uninit_valid}` intrinsics are safe Those intrinsics either panic or do nothing. They are safe. --- compiler/rustc_typeck/src/check/intrinsic.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'compiler') diff --git a/compiler/rustc_typeck/src/check/intrinsic.rs b/compiler/rustc_typeck/src/check/intrinsic.rs index 3f2a0da8d65..05686be5d4b 100644 --- a/compiler/rustc_typeck/src/check/intrinsic.rs +++ b/compiler/rustc_typeck/src/check/intrinsic.rs @@ -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 -- cgit 1.4.1-3-g733a5