diff --git a/src/libstd/bitv.rs b/src/libstd/bitv.rs index 901430a279b..036bb0022ca 100644 --- a/src/libstd/bitv.rs +++ b/src/libstd/bitv.rs @@ -231,7 +231,7 @@ struct bitv { assign => s.become(s1, self.nbits), difference => s.difference(s1, self.nbits) }, - big(s1) => self.die() + big(_) => self.die() }, big(s) => match other.rep { small(_) => self.die(), diff --git a/src/libsyntax/ast_map.rs b/src/libsyntax/ast_map.rs index fbcfb3139d1..68dd986025b 100644 --- a/src/libsyntax/ast_map.rs +++ b/src/libsyntax/ast_map.rs @@ -193,7 +193,7 @@ fn map_item(i: @item, cx: ctx, v: vt) { let item_path = @/* FIXME (#2543) */ copy cx.path; cx.map.insert(i.id, node_item(i, item_path)); match i.node { - item_impl(_, opt_ir, _, ms) => { + item_impl(_, _, _, ms) => { let impl_did = ast_util::local_def(i.id); for ms.each |m| { map_method(impl_did, extend(cx, i.ident), m, diff --git a/src/libsyntax/ast_util.rs b/src/libsyntax/ast_util.rs index 9ea9cf000f9..17a9942c489 100644 --- a/src/libsyntax/ast_util.rs +++ b/src/libsyntax/ast_util.rs @@ -372,7 +372,7 @@ impl inlined_item: inlined_item_utils { ii_ctor(ctor, nm, tps, parent_id) => { visit::visit_class_ctor_helper(ctor, nm, tps, parent_id, e, v); } - ii_dtor(dtor, nm, tps, parent_id) => { + ii_dtor(dtor, _, tps, parent_id) => { visit::visit_class_dtor_helper(dtor, tps, parent_id, e, v); } } @@ -504,7 +504,7 @@ fn id_visitor(vfn: fn@(node_id)) -> visit::vt<()> { vfn(id); match fk { - visit::fk_ctor(nm, _, tps, self_id, parent_id) => { + visit::fk_ctor(_, _, tps, self_id, parent_id) => { vec::iter(tps, |tp| vfn(tp.id)); vfn(id); vfn(self_id); @@ -583,7 +583,7 @@ pure fn is_item_impl(item: @ast::item) -> bool { fn walk_pat(pat: @pat, it: fn(@pat)) { it(pat); match pat.node { - pat_ident(_, pth, some(p)) => walk_pat(p, it), + pat_ident(_, _, some(p)) => walk_pat(p, it), pat_rec(fields, _) | pat_struct(_, fields, _) => for fields.each |f| { walk_pat(f.pat, it) }, pat_enum(_, some(s)) | pat_tup(s) => for s.each |p| { diff --git a/src/libsyntax/attr.rs b/src/libsyntax/attr.rs index c1838c77802..132e8f6b8dd 100644 --- a/src/libsyntax/attr.rs +++ b/src/libsyntax/attr.rs @@ -204,7 +204,7 @@ fn eq(a: @ast::meta_item, b: @ast::meta_item) -> bool { ast::meta_name_value(nb, vb) => na == nb && va.node == vb.node, _ => false }, - ast::meta_list(na, la) => { + ast::meta_list(*) => { // ~[Fixme-sorting] // FIXME (#607): Needs implementing diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs index 0b6c2ea5a99..a66b37b49bd 100644 --- a/src/libsyntax/ext/expand.rs +++ b/src/libsyntax/ext/expand.rs @@ -211,7 +211,7 @@ fn expand_item_mac(exts: hashmap<~str, syntax_extension>, span: expand.span}})); let maybe_it = match expanded { mr_item(it) => fld.fold_item(it), - mr_expr(e) => cx.span_fatal(pth.span, + mr_expr(_) => cx.span_fatal(pth.span, ~"expr macro in item position: " + *extname), mr_def(mdef) => { diff --git a/src/libsyntax/ext/pipes/pipec.rs b/src/libsyntax/ext/pipes/pipec.rs index 315d02eadd3..1c501120c06 100644 --- a/src/libsyntax/ext/pipes/pipec.rs +++ b/src/libsyntax/ext/pipes/pipec.rs @@ -41,7 +41,7 @@ impl message: gen_send { fn gen_send(cx: ext_ctxt, try: bool) -> @ast::item { debug!("pipec: gen_send"); match self { - message(id, span, tys, this, + message(_id, span, tys, this, some({state: next, tys: next_tys})) => { debug!("pipec: next state exists"); let next = this.proto.get_state(next); @@ -126,7 +126,7 @@ impl message: gen_send { cx.expr_block(body)) } - message(id, span, tys, this, none) => { + message(_id, span, tys, this, none) => { debug!("pipec: no next state"); let arg_names = tys.mapi(|i, _ty| (~"x_" + i.to_str())); diff --git a/src/libsyntax/ext/simplext.rs b/src/libsyntax/ext/simplext.rs index 586a428c1d7..6a9507f5ce3 100644 --- a/src/libsyntax/ext/simplext.rs +++ b/src/libsyntax/ext/simplext.rs @@ -635,7 +635,7 @@ fn add_new_extension(cx: ext_ctxt, sp: span, arg: ast::mac_arg, let mut clauses: ~[@clause] = ~[]; for args.each |arg| { match arg.node { - expr_vec(elts, mutbl) => { + expr_vec(elts, _) => { if vec::len(elts) != 2u { cx.span_fatal((*arg).span, ~"extension clause must consist of ~[" + diff --git a/src/libsyntax/ext/tt/macro_rules.rs b/src/libsyntax/ext/tt/macro_rules.rs index be7594ff843..77e0970d423 100644 --- a/src/libsyntax/ext/tt/macro_rules.rs +++ b/src/libsyntax/ext/tt/macro_rules.rs @@ -42,11 +42,11 @@ fn add_new_extension(cx: ext_ctxt, sp: span, name: ident, // Extract the arguments: let lhses:~[@named_match] = match argument_map.get(lhs_nm) { - @matched_seq(s, sp) => s, + @matched_seq(s, _) => s, _ => cx.span_bug(sp, ~"wrong-structured lhs") }; let rhses:~[@named_match] = match argument_map.get(rhs_nm) { - @matched_seq(s, sp) => s, + @matched_seq(s, _) => s, _ => cx.span_bug(sp, ~"wrong-structured rhs") }; diff --git a/src/libsyntax/fold.rs b/src/libsyntax/fold.rs index 3c06edb443b..360605aab2c 100644 --- a/src/libsyntax/fold.rs +++ b/src/libsyntax/fold.rs @@ -116,7 +116,7 @@ fn fold_mac_(m: mac, fld: ast_fold) -> mac { mac_invoc(fld.fold_path(pth), option::map(arg, |x| fld.fold_expr(x)), body) } - mac_invoc_tt(pth, tt) => m.node, + mac_invoc_tt(*) => m.node, mac_ellipsis => mac_ellipsis, mac_aq(_,_) => /* FIXME (#2543) */ copy m.node, mac_var(_) => /* FIXME (#2543) */ copy m.node, diff --git a/src/libsyntax/parse/classify.rs b/src/libsyntax/parse/classify.rs index 4082f223e4a..8f44a165ea4 100644 --- a/src/libsyntax/parse/classify.rs +++ b/src/libsyntax/parse/classify.rs @@ -31,7 +31,7 @@ fn stmt_ends_with_semi(stmt: ast::stmt) -> bool { ast::stmt_expr(e, _) => { return expr_requires_semi_to_be_stmt(e); } - ast::stmt_semi(e, _) => { + ast::stmt_semi(*) => { return false; } } diff --git a/src/libsyntax/parse/eval.rs b/src/libsyntax/parse/eval.rs index 2eafa4a6f34..615d546bb96 100644 --- a/src/libsyntax/parse/eval.rs +++ b/src/libsyntax/parse/eval.rs @@ -130,7 +130,7 @@ fn eval_crate_directive(cx: ctx, cdir: @ast::crate_directive, prefix: ~str, vec::push(items, i); } ast::cdir_view_item(vi) => vec::push(view_items, vi), - ast::cdir_syntax(pth) => () + ast::cdir_syntax(*) => () } } // diff --git a/src/libsyntax/parse/lexer.rs b/src/libsyntax/parse/lexer.rs index 854633aa06e..bef69be4e8a 100644 --- a/src/libsyntax/parse/lexer.rs +++ b/src/libsyntax/parse/lexer.rs @@ -313,7 +313,7 @@ fn scan_digits(rdr: string_reader, radix: uint) -> ~str { let c = rdr.curr; if c == '_' { bump(rdr); again; } match char::to_digit(c, radix) { - some(d) => { + some(_) => { str::push_char(rslt, c); bump(rdr); } diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index 1a2e36d081b..29c41949e21 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -923,7 +923,7 @@ fn print_if(s: ps, test: @ast::expr, blk: ast::blk, fn print_mac(s: ps, m: ast::mac) { match m.node { - ast::mac_invoc(path, arg, body) => { + ast::mac_invoc(path, arg, _body) => { word(s.s, ~"#"); print_path(s, path, false); match arg { diff --git a/src/libsyntax/visit.rs b/src/libsyntax/visit.rs index a5f86dee1cc..56d3d3a26f4 100644 --- a/src/libsyntax/visit.rs +++ b/src/libsyntax/visit.rs @@ -384,11 +384,11 @@ fn visit_exprs(exprs: ~[@expr], e: E, v: vt) { fn visit_mac(m: mac, e: E, v: vt) { match m.node { - ast::mac_invoc(pth, arg, body) => { + ast::mac_invoc(_, arg, _) => { option::map(arg, |arg| v.visit_expr(arg, e, v)); } - ast::mac_invoc_tt(pth, tt) => { /* no user-serviceable parts inside */ } + ast::mac_invoc_tt(*) => { /* no user-serviceable parts inside */ } ast::mac_ellipsis => (), - ast::mac_aq(_, e) => { /* FIXME: maybe visit (Issue #2340) */ } + ast::mac_aq(*) => { /* FIXME: maybe visit (Issue #2340) */ } ast::mac_var(_) => () } } diff --git a/src/rustc/middle/trans/base.rs b/src/rustc/middle/trans/base.rs index 1f1e204d54e..dddcdd64da3 100644 --- a/src/rustc/middle/trans/base.rs +++ b/src/rustc/middle/trans/base.rs @@ -759,7 +759,7 @@ fn make_free_glue(bcx: block, v: ValueRef, t: ty::t) { none); trans_free(bcx, v) } - ty::ty_uniq(content_mt) => { + ty::ty_uniq(*) => { uniq::make_free_glue(bcx, v, t) } ty::ty_evec(_, ty::vstore_uniq) | ty::ty_estr(ty::vstore_uniq) | @@ -1062,8 +1062,8 @@ fn iter_structural_ty(cx: block, av: ValueRef, t: ty::t, cx = f(cx, llfld_a, fld.mt.ty); } } - ty::ty_estr(ty::vstore_fixed(n)) | - ty::ty_evec(_, ty::vstore_fixed(n)) => { + ty::ty_estr(ty::vstore_fixed(_)) | + ty::ty_evec(_, ty::vstore_fixed(_)) => { let (base, len) = tvec::get_base_and_len(cx, av, t); cx = tvec::iter_vec_raw(cx, base, t, len, f); } @@ -2071,7 +2071,7 @@ fn trans_external_path(ccx: @crate_ctxt, did: ast::def_id, t: ty::t) fn normalize_for_monomorphization(tcx: ty::ctxt, ty: ty::t) -> option { // FIXME[mono] could do this recursively. is that worthwhile? (#2529) match ty::get(ty).struct { - ty::ty_box(mt) => { + ty::ty_box(*) => { some(ty::mk_opaque_box(tcx)) } ty::ty_fn(ref fty) => { @@ -2199,10 +2199,10 @@ fn monomorphic_fn(ccx: @crate_ctxt, fn_id: ast::def_id, ast_map::node_method(m, _, pt) => (pt, m.ident, m.span), ast_map::node_foreign_item(i, ast::foreign_abi_rust_intrinsic, pt) => (pt, i.ident, i.span), - ast_map::node_foreign_item(_, abi, _) => { + ast_map::node_foreign_item(*) => { // Foreign externs don't have to be monomorphized. return {val: get_item_val(ccx, fn_id.node), - must_cast: true}; + must_cast: true}; } ast_map::node_ctor(nm, _, ct, _, pt) => (pt, nm, ct.span), ast_map::node_dtor(_, dtor, _, pt) => @@ -2286,13 +2286,13 @@ fn monomorphic_fn(ccx: @crate_ctxt, fn_id: ast::def_id, } d } - ast_map::node_method(mth, impl_def_id, _) => { + ast_map::node_method(mth, _, _) => { let d = mk_lldecl(); set_inline_hint_if_appr(mth.attrs, d); impl::trans_method(ccx, pt, mth, psubsts, d); d } - ast_map::node_ctor(nm, tps, ctor, parent_id, _) => { + ast_map::node_ctor(_, tps, ctor, parent_id, _) => { // ctors don't have attrs, at least not right now let d = mk_lldecl(); let tp_tys = ty::ty_params_to_tys(ccx.tcx, tps); @@ -2356,7 +2356,7 @@ fn maybe_instantiate_inline(ccx: @crate_ctxt, fn_id: ast::def_id) trans_item(ccx, *item); local_def(item.id) } - csearch::found(ast::ii_ctor(ctor, nm, tps, parent_id)) => { + csearch::found(ast::ii_ctor(ctor, _, tps, _)) => { ccx.external.insert(fn_id, some(ctor.node.id)); local_def(ctor.node.id) } @@ -2398,7 +2398,7 @@ fn maybe_instantiate_inline(ccx: @crate_ctxt, fn_id: ast::def_id) } local_def(mth.id) } - csearch::found(ast::ii_dtor(dtor, nm, tps, parent_id)) => { + csearch::found(ast::ii_dtor(dtor, _, tps, _)) => { ccx.external.insert(fn_id, some(dtor.node.id)); local_def(dtor.node.id) } @@ -2500,7 +2500,8 @@ fn trans_local_var(cx: block, def: ast::def) -> local_var_result { match table.find(id) { some(local_mem(v)) => {val: v, kind: lv_owned}, some(local_imm(v)) => {val: v, kind: lv_owned_imm}, - r => fail(~"take_local: internal error") + none => fail(fmt!("take_local: internal error, \ + found no entry for %?", id)) } } match def { @@ -2516,7 +2517,7 @@ fn trans_local_var(cx: block, def: ast::def) -> local_var_result { assert (cx.fcx.lllocals.contains_key(nid)); return take_local(cx.fcx.lllocals, nid); } - ast::def_self(sid) => { + ast::def_self(_) => { let slf = match copy cx.fcx.llself { some(s) => cast_self(cx, s), none => cx.sess().bug(~"trans_local_var: reference to self \ @@ -2690,7 +2691,7 @@ fn expr_is_lval(bcx: block, e: @ast::expr) -> bool { fn trans_callee(bcx: block, e: @ast::expr) -> lval_maybe_callee { let _icx = bcx.insn_ctxt("trans_callee"); match e.node { - ast::expr_path(path) => return trans_path(bcx, e.id), + ast::expr_path(_) => return trans_path(bcx, e.id), ast::expr_field(base, _, _) => { // Lval means this is a record field, so not a method if !expr_is_lval(bcx, e) { @@ -2949,7 +2950,7 @@ fn trans_arg_expr(cx: block, arg: ty::arg, lldestty: TypeRef, e: @ast::expr, // translate the arg expr as an lvalue let lv = match ret_flag { // If there is a ret_flag, this *must* be a loop body - some(ptr) => match check e.node { + some(_) => match check e.node { ast::expr_loop_body(blk) => { let scratch = alloc_ty(cx, expr_ty(cx, blk)); let bcx = trans_loop_body(cx, e, ret_flag, save_in(scratch)); @@ -3858,7 +3859,7 @@ fn trans_expr(bcx: block, e: @ast::expr, dest: dest) -> block { } } } - ast::expr_loop_body(blk) => { + ast::expr_loop_body(_) => { return trans_loop_body(bcx, e, none, dest); } ast::expr_do_body(blk) => { @@ -5383,11 +5384,11 @@ fn get_item_val(ccx: @crate_ctxt, id: ast::node_id) -> ValueRef { vec::append(*pth, ~[path_name(ni.ident)]), ni.id) } - ast_map::node_ctor(nm, tps, ctor, _, pt) => { + ast_map::node_ctor(nm, _, ctor, _, pt) => { let my_path = vec::append(*pt, ~[path_name(nm)]); register_fn(ccx, ctor.span, my_path, ctor.node.id) } - ast_map::node_dtor(tps, dt, parent_id, pt) => { + ast_map::node_dtor(_, dt, parent_id, pt) => { /* Don't just call register_fn, since we don't want to add the implicit self argument automatically (we want to make sure diff --git a/src/rustc/middle/trans/consts.rs b/src/rustc/middle/trans/consts.rs index 4be8955541b..2e926507d82 100644 --- a/src/rustc/middle/trans/consts.rs +++ b/src/rustc/middle/trans/consts.rs @@ -242,7 +242,7 @@ fn const_expr(cx: @crate_ctxt, e: @ast::expr) -> ValueRef { } const_get_elt(arr, iv as uint) } - ast::expr_cast(base, tp) => { + ast::expr_cast(base, _) => { let ety = ty::expr_ty(cx.tcx, e), llty = type_of::type_of(cx, ety); let basety = ty::expr_ty(cx.tcx, base); let v = const_expr(cx, base); @@ -311,7 +311,7 @@ fn const_expr(cx: @crate_ctxt, e: @ast::expr) -> ValueRef { ast::expr_rec(fs, none) => { C_struct(fs.map(|f| const_expr(cx, f.node.expr))) } - ast::expr_vec(es, m_imm) => { + ast::expr_vec(es, ast::m_imm) => { let (v, _, _) = const_vec(cx, e, es); v } @@ -327,7 +327,7 @@ fn const_expr(cx: @crate_ctxt, e: @ast::expr) -> ValueRef { ~"bad const-slice lit") } } } - ast::expr_vec(es, m_imm) => { + ast::expr_vec(es, ast::m_imm) => { let (cv, sz, llunitty) = const_vec(cx, e, es); let llty = val_ty(cv); let gv = do str::as_c_str("const") |name| { @@ -342,7 +342,7 @@ fn const_expr(cx: @crate_ctxt, e: @ast::expr) -> ValueRef { ~"bad const-slice expr") } } - ast::expr_path(path) => { + ast::expr_path(_) => { match cx.tcx.def_map.find(e.id) { some(ast::def_const(def_id)) => { // Don't know how to handle external consts diff --git a/src/rustc/middle/trans/type_of.rs b/src/rustc/middle/trans/type_of.rs index 03606ede7aa..f6cd78e3015 100644 --- a/src/rustc/middle/trans/type_of.rs +++ b/src/rustc/middle/trans/type_of.rs @@ -95,7 +95,7 @@ fn type_of(cx: @crate_ctxt, t: ty::t) -> TypeRef { ty::ty_estr(ty::vstore_uniq) => { T_unique_ptr(T_unique(cx, T_vec(cx, T_i8()))) } - ty::ty_enum(did, _) => { + ty::ty_enum(*) => { // Only create the named struct, but don't fill it in. We // fill it in *after* placing it into the type cache. This // avoids creating more than one copy of the enum when one