From a990de90fe41456a23e58bd087d2f107d321f3a1 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Fri, 19 Jul 2024 16:37:58 +0400 Subject: Deleted vendor folder --- vendor/syn/src/drops.rs | 58 ------------------------------------------------- 1 file changed, 58 deletions(-) delete mode 100644 vendor/syn/src/drops.rs (limited to 'vendor/syn/src/drops.rs') diff --git a/vendor/syn/src/drops.rs b/vendor/syn/src/drops.rs deleted file mode 100644 index 89b42d8..0000000 --- a/vendor/syn/src/drops.rs +++ /dev/null @@ -1,58 +0,0 @@ -use std::iter; -use std::mem::ManuallyDrop; -use std::ops::{Deref, DerefMut}; -use std::option; -use std::slice; - -#[repr(transparent)] -pub(crate) struct NoDrop(ManuallyDrop); - -impl NoDrop { - pub(crate) fn new(value: T) -> Self - where - T: TrivialDrop, - { - NoDrop(ManuallyDrop::new(value)) - } -} - -impl Deref for NoDrop { - type Target = T; - fn deref(&self) -> &Self::Target { - &self.0 - } -} - -impl DerefMut for NoDrop { - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} - -pub(crate) trait TrivialDrop {} - -impl TrivialDrop for iter::Empty {} -impl<'a, T> TrivialDrop for slice::Iter<'a, T> {} -impl<'a, T> TrivialDrop for slice::IterMut<'a, T> {} -impl<'a, T> TrivialDrop for option::IntoIter<&'a T> {} -impl<'a, T> TrivialDrop for option::IntoIter<&'a mut T> {} - -#[test] -fn test_needs_drop() { - use std::mem::needs_drop; - - struct NeedsDrop; - - impl Drop for NeedsDrop { - fn drop(&mut self) {} - } - - assert!(needs_drop::()); - - // Test each of the types with a handwritten TrivialDrop impl above. - assert!(!needs_drop::>()); - assert!(!needs_drop::>()); - assert!(!needs_drop::>()); - assert!(!needs_drop::>()); - assert!(!needs_drop::>()); -} -- cgit v1.2.3