You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: singles.rs
    path of file: ./repos/prusti-dev/vir-gen/src/deriver
    
    the code of the file until where you have to start completion: use crate::{
    ast::{CustomDerive, CustomDeriveList, CustomDeriveOptions},
    helpers::unbox_type,
};
use quote::quote;
use syn::{parse_quote, spanned::Spanned};

pub(super) fn derive(items: &mut Vec<syn::Item>) -> Result<(), syn::Error> {
    let mut derived_items = Vec::new();
    for item in items.iter_mut() {
        match item {
            syn::Item::Struct(struct_item) => {
                let mut new_attributes = Vec::new();
                for attribute in struct_item.attrs.drain(..) {
                    if attribute.style == syn::AttrStyle::Outer && attribute.path.is_ident("derive")
                    {
                        if let Ok(list) = syn::parse2::<CustomDeriveList>(attribute.tokens.clone())
                        {
                            let mut derive_paths = Vec::new();
                            for derive in list.derives {
                                match derive {
                                    CustomDerive::New => derived_items.push(derive_new(
                                        "new",
                                        &struct_item.ident,
                                        struct_item.fields.iter(),
                                        Some("position"),
                                    )),
                                    CustomDerive::NewWithPos => derived_items.push(derive_new(
                                        "new_with_pos",
                                        &struct_item.ident,
                                        struct_item.fields.iter(),
                                        None,
                                    )),
                                    CustomDerive::Hash(options) => derived_items.push(derive_hash(
                                        &struct_item.ident,
                                        struct_item.fields.iter(),
                                        options,
                                    )),
                                    CustomDerive::PartialEq(options) => {
                                        derived_items.push(derive_partial_eq(
                                            &struct_item.ident,
                                            struct_item.fields.iter(),
                                            options,
                                        ))
                                    }
                                    CustomDerive::Ord(options) => {
                                        derived_items.push(derive_ord(
                                            &struct_item.ident,
                                            struct_item.fields.iter(),
                                            options,
                                        ));
                                        derived_items.push(derive_partial_ord(&struct_item.ident));
                                    }
                                    CustomDerive::Other(path) => {
                                        derive_paths.push(path);
                                    }
                                }
                            }
                            if !derive_paths.is_empty() {
                                new_attributes.push(syn::parse_quote! {
                                    #[derive(#(#derive_paths),*)]
                                });
                            }
                            continue;
                        }
                    }
                    new_attributes.push(attribute);
                }
                struct_item.attrs = new_attributes;
            }
            syn::Item::Enum(enum_item) => {
                let mut new_attributes = Vec::new();
                for attribute in enum_item.attrs.drain(..) {
                    if attribute.style == syn::AttrStyle::Outer && attribute.path.is_ident("derive")
                    {
                        if let Ok(list) = syn::parse2::<CustomDeriveList>(attribute.tokens.clone())
                        {
                            let mut derive_paths = Vec::new();
                            for derive in list.derives {
                                match derive {
                                    CustomDerive::New => unimplemented!(),
                                    CustomDerive::NewWithPos => unimplemented!(),
                                    CustomDerive::Hash(_options) => {
                                        derive_paths.push(syn::parse_quote! {Hash});
                                    }
                                    CustomDerive::PartialEq(_options) => {
                                        derive_paths.push(syn::parse_quote! {PartialEq});
                                    }
                                    CustomDerive::Ord(_options) => {
                                        derive_paths.push(syn::parse_quote! {PartialOrd});
                                        derive_paths.push(syn::parse_quote! {Ord});
                                    }
    
    
pub(super) fn derive(items: &mut Vec<syn::Item>) -> Result<(), syn::Error> {
    let mut derived_items = Vec::new();
    for item in items.iter_mut() {
        match item {
            syn::Item::Struct(struct_item) => {
                let mut new_attributes = Vec::new();
                for attribute in struct_item.attrs.drain(..) {
                    if attribute.style == syn::AttrStyle::Outer && attribute.path.is_ident("derive")
                    {
                        if let Ok(list) = syn::parse2::<CustomDeriveList>(attribute.tokens.clone())
                        {
                            let mut derive_paths = Vec::new();
                            for derive in list.derives {
                                match derive {
                                    CustomDerive::New => derived_items.push(derive_new(
                                        "new",
                                        &struct_item.ident,
                                        struct_item.fields.iter(),
                                        Some("position"),
                                    )),
                                    CustomDerive::NewWithPos => derived_items.push(derive_new(
                                        "new_with_pos",
                                        &struct_item.ident,
                                        struct_item.fields.iter(),
                                        None,
                                    )),
                                    CustomDerive::Hash(options) => derived_items.push(derive_hash(
                                        &struct_item.ident,
                                        struct_item.fields.iter(),
                                        options,
                                    )),
                                    CustomDerive::PartialEq(options) => {
                                        derived_items.push(derive_partial_eq(
                                            &struct_item.ident,
                                            struct_item.fields.iter(),
                                            options,
                                        ))
                                    }
                                    CustomDerive::Ord(options) => {
                                        derived_items.push(derive_ord(
                                            &struct_item.ident,
                                            struct_item.fields.iter(),
                                            options,
                                        ));
                                        derived_items.push(derive_partial_ord(&struct_item.ident));
                                    }
                                    CustomDerive::Other(path) => {
                                        derive_paths.push(path);
                                    }
                                }
                            }
                            if !derive_paths.is_empty() {
                                new_attributes.push(syn::parse_quote! {
                                    #[derive(#(#derive_paths),*)]
                                });
                            }
                            continue;
                        }
                    }
                    new_attributes.push(attribute);
                }
                struct_item.attrs = new_attributes;
            }
            syn::Item::Enum(enum_item) => {
                let mut new_attributes = Vec::new();
                for attribute in enum_item.attrs.drain(..) {
                    if attribute.style == syn::AttrStyle::Outer && attribute.path.is_ident("derive")
                    {
                        if let Ok(list) = syn::parse2::<CustomDeriveList>(attribute.tokens.clone())
                        {
                            let mut derive_paths = Vec::new();
                            for derive in list.derives {
                                match derive {
                                    CustomDerive::New => unimplemented!(),
                                    CustomDerive::NewWithPos => unimplemented!(),
                                    CustomDerive::Hash(_options) => {
                                        derive_paths.push(syn::parse_quote! {Hash});
                                    }
                                    CustomDerive::PartialEq(_options) => {
                                        derive_paths.push(syn::parse_quote! {PartialEq});
                                    }
                                    CustomDerive::Ord(_options) => {
                                        derive_paths.push(syn::parse_quote! {PartialOrd});
                                        derive_paths.push(syn::parse_quote! {Ord});
                                    }
                                    CustomDerive::Other(path) => {
                                        derive_paths.push(path);
                                    }
                                }
                            }
                            if !derive_paths.is_empty() {
                                new_attributes.push(syn::parse_quote! {
                                    #[derive(#(#derive_paths),*)]
                                });
                            }
                            continue;
                        }
                    }
                    new_attributes.push(attribute);
                }
                enum_item.attrs = new_attributes;
            }
            _ => {}
        }
    }
    items.extend(derived_items);
    Ok(())
}