syntax: format: remove unused method_statics field.
This commit is contained in:
parent
0201334439
commit
22376be754
1 changed files with 4 additions and 15 deletions
|
@ -63,7 +63,6 @@ struct Context<'a, 'b:'a> {
|
||||||
all_pieces_simple: bool,
|
all_pieces_simple: bool,
|
||||||
|
|
||||||
name_positions: HashMap<string::String, uint>,
|
name_positions: HashMap<string::String, uint>,
|
||||||
method_statics: Vec<P<ast::Item>>,
|
|
||||||
|
|
||||||
/// Updated as arguments are consumed or methods are entered
|
/// Updated as arguments are consumed or methods are entered
|
||||||
nest_level: uint,
|
nest_level: uint,
|
||||||
|
@ -495,20 +494,12 @@ impl<'a, 'b> Context<'a, 'b> {
|
||||||
/// Actually builds the expression which the iformat! block will be expanded
|
/// Actually builds the expression which the iformat! block will be expanded
|
||||||
/// to
|
/// to
|
||||||
fn to_expr(mut self, invocation: Invocation) -> P<ast::Expr> {
|
fn to_expr(mut self, invocation: Invocation) -> P<ast::Expr> {
|
||||||
let mut lets = Vec::new();
|
|
||||||
let mut locals = Vec::new();
|
let mut locals = Vec::new();
|
||||||
let mut names = Vec::from_fn(self.name_positions.len(), |_| None);
|
let mut names = Vec::from_fn(self.name_positions.len(), |_| None);
|
||||||
let mut pats = Vec::new();
|
let mut pats = Vec::new();
|
||||||
let mut heads = Vec::new();
|
let mut heads = Vec::new();
|
||||||
|
|
||||||
// First, declare all of our methods that are statics
|
// First, build up the static array which will become our precompiled
|
||||||
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
|
|
||||||
// format "string"
|
// format "string"
|
||||||
let static_str_name = self.ecx.ident_of("__STATIC_FMTSTR");
|
let static_str_name = self.ecx.ident_of("__STATIC_FMTSTR");
|
||||||
let static_lifetime = self.ecx.lifetime(self.fmtsp, self.ecx.ident_of("'static").name);
|
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")),
|
self.ecx.ty_ident(self.fmtsp, self.ecx.ident_of("str")),
|
||||||
Some(static_lifetime),
|
Some(static_lifetime),
|
||||||
ast::MutImmutable);
|
ast::MutImmutable);
|
||||||
lets.push(Context::item_static_array(self.ecx,
|
let mut lets = vec![
|
||||||
static_str_name,
|
Context::item_static_array(self.ecx, static_str_name, piece_ty, self.str_pieces)
|
||||||
piece_ty,
|
];
|
||||||
self.str_pieces));
|
|
||||||
|
|
||||||
// Then, build up the static array which will store our precompiled
|
// Then, build up the static array which will store our precompiled
|
||||||
// nonstandard placeholders, if there are any.
|
// nonstandard placeholders, if there are any.
|
||||||
|
@ -728,7 +718,6 @@ pub fn expand_preparsed_format_args(ecx: &mut ExtCtxt, sp: Span,
|
||||||
pieces: Vec::new(),
|
pieces: Vec::new(),
|
||||||
str_pieces: Vec::new(),
|
str_pieces: Vec::new(),
|
||||||
all_pieces_simple: true,
|
all_pieces_simple: true,
|
||||||
method_statics: Vec::new(),
|
|
||||||
fmtsp: sp,
|
fmtsp: sp,
|
||||||
};
|
};
|
||||||
cx.fmtsp = efmt.span;
|
cx.fmtsp = efmt.span;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue