Skip to content

Commit a200816

Browse files
committed
Fix an unused variable warning and clean up some dead code/names.
1 parent bcf62e7 commit a200816

File tree

3 files changed

+13
-21
lines changed

3 files changed

+13
-21
lines changed

src/librustc/middle/trans/base.rs

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2218,23 +2218,14 @@ pub fn trans_mod(ccx: @mut CrateContext, m: &ast::_mod) {
22182218
pub fn register_fn(ccx: @mut CrateContext,
22192219
sp: span,
22202220
sym: ~str,
2221-
node_id: ast::NodeId)
2222-
-> ValueRef {
2223-
let t = ty::node_id_to_type(ccx.tcx, node_id);
2224-
register_fn_full(ccx, sp, sym, node_id, t)
2225-
}
2226-
2227-
pub fn register_fn_full(ccx: @mut CrateContext,
2228-
sp: span,
2229-
sym: ~str,
2230-
node_id: ast::NodeId,
2231-
node_type: ty::t)
2232-
-> ValueRef {
2221+
node_id: ast::NodeId,
2222+
node_type: ty::t)
2223+
-> ValueRef {
22332224
let llfty = type_of_fn_from_ty(ccx, node_type);
2234-
register_fn_fuller(ccx, sp, sym, node_id, lib::llvm::CCallConv, llfty)
2225+
register_fn_llvmty(ccx, sp, sym, node_id, lib::llvm::CCallConv, llfty)
22352226
}
22362227

2237-
pub fn register_fn_fuller(ccx: @mut CrateContext,
2228+
pub fn register_fn_llvmty(ccx: @mut CrateContext,
22382229
sp: span,
22392230
sym: ~str,
22402231
node_id: ast::NodeId,
@@ -2449,7 +2440,7 @@ pub fn get_item_val(ccx: @mut CrateContext, id: ast::NodeId) -> ValueRef {
24492440

24502441
ast::item_fn(_, purity, _, _, _) => {
24512442
let llfn = if purity != ast::extern_fn {
2452-
register_fn_full(ccx, i.span, sym, i.id, ty)
2443+
register_fn(ccx, i.span, sym, i.id, ty)
24532444
} else {
24542445
foreign::register_foreign_fn(ccx, i.span, sym, i.id)
24552446
};
@@ -2499,7 +2490,7 @@ pub fn get_item_val(ccx: @mut CrateContext, id: ast::NodeId) -> ValueRef {
24992490
let path = vec::append((*pth).clone(), [path_name(ni.ident)]);
25002491
let sym = exported_name(ccx, path, ty, ni.attrs);
25012492

2502-
register_fn_full(ccx, ni.span, sym, ni.id, ty)
2493+
register_fn(ccx, ni.span, sym, ni.id, ty)
25032494
}
25042495
ast::foreign_item_static(*) => {
25052496
let ident = token::ident_to_str(&ni.ident);
@@ -2527,7 +2518,7 @@ pub fn get_item_val(ccx: @mut CrateContext, id: ast::NodeId) -> ValueRef {
25272518

25282519
llfn = match enm.node {
25292520
ast::item_enum(_, _) => {
2530-
register_fn_full(ccx, (*v).span, sym, id, ty)
2521+
register_fn(ccx, (*v).span, sym, id, ty)
25312522
}
25322523
_ => fail!("node_variant, shouldn't happen")
25332524
};
@@ -2551,7 +2542,8 @@ pub fn get_item_val(ccx: @mut CrateContext, id: ast::NodeId) -> ValueRef {
25512542
let ty = ty::node_id_to_type(ccx.tcx, ctor_id);
25522543
let sym = exported_name(ccx, (*struct_path).clone(), ty,
25532544
struct_item.attrs);
2554-
let llfn = register_fn_full(ccx, struct_item.span, sym, ctor_id, ty);
2545+
let llfn = register_fn(ccx, struct_item.span,
2546+
sym, ctor_id, ty);
25552547
set_inline_hint(llfn);
25562548
llfn
25572549
}
@@ -2586,7 +2578,7 @@ pub fn register_method(ccx: @mut CrateContext,
25862578

25872579
let sym = exported_name(ccx, path, mty, m.attrs);
25882580

2589-
let llfn = register_fn_full(ccx, m.span, sym, id, mty);
2581+
let llfn = register_fn(ccx, m.span, sym, id, mty);
25902582
set_inline_hint_if_appr(m.attrs, llfn);
25912583
llfn
25922584
}

src/librustc/middle/trans/foreign.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1157,6 +1157,6 @@ pub fn register_foreign_fn(ccx: @mut CrateContext,
11571157

11581158
let tys = shim_types(ccx, node_id);
11591159
do tys.fn_ty.decl_fn |fnty| {
1160-
register_fn_fuller(ccx, sp, sym.take(), node_id, lib::llvm::CCallConv, fnty)
1160+
register_fn_llvmty(ccx, sp, sym.take(), node_id, lib::llvm::CCallConv, fnty)
11611161
}
11621162
}

src/libsyntax/ast_util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ impl IdVisitor {
410410
impl Visitor<()> for IdVisitor {
411411
fn visit_mod(@mut self,
412412
module: &_mod,
413-
span: span,
413+
_span: span,
414414
node_id: NodeId,
415415
env: ()) {
416416
(self.visit_callback)(node_id);

0 commit comments

Comments
 (0)