Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/aienux/blob/main/vendor/serde_derive/src/dummy.rs # aienux Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `aienux / vendor / serde_derive / src / dummy.rs` 31 lines ยท 751 bytes Raw Blame History 1 use proc_macro2::TokenStream; 2 use quote::quote; 3 4 pub fn wrap_in_const(serde_path: Option<&syn::Path>, code: TokenStream) -> TokenStream { 5 let use_serde = match serde_path { 6 Some(path) => quote! { 7 use #path as _serde; 8 }, 9 None => quote! { 10 #[allow(unused_extern_crates, clippy::useless_attribute)] 11 extern crate serde as _serde; 12 }, 13 }; 14 15 quote! { 16 #[doc(hidden)] 17 #[allow( 18 non_upper_case_globals, 19 unused_attributes, 20 unused_qualifications, 21 clippy::absolute_paths, 22 )] 23 const _: () = { 24 #use_serde 25 26 _serde::__require_serde_not_serde_core!(); 27 28 #code 29 }; 30 } 31 }