Lines Matching full:safety
154 //! // SAFETY:
184 //! // SAFETY: Since `foo` is initialized, destroying is safe.
649 /// The syntax is identical to [`pin_init!`] and its safety caveats also apply:
686 /// The safety caveats from [`try_pin_init!`] also apply:
752 /// # Safety
771 /// # Safety
829 // SAFETY: The `__pinned_init` function is implemented such that it
839 // SAFETY: All requirements fulfilled since this function is `__pinned_init`. in __pinned_init()
841 // SAFETY: The above call initialized `slot` and we still have unique access. in __pinned_init()
843 // SAFETY: `slot` is considered pinned. in __pinned_init()
846 // SAFETY: `slot` was initialized above. in __pinned_init()
862 /// # Safety
886 /// # Safety
931 // SAFETY: The `__init` function is implemented such that it
940 // SAFETY: All requirements fulfilled since this function is `__init`. in __init()
942 // SAFETY: The above call initialized `slot` and we still have unique access. in __init()
944 // SAFETY: `slot` was initialized above. in __init()
951 // SAFETY: `__pinned_init` behaves exactly the same as `__init`.
958 // SAFETY: `__init` has less strict requirements compared to `__pinned_init`. in __pinned_init()
965 /// # Safety
984 /// # Safety
1006 // SAFETY: The memory is allowed to be uninitialized. in uninit()
1031 // SAFETY: The loop initialized exactly the values from 0..i and since we
1038 // SAFETY: Since 0 <= `i` < N, it is still in bounds of `[T; N]`.
1040 // SAFETY: The pointer is derived from `slot` and thus satisfies the `__init`
1048 // SAFETY: The initializer above initializes every element of the array. On failure it drops
1075 // SAFETY: The loop initialized exactly the values from 0..i and since we
1082 // SAFETY: Since 0 <= `i` < N, it is still in bounds of `[T; N]`.
1084 // SAFETY: The pointer is derived from `slot` and thus satisfies the `__init`
1092 // SAFETY: The initializer above initializes every element of the array. On failure it drops
1097 // SAFETY: Every type can be initialized by-value.
1105 // SAFETY: Every type can be initialized by-value. `__pinned_init` calls `__init`.
1130 // SAFETY: We delegate to `init` and only change the error type. in pin_init()
1147 // SAFETY: We delegate to `init` and only change the error type. in init()
1163 // SAFETY: When init errors/panics, slot will get deallocated but not dropped, in try_pin_init()
1166 // SAFETY: All fields have been initialized. in try_pin_init()
1177 // SAFETY: When init errors/panics, slot will get deallocated but not dropped, in try_init()
1180 // SAFETY: All fields have been initialized. in try_init()
1193 // SAFETY: When init errors/panics, slot will get deallocated but not dropped, in try_pin_init()
1196 // SAFETY: All fields have been initialized. in try_pin_init()
1207 // SAFETY: When init errors/panics, slot will get deallocated but not dropped, in try_init()
1210 // SAFETY: All fields have been initialized. in try_init()
1237 /// # Safety
1256 /// # Safety
1271 // SAFETY: Because `T: Zeroable`, all bytes zero is a valid bit pattern for `T` in zeroed()
1288 // SAFETY: All primitives that are allowed to be zero.
1302 // SAFETY: These are inhabited ZSTs; there is nothing to zero and a valid value exists.
1305 // SAFETY: Type is allowed to take any value, including all zeros.
1307 // SAFETY: Type is allowed to take any value, including all zeros.
1310 // SAFETY: `T: Zeroable` and `UnsafeCell` is `repr(transparent)`.
1313 // SAFETY: All zeros is equivalent to `None` (option layout optimization guarantee:
1322 // SAFETY: `null` pointer is valid.
1331 // SAFETY: `null` pointer is valid and the metadata part of these fat pointers is allowed to be
1335 // SAFETY: `T` is `Zeroable`.
1342 // SAFETY: All elements are zeroable and padding can be zero.