@@ -63,7 +63,6 @@ struct Context<'a, 'b:'a> {
63
63
all_pieces_simple : bool ,
64
64
65
65
name_positions : HashMap < string:: String , uint > ,
66
- method_statics : Vec < P < ast:: Item > > ,
67
66
68
67
/// Updated as arguments are consumed or methods are entered
69
68
nest_level : uint ,
@@ -495,20 +494,12 @@ impl<'a, 'b> Context<'a, 'b> {
495
494
/// Actually builds the expression which the iformat! block will be expanded
496
495
/// to
497
496
fn to_expr ( mut self , invocation : Invocation ) -> P < ast:: Expr > {
498
- let mut lets = Vec :: new ( ) ;
499
497
let mut locals = Vec :: new ( ) ;
500
498
let mut names = Vec :: from_fn ( self . name_positions . len ( ) , |_| None ) ;
501
499
let mut pats = Vec :: new ( ) ;
502
500
let mut heads = Vec :: new ( ) ;
503
501
504
- // First, declare all of our methods that are statics
505
- for method in self . method_statics . into_iter ( ) {
506
- let decl = respan ( self . fmtsp , ast:: DeclItem ( method) ) ;
507
- lets. push ( P ( respan ( self . fmtsp ,
508
- ast:: StmtDecl ( P ( decl) , ast:: DUMMY_NODE_ID ) ) ) ) ;
509
- }
510
-
511
- // Next, build up the static array which will become our precompiled
502
+ // First, build up the static array which will become our precompiled
512
503
// format "string"
513
504
let static_str_name = self . ecx . ident_of ( "__STATIC_FMTSTR" ) ;
514
505
let static_lifetime = self . ecx . lifetime ( self . fmtsp , self . ecx . ident_of ( "'static" ) . name ) ;
@@ -517,10 +508,9 @@ impl<'a, 'b> Context<'a, 'b> {
517
508
self . ecx . ty_ident ( self . fmtsp , self . ecx . ident_of ( "str" ) ) ,
518
509
Some ( static_lifetime) ,
519
510
ast:: MutImmutable ) ;
520
- lets. push ( Context :: item_static_array ( self . ecx ,
521
- static_str_name,
522
- piece_ty,
523
- self . str_pieces ) ) ;
511
+ let mut lets = vec ! [
512
+ Context :: item_static_array( self . ecx, static_str_name, piece_ty, self . str_pieces)
513
+ ] ;
524
514
525
515
// Then, build up the static array which will store our precompiled
526
516
// nonstandard placeholders, if there are any.
@@ -728,7 +718,6 @@ pub fn expand_preparsed_format_args(ecx: &mut ExtCtxt, sp: Span,
728
718
pieces : Vec :: new ( ) ,
729
719
str_pieces : Vec :: new ( ) ,
730
720
all_pieces_simple : true ,
731
- method_statics : Vec :: new ( ) ,
732
721
fmtsp : sp,
733
722
} ;
734
723
cx. fmtsp = efmt. span ;
0 commit comments