@@ -24,7 +24,6 @@ pub(crate) struct TemplateInput<'a> {
2424 pub ( crate ) source : & ' a Source ,
2525 pub ( crate ) source_span : SourceSpan ,
2626 pub ( crate ) block : Option < ( & ' a str , Span ) > ,
27- #[ cfg( feature = "blocks" ) ]
2827 pub ( crate ) blocks : & ' a [ Block ] ,
2928 pub ( crate ) print : Print ,
3029 pub ( crate ) escaper : & ' a str ,
@@ -46,7 +45,6 @@ impl TemplateInput<'_> {
4645 template_span,
4746 source : ( source, source_span) ,
4847 block,
49- #[ cfg( feature = "blocks" ) ]
5048 blocks,
5149 print,
5250 escaping,
@@ -142,7 +140,6 @@ impl TemplateInput<'_> {
142140 source,
143141 source_span : source_span. clone ( ) ,
144142 block : block. as_ref ( ) . map ( |( block, span) | ( block. as_str ( ) , * span) ) ,
145- #[ cfg( feature = "blocks" ) ]
146143 blocks : blocks. as_slice ( ) ,
147144 print : * print,
148145 escaper,
@@ -411,7 +408,6 @@ impl AnyTemplateArgs {
411408 }
412409}
413410
414- #[ cfg( feature = "blocks" ) ]
415411pub ( crate ) struct Block {
416412 pub ( crate ) name : String ,
417413 pub ( crate ) span : Span ,
@@ -421,7 +417,6 @@ pub(crate) struct TemplateArgs {
421417 template_span : Span ,
422418 pub ( crate ) source : ( Source , SourceSpan ) ,
423419 block : Option < ( String , Span ) > ,
424- #[ cfg( feature = "blocks" ) ]
425420 blocks : Vec < Block > ,
426421 print : Print ,
427422 escaping : Option < String > ,
@@ -476,7 +471,6 @@ impl TemplateArgs {
476471 }
477472 } ,
478473 block : args. block . map ( |value| ( value. value ( ) , value. span ( ) ) ) ,
479- #[ cfg( feature = "blocks" ) ]
480474 blocks : args
481475 . blocks
482476 . unwrap_or_default ( )
@@ -503,7 +497,6 @@ impl TemplateArgs {
503497 template_span : Span :: call_site ( ) ,
504498 source : ( Source :: Source ( "" . into ( ) ) , SourceSpan :: empty ( ) ) ,
505499 block : None ,
506- #[ cfg( feature = "blocks" ) ]
507500 blocks : vec ! [ ] ,
508501 print : Print :: default ( ) ,
509502 escaping : None ,
@@ -765,7 +758,6 @@ pub(crate) struct PartialTemplateArgs {
765758 pub ( crate ) config : Option < LitStr > ,
766759 pub ( crate ) whitespace : Option < Whitespace > ,
767760 pub ( crate ) crate_name : Option < ExprPath > ,
768- #[ cfg( feature = "blocks" ) ]
769761 pub ( crate ) blocks : Option < Vec < LitStr > > ,
770762}
771763
@@ -831,7 +823,6 @@ const _: () = {
831823 config : None ,
832824 whitespace : None ,
833825 crate_name : None ,
834- #[ cfg( feature = "blocks" ) ]
835826 blocks : None ,
836827 } ;
837828 let mut has_data = false ;
@@ -886,30 +877,22 @@ const _: () = {
886877 this. crate_name = Some ( get_exprpath ( ident, pair. value ) ?) ;
887878 continue ;
888879 } else if ident == "blocks" {
889- if !cfg ! ( feature = "blocks" ) {
890- return Err ( CompileError :: no_file_info (
891- "enable feature `blocks` to use `blocks` argument" ,
892- Some ( ident. span ( ) ) ,
893- ) ) ;
894- } else if is_enum_variant {
880+ if is_enum_variant {
895881 return Err ( CompileError :: no_file_info (
896882 "template attribute `blocks` can only be used on the `enum`, \
897883 not its variants",
898884 Some ( ident. span ( ) ) ,
899885 ) ) ;
900886 }
901- #[ cfg( feature = "blocks" ) ]
902- {
903- ensure_only_once ( ident, & mut this. blocks ) ?;
904- this. blocks = Some (
905- get_exprarray ( ident, pair. value ) ?
906- . elems
907- . into_iter ( )
908- . map ( |value| get_strlit ( ident, get_lit ( ident, value) ?) )
909- . collect :: < Result < _ , _ > > ( ) ?,
910- ) ;
911- continue ;
912- }
887+ ensure_only_once ( ident, & mut this. blocks ) ?;
888+ this. blocks = Some (
889+ get_exprarray ( ident, pair. value ) ?
890+ . elems
891+ . into_iter ( )
892+ . map ( |value| get_strlit ( ident, get_lit ( ident, value) ?) )
893+ . collect :: < Result < _ , _ > > ( ) ?,
894+ ) ;
895+ continue ;
913896 }
914897
915898 let value = get_lit ( ident, pair. value ) ?;
@@ -1081,7 +1064,6 @@ const _: () = {
10811064 }
10821065 }
10831066
1084- #[ cfg( feature = "blocks" ) ]
10851067 fn get_exprarray ( name : & Ident , mut expr : Expr ) -> Result < syn:: ExprArray , CompileError > {
10861068 loop {
10871069 match expr {
0 commit comments