Skip to content

Commit dbf4e19

Browse files
committed
remove unneeded imports, clean up unused var warnings
1 parent 60562ac commit dbf4e19

File tree

4 files changed

+15
-16
lines changed

4 files changed

+15
-16
lines changed

src/libsyntax/ext/base.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,13 +135,13 @@ pub fn syntax_expander_table() -> SyntaxEnv {
135135
// utility function to simplify creating NormalTT syntax extensions
136136
// that ignore their contexts
137137
fn builtin_normal_tt_no_ctxt(f: SyntaxExpanderTTFunNoCtxt) -> @Transformer {
138-
let wrapped_expander : SyntaxExpanderTTFun = |a,b,c,d|{f(a,b,c)};
138+
let wrapped_expander : SyntaxExpanderTTFun = |a,b,c,_d|{f(a,b,c)};
139139
@SE(NormalTT(wrapped_expander, None))
140140
}
141141
// utility function to simplify creating IdentTT syntax extensions
142142
// that ignore their contexts
143143
fn builtin_item_tt_no_ctxt(f: SyntaxExpanderTTItemFunNoCtxt) -> @Transformer {
144-
let wrapped_expander : SyntaxExpanderTTItemFun = |a,b,c,d,e|{f(a,b,c,d)};
144+
let wrapped_expander : SyntaxExpanderTTItemFun = |a,b,c,d,_e|{f(a,b,c,d)};
145145
@SE(IdentTT(wrapped_expander, None))
146146
}
147147
let mut syntax_expanders = HashMap::new();

src/libsyntax/ext/expand.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use ast::{Block, Crate, NodeId, DeclLocal, EMPTY_CTXT, Expr_, ExprMac, SyntaxContext};
11+
use ast::{Block, Crate, NodeId, DeclLocal, Expr_, ExprMac, SyntaxContext};
1212
use ast::{Local, Ident, mac_invoc_tt};
1313
use ast::{item_mac, Mrk, Stmt_, StmtDecl, StmtMac, StmtExpr, StmtSemi};
14-
use ast::{ILLEGAL_CTXT, SCTable, token_tree};
14+
use ast::{token_tree};
1515
use ast;
16-
use ast_util::{new_rename, new_mark, mtwt_resolve};
16+
use ast_util::{new_rename, new_mark};
1717
use attr;
1818
use attr::AttrMetaMethods;
1919
use codemap;
@@ -585,7 +585,7 @@ fn expand_non_macro_stmt (exts: SyntaxEnv,
585585
let new_name = fresh_name(ident);
586586
new_pending_renames.push((*ident,new_name));
587587
}
588-
let mut rename_fld = renames_to_fold(new_pending_renames);
588+
let rename_fld = renames_to_fold(new_pending_renames);
589589
// rewrite the pattern using the new names (the old ones
590590
// have already been applied):
591591
let rewritten_pat = rename_fld.fold_pat(expanded_pat);
@@ -906,7 +906,7 @@ pub fn expand_block(extsbox: @mut SyntaxEnv,
906906
_cx: @ExtCtxt,
907907
blk: &Block,
908908
fld: @ast_fold,
909-
orig: @fn(&Block, @ast_fold) -> Block)
909+
_orig: @fn(&Block, @ast_fold) -> Block)
910910
-> Block {
911911
// see note below about treatment of exts table
912912
with_exts_frame!(extsbox,false,
@@ -917,7 +917,7 @@ pub fn expand_block(extsbox: @mut SyntaxEnv,
917917
pub fn expand_block_elts(exts: SyntaxEnv, b: &Block, fld: @ast_fold) -> Block {
918918
let block_info = get_block_info(exts);
919919
let pending_renames = block_info.pending_renames;
920-
let mut rename_fld = renames_to_fold(pending_renames);
920+
let rename_fld = renames_to_fold(pending_renames);
921921
let new_view_items = b.view_items.map(|x| fld.fold_view_item(x));
922922
let mut new_stmts = ~[];
923923
for x in b.stmts.iter() {
@@ -1456,7 +1456,7 @@ impl CtxtFn for Marker {
14561456
pub struct Repainter { ctxt : SyntaxContext }
14571457

14581458
impl CtxtFn for Repainter {
1459-
fn f(&self, ctxt : ast::SyntaxContext) -> ast::SyntaxContext {
1459+
fn f(&self, _ctxt : ast::SyntaxContext) -> ast::SyntaxContext {
14601460
self.ctxt
14611461
}
14621462
}

src/libsyntax/parse/token.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,7 @@ use util::interner;
1717

1818
use std::cast;
1919
use std::char;
20-
use std::cmp::Equiv;
2120
use std::local_data;
22-
use std::rand;
23-
use std::rand::RngUtil;
2421

2522
#[deriving(Clone, Encodable, Decodable, Eq, IterBytes)]
2623
pub enum binop {
@@ -565,8 +562,8 @@ pub fn str_ptr_eq(a : @str, b : @str) -> bool {
565562
let q : uint = cast::transmute(b);
566563
let result = p == q;
567564
// got to transmute them back, to make sure the ref count is correct:
568-
let junk1 : @str = cast::transmute(p);
569-
let junk2 : @str = cast::transmute(q);
565+
let _junk1 : @str = cast::transmute(p);
566+
let _junk2 : @str = cast::transmute(q);
570567
result
571568
}
572569
}

src/libsyntax/print/pprust.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,8 @@ pub fn print_item(s: @ps, item: &ast::item) {
619619
}
620620
bclose(s, item.span);
621621
}
622-
ast::item_mac(codemap::Spanned { node: ast::mac_invoc_tt(ref pth, ref tts, ctxt),
622+
// I think it's reasonable to hide the context here:
623+
ast::item_mac(codemap::Spanned { node: ast::mac_invoc_tt(ref pth, ref tts, _),
623624
_}) => {
624625
print_visibility(s, item.vis);
625626
print_path(s, pth, false);
@@ -1021,7 +1022,8 @@ pub fn print_if(s: @ps, test: &ast::Expr, blk: &ast::Block,
10211022

10221023
pub fn print_mac(s: @ps, m: &ast::mac) {
10231024
match m.node {
1024-
ast::mac_invoc_tt(ref pth, ref tts, ctxt) => {
1025+
// I think it's reasonable to hide the ctxt here:
1026+
ast::mac_invoc_tt(ref pth, ref tts, _) => {
10251027
print_path(s, pth, false);
10261028
word(s.s, "!");
10271029
popen(s);

0 commit comments

Comments
 (0)