Skip to content

Commit 901df8a

Browse files
committed
libsyntax: Remove unused MultiRenamer
1 parent 1d29163 commit 901df8a

File tree

1 file changed

+3
-17
lines changed

1 file changed

+3
-17
lines changed

src/libsyntax/ext/expand.rs

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -493,13 +493,14 @@ fn expand_non_macro_stmt(s: &Stmt, fld: &mut MacroExpander)
493493
let mut name_finder = new_name_finder(~[]);
494494
name_finder.visit_pat(expanded_pat,());
495495
// generate fresh names, push them to a new pending list
496-
let new_pending_renames = @mut ~[];
496+
let mut new_pending_renames = ~[];
497497
for ident in name_finder.ident_accumulator.iter() {
498498
let new_name = fresh_name(ident);
499499
new_pending_renames.push((*ident,new_name));
500500
}
501501
let rewritten_pat = {
502-
let mut rename_fld = renames_to_fold(new_pending_renames);
502+
let mut rename_fld =
503+
renames_to_fold(&mut new_pending_renames);
503504
// rewrite the pattern using the new names (the old ones
504505
// have already been applied):
505506
rename_fld.fold_pat(expanded_pat)
@@ -981,21 +982,6 @@ impl CtxtFn for Renamer {
981982
}
982983
}
983984

984-
// a renamer that performs a whole bunch of renames
985-
pub struct MultiRenamer {
986-
renames : @mut ~[(ast::Ident,ast::Name)]
987-
}
988-
989-
impl CtxtFn for MultiRenamer {
990-
fn f(&self, starting_ctxt : ast::SyntaxContext) -> ast::SyntaxContext {
991-
// the individual elements are memoized... it would
992-
// also be possible to memoize on the whole list at once.
993-
self.renames.iter().fold(starting_ctxt,|ctxt,&(from,to)| {
994-
new_rename(from,to,ctxt)
995-
})
996-
}
997-
}
998-
999985
// a marker adds the given mark to the syntax context
1000986
pub struct Marker { mark : Mrk }
1001987

0 commit comments

Comments
 (0)