remove unneeded imports, clean up unused var warnings
This commit is contained in:
parent
60562ac9f8
commit
dbf4e19ea5
@ -135,13 +135,13 @@ pub fn syntax_expander_table() -> SyntaxEnv {
|
||||
// utility function to simplify creating NormalTT syntax extensions
|
||||
// that ignore their contexts
|
||||
fn builtin_normal_tt_no_ctxt(f: SyntaxExpanderTTFunNoCtxt) -> @Transformer {
|
||||
let wrapped_expander : SyntaxExpanderTTFun = |a,b,c,d|{f(a,b,c)};
|
||||
let wrapped_expander : SyntaxExpanderTTFun = |a,b,c,_d|{f(a,b,c)};
|
||||
@SE(NormalTT(wrapped_expander, None))
|
||||
}
|
||||
// utility function to simplify creating IdentTT syntax extensions
|
||||
// that ignore their contexts
|
||||
fn builtin_item_tt_no_ctxt(f: SyntaxExpanderTTItemFunNoCtxt) -> @Transformer {
|
||||
let wrapped_expander : SyntaxExpanderTTItemFun = |a,b,c,d,e|{f(a,b,c,d)};
|
||||
let wrapped_expander : SyntaxExpanderTTItemFun = |a,b,c,d,_e|{f(a,b,c,d)};
|
||||
@SE(IdentTT(wrapped_expander, None))
|
||||
}
|
||||
let mut syntax_expanders = HashMap::new();
|
||||
|
@ -8,12 +8,12 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use ast::{Block, Crate, NodeId, DeclLocal, EMPTY_CTXT, Expr_, ExprMac, SyntaxContext};
|
||||
use ast::{Block, Crate, NodeId, DeclLocal, Expr_, ExprMac, SyntaxContext};
|
||||
use ast::{Local, Ident, mac_invoc_tt};
|
||||
use ast::{item_mac, Mrk, Stmt_, StmtDecl, StmtMac, StmtExpr, StmtSemi};
|
||||
use ast::{ILLEGAL_CTXT, SCTable, token_tree};
|
||||
use ast::{token_tree};
|
||||
use ast;
|
||||
use ast_util::{new_rename, new_mark, mtwt_resolve};
|
||||
use ast_util::{new_rename, new_mark};
|
||||
use attr;
|
||||
use attr::AttrMetaMethods;
|
||||
use codemap;
|
||||
@ -585,7 +585,7 @@ fn expand_non_macro_stmt (exts: SyntaxEnv,
|
||||
let new_name = fresh_name(ident);
|
||||
new_pending_renames.push((*ident,new_name));
|
||||
}
|
||||
let mut rename_fld = renames_to_fold(new_pending_renames);
|
||||
let rename_fld = renames_to_fold(new_pending_renames);
|
||||
// rewrite the pattern using the new names (the old ones
|
||||
// have already been applied):
|
||||
let rewritten_pat = rename_fld.fold_pat(expanded_pat);
|
||||
@ -906,7 +906,7 @@ pub fn expand_block(extsbox: @mut SyntaxEnv,
|
||||
_cx: @ExtCtxt,
|
||||
blk: &Block,
|
||||
fld: @ast_fold,
|
||||
orig: @fn(&Block, @ast_fold) -> Block)
|
||||
_orig: @fn(&Block, @ast_fold) -> Block)
|
||||
-> Block {
|
||||
// see note below about treatment of exts table
|
||||
with_exts_frame!(extsbox,false,
|
||||
@ -917,7 +917,7 @@ pub fn expand_block(extsbox: @mut SyntaxEnv,
|
||||
pub fn expand_block_elts(exts: SyntaxEnv, b: &Block, fld: @ast_fold) -> Block {
|
||||
let block_info = get_block_info(exts);
|
||||
let pending_renames = block_info.pending_renames;
|
||||
let mut rename_fld = renames_to_fold(pending_renames);
|
||||
let rename_fld = renames_to_fold(pending_renames);
|
||||
let new_view_items = b.view_items.map(|x| fld.fold_view_item(x));
|
||||
let mut new_stmts = ~[];
|
||||
for x in b.stmts.iter() {
|
||||
@ -1456,7 +1456,7 @@ impl CtxtFn for Marker {
|
||||
pub struct Repainter { ctxt : SyntaxContext }
|
||||
|
||||
impl CtxtFn for Repainter {
|
||||
fn f(&self, ctxt : ast::SyntaxContext) -> ast::SyntaxContext {
|
||||
fn f(&self, _ctxt : ast::SyntaxContext) -> ast::SyntaxContext {
|
||||
self.ctxt
|
||||
}
|
||||
}
|
||||
|
@ -17,10 +17,7 @@ use util::interner;
|
||||
|
||||
use std::cast;
|
||||
use std::char;
|
||||
use std::cmp::Equiv;
|
||||
use std::local_data;
|
||||
use std::rand;
|
||||
use std::rand::RngUtil;
|
||||
|
||||
#[deriving(Clone, Encodable, Decodable, Eq, IterBytes)]
|
||||
pub enum binop {
|
||||
@ -565,8 +562,8 @@ pub fn str_ptr_eq(a : @str, b : @str) -> bool {
|
||||
let q : uint = cast::transmute(b);
|
||||
let result = p == q;
|
||||
// got to transmute them back, to make sure the ref count is correct:
|
||||
let junk1 : @str = cast::transmute(p);
|
||||
let junk2 : @str = cast::transmute(q);
|
||||
let _junk1 : @str = cast::transmute(p);
|
||||
let _junk2 : @str = cast::transmute(q);
|
||||
result
|
||||
}
|
||||
}
|
||||
|
@ -619,7 +619,8 @@ pub fn print_item(s: @ps, item: &ast::item) {
|
||||
}
|
||||
bclose(s, item.span);
|
||||
}
|
||||
ast::item_mac(codemap::Spanned { node: ast::mac_invoc_tt(ref pth, ref tts, ctxt),
|
||||
// I think it's reasonable to hide the context here:
|
||||
ast::item_mac(codemap::Spanned { node: ast::mac_invoc_tt(ref pth, ref tts, _),
|
||||
_}) => {
|
||||
print_visibility(s, item.vis);
|
||||
print_path(s, pth, false);
|
||||
@ -1021,7 +1022,8 @@ pub fn print_if(s: @ps, test: &ast::Expr, blk: &ast::Block,
|
||||
|
||||
pub fn print_mac(s: @ps, m: &ast::mac) {
|
||||
match m.node {
|
||||
ast::mac_invoc_tt(ref pth, ref tts, ctxt) => {
|
||||
// I think it's reasonable to hide the ctxt here:
|
||||
ast::mac_invoc_tt(ref pth, ref tts, _) => {
|
||||
print_path(s, pth, false);
|
||||
word(s.s, "!");
|
||||
popen(s);
|
||||
|
Loading…
x
Reference in New Issue
Block a user