@@ -3,10 +3,10 @@ use std::collections::HashSet;
33use proc_macro:: TokenStream ;
44use quote:: quote;
55use syn:: {
6+ Fields , FieldsNamed , Ident , ItemStruct , Token , Type , TypeReference ,
67 parse:: { Parse , ParseStream } ,
78 parse_macro_input,
89 punctuated:: Punctuated ,
9- Fields , FieldsNamed , Ident , ItemStruct , Token , Type , TypeReference ,
1010} ;
1111
1212// Copy paste from syn example
@@ -46,7 +46,7 @@ pub fn span_derive(attr: TokenStream, input: TokenStream) -> TokenStream {
4646 std:: mem:: swap ( & mut tmp, & mut field. attrs ) ;
4747 tmp = tmp
4848 . into_iter ( )
49- . filter ( |attr| !attr. path . is_ident ( IGNORE_ATTR_NAME ) )
49+ . filter ( |attr| !attr. path ( ) . is_ident ( IGNORE_ATTR_NAME ) )
5050 . collect :: < Vec < _ > > ( ) ;
5151 std:: mem:: swap ( & mut tmp, & mut field. attrs ) ;
5252 }
@@ -64,7 +64,7 @@ pub fn span_derive(attr: TokenStream, input: TokenStream) -> TokenStream {
6464 for mut field in original_fields. named . clone ( ) . into_iter ( ) {
6565 let mut ignored = false ;
6666 for attr in field. attrs . iter ( ) {
67- if attr. path . is_ident ( IGNORE_ATTR_NAME ) {
67+ if attr. path ( ) . is_ident ( IGNORE_ATTR_NAME ) {
6868 ignored = true ;
6969 break ;
7070 }
@@ -170,8 +170,13 @@ pub fn generate_desc_tests(input: TokenStream) -> TokenStream {
170170 // Since include_dir! doesn't support dynamic paths, we need to handle specific folders
171171 let dir = match folder_path {
172172 "examples/core" => include_dir:: include_dir!( "$CARGO_MANIFEST_DIR/../examples/core" ) ,
173- "examples/error-examples" => include_dir:: include_dir!( "$CARGO_MANIFEST_DIR/../examples/error-examples" ) ,
174- _ => panic ! ( "Unsupported folder path: {}. Currently supported: examples/core, examples/error-examples" , folder_path) ,
173+ "examples/error-examples" => {
174+ include_dir:: include_dir!( "$CARGO_MANIFEST_DIR/../examples/error-examples" )
175+ }
176+ _ => panic ! (
177+ "Unsupported folder path: {}. Currently supported: examples/core, examples/error-examples" ,
178+ folder_path
179+ ) ,
175180 } ;
176181
177182 let mut test_functions = Vec :: new ( ) ;
@@ -236,7 +241,7 @@ pub fn generate_desc_tests(input: TokenStream) -> TokenStream {
236241 } else {
237242 test_functions. push ( quote ! {
238243 #[ test]
239- fn #test_name_ident( ) -> Result <( ) , descend:: error:: ErrorReported > {
244+ fn #test_name_ident( ) -> Result <( ) , descend:: error:: CompileError > {
240245 let output = descend:: compile( #file_path_lit) ?. 0 ;
241246 insta:: assert_snapshot!( output) ;
242247 Ok ( ( ) )
0 commit comments