From a9d996a7c5f962b4ac914c86f5005eb22128f511 Mon Sep 17 00:00:00 2001 From: Francesco Zardi Date: Wed, 21 Oct 2020 09:06:05 +0200 Subject: Add whitelist of safe intrinsics --- crates/hir_expand/src/name.rs | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'crates/hir_expand/src/name.rs') diff --git a/crates/hir_expand/src/name.rs b/crates/hir_expand/src/name.rs index 63f828707..0d5b56681 100644 --- a/crates/hir_expand/src/name.rs +++ b/crates/hir_expand/src/name.rs @@ -208,6 +208,42 @@ pub mod known { PartialOrd, Eq, PartialEq, + // Safe primitives + abort, + size_of, + min_align_of, + needs_drop, + caller_location, + size_of_val, + min_align_of_val, + add_with_overflow, + sub_with_overflow, + mul_with_overflow, + wrapping_add, + wrapping_sub, + wrapping_mul, + saturating_add, + saturating_sub, + rotate_left, + rotate_right, + ctpop, + ctlz, + cttz, + bswap, + bitreverse, + discriminant_value, + type_id, + likely, + unlikely, + ptr_guaranteed_eq, + ptr_guaranteed_ne, + minnumf32, + minnumf64, + maxnumf32, + rustc_peek, + maxnumf64, + type_name, + variant_count, ); // self/Self cannot be used as an identifier -- cgit v1.2.3