@@ -42,7 +42,7 @@ fn expect_ident(it: &mut token_stream::IntoIter) -> String {
42
42
}
43
43
44
44
fn expect_punct ( it : & mut token_stream:: IntoIter ) -> char {
45
- if let TokenTree :: Punct ( punct) = it. next ( ) . expect ( "Expected Punct" ) {
45
+ if let TokenTree :: Punct ( punct) = it. next ( ) . expect ( "Reached end of token stream for Punct" ) {
46
46
punct. as_char ( )
47
47
} else {
48
48
panic ! ( "Expected Punct" ) ;
@@ -54,7 +54,7 @@ fn expect_literal(it: &mut token_stream::IntoIter) -> String {
54
54
}
55
55
56
56
fn expect_group ( it : & mut token_stream:: IntoIter ) -> Group {
57
- if let TokenTree :: Group ( group) = it. next ( ) . expect ( "Expected group " ) {
57
+ if let TokenTree :: Group ( group) = it. next ( ) . expect ( "Reached end of token stream for Group " ) {
58
58
group
59
59
} else {
60
60
panic ! ( "Expected Group" ) ;
@@ -84,7 +84,7 @@ fn expect_array_fields(it: &mut token_stream::IntoIter) -> ParamType {
84
84
}
85
85
86
86
fn expect_type ( it : & mut token_stream:: IntoIter ) -> ParamType {
87
- if let TokenTree :: Ident ( ident) = it. next ( ) . expect ( "Expected param type" ) {
87
+ if let TokenTree :: Ident ( ident) = it. next ( ) . expect ( "Reached end of token stream for param type" ) {
88
88
match ident. to_string ( ) . as_ref ( ) {
89
89
"ArrayParam" => expect_array_fields ( it) ,
90
90
_ => ParamType :: Ident ( ident. to_string ( ) ) ,
@@ -578,7 +578,7 @@ pub fn module(ts: TokenStream) -> TokenStream {
578
578
}
579
579
580
580
let file =
581
- std:: env:: var ( "RUST_MODFILE" ) . expect ( "Unable to fetch key for environmental variable" ) ;
581
+ std:: env:: var ( "RUST_MODFILE" ) . expect ( "Unable to fetch RUST_MODFILE environmental variable" ) ;
582
582
583
583
format ! (
584
584
"
@@ -674,5 +674,5 @@ pub fn module(ts: TokenStream) -> TokenStream {
674
674
params_modinfo = params_modinfo,
675
675
generated_array_types = generated_array_types,
676
676
initcall_section = ".initcall6.init"
677
- ) . parse ( ) . expect ( "Unable to return formatted string" )
677
+ ) . parse ( ) . expect ( "LexError returned whle trying to parse the string token stream. " )
678
678
}
0 commit comments