Skip to content

Warning police #6022

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/libcore/rt/io/stdio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ pub fn stdout() -> StdWriter { fail!() }

pub fn stderr() -> StdReader { fail!() }

pub fn print(s: &str) { fail!() }
pub fn print(_s: &str) { fail!() }

pub fn println(s: &str) { fail!() }
pub fn println(_s: &str) { fail!() }

pub enum StdStream {
StdIn,
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/rt/uvio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use option::*;
use result::*;

use super::io::net::ip::{IpAddr, Ipv4};
use super::io::net::ip::{IpAddr, Ipv4}; // n.b. Ipv4 is used only in tests
use super::uv::*;
use super::rtio::*;
use ops::Drop;
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/task/spawn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ pub fn spawn_raw(opts: TaskOpts, f: ~fn()) {
}
}

fn spawn_raw_newsched(opts: TaskOpts, f: ~fn()) {
fn spawn_raw_newsched(_opts: TaskOpts, f: ~fn()) {
use rt::sched::*;

let mut sched = local_sched::take();
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/metadata/decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ fn doc_transformed_self_ty(doc: ebml::Doc,
}
}

pub fn item_type(item_id: ast::def_id, item: ebml::Doc,
pub fn item_type(_item_id: ast::def_id, item: ebml::Doc,
tcx: ty::ctxt, cdata: cmd) -> ty::t {
doc_type(item, tcx, cdata)
}
Expand Down
34 changes: 17 additions & 17 deletions src/librustc/metadata/tydecode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -279,28 +279,28 @@ fn parse_trait_ref(st: @mut PState, conv: conv_did) -> ty::TraitRef {

fn parse_ty(st: @mut PState, conv: conv_did) -> ty::t {
match next(st) {
'n' => return ty::mk_nil(st.tcx),
'z' => return ty::mk_bot(st.tcx),
'b' => return ty::mk_bool(st.tcx),
'i' => return ty::mk_int(st.tcx),
'u' => return ty::mk_uint(st.tcx),
'l' => return ty::mk_float(st.tcx),
'n' => return ty::mk_nil(),
'z' => return ty::mk_bot(),
'b' => return ty::mk_bool(),
'i' => return ty::mk_int(),
'u' => return ty::mk_uint(),
'l' => return ty::mk_float(),
'M' => {
match next(st) {
'b' => return ty::mk_mach_uint(st.tcx, ast::ty_u8),
'w' => return ty::mk_mach_uint(st.tcx, ast::ty_u16),
'l' => return ty::mk_mach_uint(st.tcx, ast::ty_u32),
'd' => return ty::mk_mach_uint(st.tcx, ast::ty_u64),
'B' => return ty::mk_mach_int(st.tcx, ast::ty_i8),
'W' => return ty::mk_mach_int(st.tcx, ast::ty_i16),
'L' => return ty::mk_mach_int(st.tcx, ast::ty_i32),
'D' => return ty::mk_mach_int(st.tcx, ast::ty_i64),
'f' => return ty::mk_mach_float(st.tcx, ast::ty_f32),
'F' => return ty::mk_mach_float(st.tcx, ast::ty_f64),
'b' => return ty::mk_mach_uint(ast::ty_u8),
'w' => return ty::mk_mach_uint(ast::ty_u16),
'l' => return ty::mk_mach_uint(ast::ty_u32),
'd' => return ty::mk_mach_uint(ast::ty_u64),
'B' => return ty::mk_mach_int(ast::ty_i8),
'W' => return ty::mk_mach_int(ast::ty_i16),
'L' => return ty::mk_mach_int(ast::ty_i32),
'D' => return ty::mk_mach_int(ast::ty_i64),
'f' => return ty::mk_mach_float(ast::ty_f32),
'F' => return ty::mk_mach_float(ast::ty_f64),
_ => fail!(~"parse_ty: bad numeric type")
}
}
'c' => return ty::mk_char(st.tcx),
'c' => return ty::mk_char(),
't' => {
assert!((next(st) == '['));
let def = parse_def(st, NominalType, conv);
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/check_match.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ pub fn is_useful(cx: @MatchCheckCtxt, m: &matrix, v: &[@pat]) -> useful {
let real_pat = match m.find(|r| r[0].id != 0) {
Some(r) => r[0], None => v[0]
};
let left_ty = if real_pat.id == 0 { ty::mk_nil(cx.tcx) }
let left_ty = if real_pat.id == 0 { ty::mk_nil() }
else { ty::node_id_to_type(cx.tcx, real_pat.id) };

match pat_ctor_id(cx, v[0]) {
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/mem_categorization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,7 @@ pub impl mem_categorization_ctxt {
fn cat_index<N:ast_node>(&self,
elt: N,
base_cmt: cmt) -> cmt {
let mt = match ty::index(self.tcx, base_cmt.ty) {
let mt = match ty::index(base_cmt.ty) {
Some(mt) => mt,
None => {
self.tcx.sess.span_bug(
Expand Down
6 changes: 2 additions & 4 deletions src/librustc/middle/trans/_match.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1073,8 +1073,7 @@ pub fn compare_values(cx: block,

match ty::get(rhs_t).sty {
ty::ty_estr(ty::vstore_uniq) => {
let scratch_result = scratch_datum(cx, ty::mk_bool(cx.tcx()),
false);
let scratch_result = scratch_datum(cx, ty::mk_bool(), false);
let scratch_lhs = alloca(cx, val_ty(lhs));
Store(cx, lhs, scratch_lhs);
let scratch_rhs = alloca(cx, val_ty(rhs));
Expand All @@ -1092,8 +1091,7 @@ pub fn compare_values(cx: block,
}
}
ty::ty_estr(_) => {
let scratch_result = scratch_datum(cx, ty::mk_bool(cx.tcx()),
false);
let scratch_result = scratch_datum(cx, ty::mk_bool(), false);
let did = cx.tcx().lang_items.str_eq_fn();
let bcx = callee::trans_lang_call(cx, did,
~[lhs, rhs],
Expand Down
5 changes: 2 additions & 3 deletions src/librustc/middle/trans/adt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ use core::option::{Option, Some, None};
use core::vec;

use lib::llvm::{ValueRef, TypeRef, True, IntEQ, IntNE};
use lib::llvm::llvm::LLVMDumpValue;
use middle::trans::_match;
use middle::trans::build::*;
use middle::trans::common::*;
Expand Down Expand Up @@ -136,7 +135,7 @@ fn represent_type_uncached(cx: @CrateContext, t: ty::t) -> Repr {
let packed = ty::lookup_packed(cx.tcx, def_id);
let dtor = ty::ty_dtor(cx.tcx, def_id).is_present();
let ftys =
if dtor { ftys + [ty::mk_bool(cx.tcx)] } else { ftys };
if dtor { ftys + [ty::mk_bool()] } else { ftys };
return Univariant(mk_struct(cx, ftys, packed), dtor)
}
ty::ty_enum(def_id, ref substs) => {
Expand Down Expand Up @@ -204,7 +203,7 @@ fn represent_type_uncached(cx: @CrateContext, t: ty::t) -> Repr {
}

// The general case.
let discr = ~[ty::mk_int(cx.tcx)];
let discr = ~[ty::mk_int()];
return General(cases.map(|c| mk_struct(cx, discr + c.tys, false)))
}
_ => cx.sess.bug(~"adt::represent_type called on non-ADT type")
Expand Down
9 changes: 4 additions & 5 deletions src/librustc/middle/trans/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ pub fn iter_structural_ty(cx: block, av: ValueRef, t: ty::t,
substs.tps, f);
}
(_match::switch, Some(lldiscrim_a)) => {
cx = f(cx, lldiscrim_a, ty::mk_int(cx.tcx()));
cx = f(cx, lldiscrim_a, ty::mk_int());
let unr_cx = sub_block(cx, ~"enum-iter-unr");
Unreachable(unr_cx);
let llswitch = Switch(cx, lldiscrim_a, unr_cx.llbb,
Expand Down Expand Up @@ -2361,7 +2361,7 @@ pub fn create_entry_wrapper(ccx: @CrateContext,
}

fn create_main(ccx: @CrateContext, main_llfn: ValueRef) -> ValueRef {
let nt = ty::mk_nil(ccx.tcx);
let nt = ty::mk_nil();
let llfty = type_of_fn(ccx, ~[], nt);
let llfdecl = decl_fn(ccx.llmod, ~"_rust_main",
lib::llvm::CCallConv, llfty);
Expand Down Expand Up @@ -2407,9 +2407,8 @@ pub fn create_entry_wrapper(ccx: @CrateContext,
unsafe {
llvm::LLVMPositionBuilderAtEnd(bld, llbb);

let crate_map = ccx.crate_map;
let start_def_id = ccx.tcx.lang_items.start_fn();
let start_fn = if start_def_id.crate == ast::local_crate {
if start_def_id.crate == ast::local_crate {
ccx.sess.bug(~"start lang item is never in the local crate")
} else {
let start_fn_type = csearch::get_type(ccx.tcx,
Expand Down Expand Up @@ -2727,7 +2726,7 @@ pub fn trans_constant(ccx: @CrateContext, it: @ast::item) {
path_name(variant.node.name),
path_name(special_idents::descrim)
]);
let s = @mangle_exported_name(ccx, p, ty::mk_int(ccx.tcx));
let s = @mangle_exported_name(ccx, p, ty::mk_int());
let disr_val = vi[i].disr_val;
note_unique_llvm_symbol(ccx, s);
let discrim_gvar = str::as_c_str(*s, |buf| {
Expand Down
9 changes: 4 additions & 5 deletions src/librustc/middle/trans/closure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,7 @@ pub fn build_closure(bcx0: block,
include_ret_handle: Option<ValueRef>) -> ClosureResult {
let _icx = bcx0.insn_ctxt("closure::build_closure");
// If we need to, package up the iterator body to call
let bcx = bcx0;;
let ccx = bcx.ccx(), tcx = ccx.tcx;
let bcx = bcx0;

// Package up the captured upvars
let mut env_vals = ~[];
Expand Down Expand Up @@ -290,7 +289,7 @@ pub fn build_closure(bcx0: block,
// variables:
for include_ret_handle.each |flagptr| {
// Flag indicating we have returned (a by-ref bool):
let flag_datum = Datum {val: *flagptr, ty: ty::mk_bool(tcx),
let flag_datum = Datum {val: *flagptr, ty: ty::mk_bool(),
mode: ByRef, source: ZeroMem};
env_vals.push(EnvValue {action: EnvRef,
datum: flag_datum});
Expand All @@ -302,7 +301,7 @@ pub fn build_closure(bcx0: block,
None => bcx.fcx.llretptr.get()
};
let ret_casted = PointerCast(bcx, ret_true, T_ptr(T_nil()));
let ret_datum = Datum {val: ret_casted, ty: ty::mk_nil(tcx),
let ret_datum = Datum {val: ret_casted, ty: ty::mk_nil(),
mode: ByRef, source: ZeroMem};
env_vals.push(EnvValue {action: EnvRef,
datum: ret_datum});
Expand Down Expand Up @@ -420,7 +419,7 @@ pub fn trans_expr_fn(bcx: block,
}

let real_return_type = if is_loop_body.is_some() {
ty::mk_bool(bcx.tcx())
ty::mk_bool()
} else {
ty::ty_fn_ret(fty)
};
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/middle/trans/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -999,9 +999,9 @@ pub fn T_opaque_vec(targ_cfg: @session::config) -> TypeRef {
pub fn tuplify_box_ty(tcx: ty::ctxt, t: ty::t) -> ty::t {
let ptr = ty::mk_ptr(
tcx,
ty::mt {ty: ty::mk_nil(tcx), mutbl: ast::m_imm}
ty::mt {ty: ty::mk_nil(), mutbl: ast::m_imm}
);
return ty::mk_tup(tcx, ~[ty::mk_uint(tcx), ty::mk_type(tcx),
return ty::mk_tup(tcx, ~[ty::mk_uint(), ty::mk_type(tcx),
ptr, ptr,
t]);
}
Expand Down
10 changes: 5 additions & 5 deletions src/librustc/middle/trans/debuginfo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ fn create_boxed_type(cx: @CrateContext, contents: ty::t,
let fname = filename_from_span(cx, span);
let file_node = create_file(cx, fname);
//let cu_node = create_compile_unit_metadata(cx, fname);
let int_t = ty::mk_int(cx.tcx);
let int_t = ty::mk_int();
let refcount_type = create_basic_type(cx, int_t, span);
let name = ty_to_str(cx.tcx, contents);
let scx = create_structure(file_node, @fmt!("box<%s>", name), 0);
Expand Down Expand Up @@ -643,7 +643,7 @@ fn create_boxed_vec(cx: @CrateContext, vec_t: ty::t, elem_t: ty::t,
let elem_ty_md = create_ty(cx, elem_t, vec_ty_span);
let vec_scx = create_structure(file_node,
@/*bad*/ copy ty_to_str(cx.tcx, vec_t), 0);
let size_t_type = create_basic_type(cx, ty::mk_uint(cx.tcx), vec_ty_span);
let size_t_type = create_basic_type(cx, ty::mk_uint(), vec_ty_span);
add_member(vec_scx, ~"fill", 0, sys::size_of::<libc::size_t>() as int,
sys::min_align_of::<libc::size_t>() as int, size_t_type.node);
add_member(vec_scx, ~"alloc", 0, sys::size_of::<libc::size_t>() as int,
Expand All @@ -666,7 +666,7 @@ fn create_boxed_vec(cx: @CrateContext, vec_t: ty::t, elem_t: ty::t,
};

let box_scx = create_structure(file_node, @fmt!("box<%s>", name), 0);
let int_t = ty::mk_int(cx.tcx);
let int_t = ty::mk_int();
let refcount_type = create_basic_type(cx, int_t, vec_ty_span);
add_member(box_scx, ~"refcnt", 0, sys::size_of::<uint>() as int,
sys::min_align_of::<uint>() as int, refcount_type.node);
Expand All @@ -692,7 +692,7 @@ fn create_vec_slice(cx: @CrateContext, vec_t: ty::t, elem_t: ty::t, span: span)
let fname = filename_from_span(cx, span);
let file_node = create_file(cx, fname);
let elem_ty_md = create_ty(cx, elem_t, span);
let uint_type = create_basic_type(cx, ty::mk_uint(cx.tcx), span);
let uint_type = create_basic_type(cx, ty::mk_uint(), span);
let elem_ptr = create_pointer_type(cx, elem_t, span, elem_ty_md);
let scx = create_structure(file_node, @ty_to_str(cx.tcx, vec_t), 0);
let (_, ptr_size, ptr_align) = voidptr();
Expand Down Expand Up @@ -744,7 +744,7 @@ fn create_ty(cx: @CrateContext, t: ty::t, span: span)
ty::ty_nil | ty::ty_bot | ty::ty_bool | ty::ty_int(_) | ty::ty_uint(_)
| ty::ty_float(_) => create_basic_type(cx, t, span),
ty::ty_estr(ref vstore) => {
let i8_t = ty::mk_i8(cx.tcx);
let i8_t = ty::mk_i8();
match *vstore {
ty::vstore_fixed(len) => {
create_fixed_vec(cx, t, i8_t, len as int + 1, span)
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/trans/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,7 @@ fn trans_def_datum_unadjusted(bcx: block,
let rust_ty = ty::mk_ptr(
bcx.tcx(),
ty::mt {
ty: ty::mk_mach_uint(bcx.tcx(), ast::ty_u8),
ty: ty::mk_mach_uint(ast::ty_u8),
mutbl: ast::m_imm
}); // *u8
(rust_ty, PointerCast(bcx, fn_data.llfn, T_ptr(T_i8())))
Expand Down
8 changes: 4 additions & 4 deletions src/librustc/middle/trans/foreign.rs
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@ pub fn trans_intrinsic(ccx: @CrateContext,
let frameaddress_val = Call(bcx, frameaddress, ~[C_i32(0i32)]);
let star_u8 = ty::mk_imm_ptr(
bcx.tcx(),
ty::mk_mach_uint(bcx.tcx(), ast::ty_u8));
ty::mk_mach_uint(ast::ty_u8));
let fty = ty::mk_closure(bcx.tcx(), ty::ClosureTy {
purity: ast::impure_fn,
sigil: ast::BorrowedSigil,
Expand All @@ -777,21 +777,21 @@ pub fn trans_intrinsic(ccx: @CrateContext,
sig: FnSig {bound_lifetime_names: opt_vec::Empty,
inputs: ~[arg {mode: ast::expl(ast::by_copy),
ty: star_u8}],
output: ty::mk_nil(bcx.tcx())}
output: ty::mk_nil()}
});
let datum = Datum {val: get_param(decl, first_real_arg),
mode: ByRef, ty: fty, source: ZeroMem};
let arg_vals = ~[frameaddress_val];
bcx = trans_call_inner(
bcx, None, fty, ty::mk_nil(bcx.tcx()),
bcx, None, fty, ty::mk_nil(),
|bcx| Callee {bcx: bcx, data: Closure(datum)},
ArgVals(arg_vals), Ignore, DontAutorefArg);
}
~"morestack_addr" => {
// XXX This is a hack to grab the address of this particular
// native function. There should be a general in-language
// way to do this
let llfty = type_of_fn(bcx.ccx(), ~[], ty::mk_nil(bcx.tcx()));
let llfty = type_of_fn(bcx.ccx(), ~[], ty::mk_nil());
let morestack_addr = decl_cdecl_fn(
bcx.ccx().llmod, ~"__morestack", llfty);
let morestack_addr = PointerCast(bcx, morestack_addr,
Expand Down
14 changes: 7 additions & 7 deletions src/librustc/middle/trans/glue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,19 +168,19 @@ pub fn simplified_glue_type(tcx: ty::ctxt, field: uint, t: ty::t) -> ty::t {
field == abi::tydesc_field_drop_glue ||
field == abi::tydesc_field_free_glue) &&
! ty::type_needs_drop(tcx, t) {
return ty::mk_u32(tcx);
return ty::mk_u32();
}

if field == abi::tydesc_field_take_glue {
match ty::get(t).sty {
ty::ty_unboxed_vec(*) => { return ty::mk_u32(tcx); }
ty::ty_unboxed_vec(*) => { return ty::mk_u32(); }
_ => ()
}
}

if field == abi::tydesc_field_take_glue &&
ty::type_is_boxed(t) {
return ty::mk_imm_box(tcx, ty::mk_u32(tcx));
return ty::mk_imm_box(tcx, ty::mk_u32());
}

if field == abi::tydesc_field_free_glue {
Expand All @@ -193,7 +193,7 @@ pub fn simplified_glue_type(tcx: ty::ctxt, field: uint, t: ty::t) -> ty::t {
ty::ty_evec(_, ty::vstore_uniq) | ty::ty_estr(ty::vstore_uniq) |
ty::ty_evec(_, ty::vstore_box) | ty::ty_estr(ty::vstore_box) |
ty::ty_opaque_closure_ptr(*) => (),
_ => { return ty::mk_u32(tcx); }
_ => { return ty::mk_u32(); }
}
}

Expand All @@ -203,12 +203,12 @@ pub fn simplified_glue_type(tcx: ty::ctxt, field: uint, t: ty::t) -> ty::t {
ty::ty_box(mt) |
ty::ty_evec(mt, ty::vstore_box)
if ! ty::type_needs_drop(tcx, mt.ty) =>
return ty::mk_imm_box(tcx, ty::mk_u32(tcx)),
return ty::mk_imm_box(tcx, ty::mk_u32()),

ty::ty_uniq(mt) |
ty::ty_evec(mt, ty::vstore_uniq)
if ! ty::type_needs_drop(tcx, mt.ty) =>
return ty::mk_imm_uniq(tcx, ty::mk_u32(tcx)),
return ty::mk_imm_uniq(tcx, ty::mk_u32()),

_ => ()
}
Expand Down Expand Up @@ -736,7 +736,7 @@ pub fn make_generic_glue_inner(ccx: @CrateContext,
helper: glue_helper)
-> ValueRef {
let _icx = ccx.insn_ctxt("make_generic_glue_inner");
let fcx = new_fn_ctxt(ccx, ~[], llfn, ty::mk_nil(ccx.tcx), None);
let fcx = new_fn_ctxt(ccx, ~[], llfn, ty::mk_nil(), None);
lib::llvm::SetLinkage(llfn, lib::llvm::InternalLinkage);
ccx.stats.n_glues_created += 1u;
// All glue functions take values passed *by alias*; this is a
Expand Down
Loading