From 22376be7542c84b0412c403ced931c12ec1bfc0e Mon Sep 17 00:00:00 2001 From: Eduard Burtescu Date: Fri, 19 Dec 2014 01:31:02 +0200 Subject: [PATCH] syntax: format: remove unused method_statics field. --- src/libsyntax/ext/format.rs | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/src/libsyntax/ext/format.rs b/src/libsyntax/ext/format.rs index aad4045f00a..fe37c093d43 100644 --- a/src/libsyntax/ext/format.rs +++ b/src/libsyntax/ext/format.rs @@ -63,7 +63,6 @@ struct Context<'a, 'b:'a> { all_pieces_simple: bool, name_positions: HashMap, - method_statics: Vec>, /// Updated as arguments are consumed or methods are entered nest_level: uint, @@ -495,20 +494,12 @@ impl<'a, 'b> Context<'a, 'b> { /// Actually builds the expression which the iformat! block will be expanded /// to fn to_expr(mut self, invocation: Invocation) -> P { - let mut lets = Vec::new(); let mut locals = Vec::new(); let mut names = Vec::from_fn(self.name_positions.len(), |_| None); let mut pats = Vec::new(); let mut heads = Vec::new(); - // First, declare all of our methods that are statics - for method in self.method_statics.into_iter() { - let decl = respan(self.fmtsp, ast::DeclItem(method)); - lets.push(P(respan(self.fmtsp, - ast::StmtDecl(P(decl), ast::DUMMY_NODE_ID)))); - } - - // Next, build up the static array which will become our precompiled + // First, build up the static array which will become our precompiled // format "string" let static_str_name = self.ecx.ident_of("__STATIC_FMTSTR"); let static_lifetime = self.ecx.lifetime(self.fmtsp, self.ecx.ident_of("'static").name); @@ -517,10 +508,9 @@ impl<'a, 'b> Context<'a, 'b> { self.ecx.ty_ident(self.fmtsp, self.ecx.ident_of("str")), Some(static_lifetime), ast::MutImmutable); - lets.push(Context::item_static_array(self.ecx, - static_str_name, - piece_ty, - self.str_pieces)); + let mut lets = vec![ + Context::item_static_array(self.ecx, static_str_name, piece_ty, self.str_pieces) + ]; // Then, build up the static array which will store our precompiled // nonstandard placeholders, if there are any. @@ -728,7 +718,6 @@ pub fn expand_preparsed_format_args(ecx: &mut ExtCtxt, sp: Span, pieces: Vec::new(), str_pieces: Vec::new(), all_pieces_simple: true, - method_statics: Vec::new(), fmtsp: sp, }; cx.fmtsp = efmt.span;