librustc: Change fold to use traits instead of @fn.
This commit is contained in:
@@ -12,7 +12,6 @@ use ast::*;
|
||||
use ast;
|
||||
use ast_util;
|
||||
use codemap::{Span, dummy_sp};
|
||||
use fold;
|
||||
use opt_vec;
|
||||
use parse::token;
|
||||
use visit::Visitor;
|
||||
@@ -371,21 +370,6 @@ pub fn empty_generics() -> Generics {
|
||||
ty_params: opt_vec::Empty}
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// Assigning node ids
|
||||
|
||||
fn node_id_assigner(next_id: @fn() -> ast::NodeId) -> @fold::ast_fold {
|
||||
let precursor = @fold::AstFoldFns {
|
||||
new_id: |old_id| {
|
||||
assert_eq!(old_id, ast::DUMMY_NODE_ID);
|
||||
next_id()
|
||||
},
|
||||
..*fold::default_ast_fold()
|
||||
};
|
||||
|
||||
fold::make_fold(precursor)
|
||||
}
|
||||
|
||||
// ______________________________________________________________________
|
||||
// Enumerating the IDs which appear in an AST
|
||||
|
||||
|
||||
Reference in New Issue
Block a user