1 //! This module uses doc-tests on modules for `compile_fail` 2 3 // We need "syn/full" to parse macros. 4 // Use `--nocapture` to check the quality of the error message. 5 #[cfg(not(feature = "full-syntax"))] 6 /// ```compile_fail 7 /// macro_rules! get_an_isize { 8 /// () => (0_isize) 9 /// } 10 /// 11 /// #[derive(num_derive::FromPrimitive)] 12 /// pub enum CLikeEnum { 13 /// VarA = get_an_isize!(), // error without "syn/full" 14 /// VarB = 2, 15 /// } 16 /// ``` 17 mod issue16 {} 18 19 #[cfg(feature = "full-syntax")] 20 /// ``` 21 /// macro_rules! get_an_isize { 22 /// () => (0_isize) 23 /// } 24 /// 25 /// #[derive(num_derive::FromPrimitive)] 26 /// pub enum CLikeEnum { 27 /// VarA = get_an_isize!(), // ok with "syn/full" 28 /// VarB = 2, 29 /// } 30 /// ``` 31 mod issue16 {} 32