Lines Matching defs:unsafe
30 unsafe impl $trait for $ty {
128 unsafe impl<$($tyvar $(: $(? $optbound +)* $($bound +)*)?),* $(, const $constname: $constty,)*> $trait for $ty {
197 unsafe impl<$($tyvar $(: $(? $optbound +)* $($bound +)*)?)?> $trait for $ty {
270 /// unsafe impl Foo for type!() { ... }
271 /// unsafe impl<B> Foo for type!(B) { ... }
272 /// unsafe impl<A, B> Foo for type!(A, B) { ... }
314 /// Expands to an `Option<unsafe extern "C" fn>` type with the given argument
317 ($($args:ident),* -> $ret:ident) => { Option<unsafe extern "C" fn($($args),*) -> $ret> };
326 /// Expands to an `Option<unsafe fn>` type with the given argument types and
329 ($($args:ident),* -> $ret:ident) => { Option<unsafe fn($($args),*) -> $ret> };
352 /// `const _: () = unsafe` macro). The reason for this restriction is that,
374 /// const _: () = unsafe {
446 unsafe impl<$($tyvar $(: ?$optbound)?)? $(, const $constvar : $constty)?> KnownLayout for $ty {
502 unsafe impl<$($tyvar: ?Sized + KnownLayout)?> KnownLayout for $ty {
522 unsafe { NonNull::new_unchecked(ptr) }
715 // We require the caller to provide an `unsafe` block as part of the input
716 // syntax since a call to `define_cast!` is useless inside of an `unsafe`
719 (unsafe { $vis:vis $name:ident $(<$tyvar:ident $(: ?$optbound:ident)?>)? = $src:ty => $dst:ty }) => {
726 unsafe impl $(<$tyvar $(: ?$optbound)?>)? $crate::pointer::cast::Project<$src, $dst> for $name {
734 unsafe impl $(<$tyvar $(: ?$optbound)?>)? $crate::pointer::cast::Cast<$src, $dst> for $name {}
755 unsafe impl<T $(: ?$optbound)?> TransmuteFrom<T, Safe, Safe> for $wrapper<T> {}
757 unsafe impl<T $(: ?$optbound)?> TransmuteFrom<$wrapper<T>, Safe, Safe> for T {}
760 define_cast!(unsafe { $vis CastToWrapper<T $(: ?$optbound)? > = T => $wrapper<T> });
763 unsafe impl<T $(: ?$optbound)?> CastExact<T, $wrapper<T>> for CastToWrapper {}
766 define_cast!(unsafe { $vis CastFromWrapper<T $(: ?$optbound)? > = $wrapper<T> => T });
769 unsafe impl<T $(: ?$optbound)?> CastExact<$wrapper<T>, T> for CastFromWrapper {}
831 unsafe impl<$($tyvar $(: ?$optbound)?)?> TransmuteFrom<$t, Safe, Safe> for $v
840 /// A no-op `unsafe fn` for use in macro expansions.
843 /// must wrap the call in `unsafe { ... }`.
845 pub(crate) const unsafe fn __unsafe() {}