1 //! Providing the features between "full" and "derive" of syn. 2 //! 3 //! This crate provides the following two unique data structures. 4 //! 5 //! * [`syn_mid::ItemFn`] -- A function whose body is not parsed. 6 //! 7 //! ```text 8 //! fn process(n: usize) -> Result<()> { ... } 9 //! ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^ ^ 10 //! ``` 11 //! 12 //! * [`syn_mid::Block`] -- A block whose body is not parsed. 13 //! 14 //! ```text 15 //! { ... } 16 //! ^ ^ 17 //! ``` 18 //! 19 //! Other data structures are the same as data structures of [syn]. These are 20 //! defined in this crate because they cannot be used in [syn] without "full" 21 //! feature. 22 //! 23 //! # Optional features 24 //! 25 //! * **`clone-impls`** — Clone impls for all syntax tree types. 26 //! 27 //! [`syn_mid::ItemFn`]: ItemFn 28 //! [`syn_mid::Block`]: Block 29 //! [syn]: https://github.com/dtolnay/syn 30 31 #![doc(test( 32 no_crate_inject, 33 attr( 34 deny(warnings, rust_2018_idioms, single_use_lifetimes), 35 allow(dead_code, unused_variables) 36 ) 37 ))] 38 #![forbid(unsafe_code)] 39 #![warn(future_incompatible, rust_2018_idioms, single_use_lifetimes, unreachable_pub)] 40 #![warn(clippy::all, clippy::default_trait_access)] 41 #![allow(clippy::eval_order_dependence, clippy::large_enum_variant)] 42 43 // Many of the code contained in this crate are copies from https://github.com/dtolnay/syn. 44 45 #[macro_use] 46 mod macros; 47 48 mod func; 49 mod pat; 50 mod path; 51 52 pub use crate::{ 53 func::{Block, FnArg, ItemFn, Receiver, Signature}, 54 pat::{ 55 FieldPat, Pat, PatIdent, PatPath, PatReference, PatStruct, PatTuple, PatTupleStruct, 56 PatType, PatWild, 57 }, 58 }; 59