Skip to content

Commit

Permalink
auto merge of #8441 : erickt/rust/deny-warnings, r=erickt
Browse files Browse the repository at this point in the history
This patch makes sure that code is warning-free for all of the rust libraries.
  • Loading branch information
bors committed Aug 17, 2013
2 parents 29a67d1 + cc56708 commit 7503396
Show file tree
Hide file tree
Showing 405 changed files with 709 additions and 590 deletions.
4 changes: 2 additions & 2 deletions mk/target.mk
Expand Up @@ -69,7 +69,7 @@ $$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_LIBSYNTAX_$(3)): \
| $$(TLIB$(1)_T_$(2)_H_$(3))/
@$$(call E, compile_and_link: $$@)
$$(call REMOVE_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBSYNTAX_GLOB_$(2)),$$(notdir $$@))
$$(STAGE$(1)_T_$(2)_H_$(3)) $(BORROWCK) --out-dir $$(@D) $$< && touch $$@
$$(STAGE$(1)_T_$(2)_H_$(3)) $$(WFLAGS_ST$(1)) $(BORROWCK) --out-dir $$(@D) $$< && touch $$@
$$(call LIST_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBSYNTAX_GLOB_$(2)),$$(notdir $$@))

# Only build the compiler for host triples
Expand All @@ -90,7 +90,7 @@ $$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_LIBRUSTC_$(3)): \
| $$(TLIB$(1)_T_$(2)_H_$(3))/
@$$(call E, compile_and_link: $$@)
$$(call REMOVE_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBRUSTC_GLOB_$(2)),$$(notdir $$@))
$$(STAGE$(1)_T_$(2)_H_$(3)) --out-dir $$(@D) $$< && touch $$@
$$(STAGE$(1)_T_$(2)_H_$(3)) $$(WFLAGS_ST$(1)) --out-dir $$(@D) $$< && touch $$@
$$(call LIST_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBRUSTC_GLOB_$(2)),$$(notdir $$@))

$$(TBIN$(1)_T_$(2)_H_$(3))/rustc$$(X_$(3)): \
Expand Down
6 changes: 3 additions & 3 deletions mk/tools.mk
Expand Up @@ -67,7 +67,7 @@ $$(TLIB$(1)_T_$(4)_H_$(3))/$(CFG_LIBRUSTDOC_$(4)): \
| $$(TLIB$(1)_T_$(4)_H_$(3))/
@$$(call E, compile_and_link: $$@)
$$(call REMOVE_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBRUSTDOC_GLOB_$(4)),$$(notdir $$@))
$$(STAGE$(1)_T_$(4)_H_$(3)) --out-dir $$(@D) $$< && touch $$@
$$(STAGE$(1)_T_$(4)_H_$(3)) $$(WFLAGS_ST$(1)) --out-dir $$(@D) $$< && touch $$@
$$(call LIST_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBRUSTDOC_GLOB_$(4)),$$(notdir $$@))

$$(TBIN$(1)_T_$(4)_H_$(3))/rustdoc$$(X_$(4)): \
Expand All @@ -85,7 +85,7 @@ $$(TLIB$(1)_T_$(4)_H_$(3))/$(CFG_LIBRUSTI_$(4)): \
| $$(TLIB$(1)_T_$(4)_H_$(3))/
@$$(call E, compile_and_link: $$@)
$$(call REMOVE_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBRUSTI_GLOB_$(4)),$$(notdir $$@))
$$(STAGE$(1)_T_$(4)_H_$(3)) --out-dir $$(@D) $$< && touch $$@
$$(STAGE$(1)_T_$(4)_H_$(3)) $$(WFLAGS_ST$(1)) --out-dir $$(@D) $$< && touch $$@
$$(call LIST_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBRUSTI_GLOB_$(4)),$$(notdir $$@))

$$(TBIN$(1)_T_$(4)_H_$(3))/rusti$$(X_$(4)): \
Expand All @@ -106,7 +106,7 @@ $$(TLIB$(1)_T_$(4)_H_$(3))/$(CFG_LIBRUST_$(4)): \
| $$(TLIB$(1)_T_$(4)_H_$(3))/
@$$(call E, compile_and_link: $$@)
$$(call REMOVE_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBRUST_GLOB_$(4)),$$(notdir $$@))
$$(STAGE$(1)_T_$(4)_H_$(3)) --out-dir $$(@D) $$< && touch $$@
$$(STAGE$(1)_T_$(4)_H_$(3)) $$(WFLAGS_ST$(1)) --out-dir $$(@D) $$< && touch $$@
$$(call LIST_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBRUST_GLOB_$(4)),$$(notdir $$@))

$$(TBIN$(1)_T_$(4)_H_$(3))/rust$$(X_$(4)): \
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/middle/lint.rs
Expand Up @@ -480,7 +480,7 @@ impl Context {
(orig.visit_item)(it, (self, stopping));
}
NewVisitor(new_visitor) => {
let mut new_visitor = new_visitor;
let new_visitor = new_visitor;
new_visitor.visit_item(it, ());
}
}
Expand Down Expand Up @@ -520,7 +520,7 @@ impl Context {
let fk = visit::fk_method(m.ident,
&m.generics,
m);
let mut new_visitor = new_visitor;
let new_visitor = new_visitor;
new_visitor.visit_fn(&fk,
&m.decl,
&m.body,
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/ptr.rs
Expand Up @@ -648,7 +648,7 @@ pub mod ptr_tests {
one, two, three
];

do arr.as_imm_buf |arr_ptr, arr_len| {
do arr.as_imm_buf |arr_ptr, _| {
let mut ctr = 0;
let mut iteration_count = 0;
do array_each(arr_ptr) |e| {
Expand Down
1 change: 0 additions & 1 deletion src/libsyntax/parse/attr.rs
Expand Up @@ -10,7 +10,6 @@

use ast;
use codemap::{spanned, mk_sp};
use codemap::BytePos;
use parse::common::*; //resolve bug?
use parse::token;
use parse::parser::Parser;
Expand Down
1 change: 0 additions & 1 deletion src/test/auxiliary/cci_capture_clause.rs
Expand Up @@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use std::comm::*;
use std::task;

pub fn foo<T:Send + Clone>(x: T) -> Port<T> {
Expand Down
3 changes: 0 additions & 3 deletions src/test/auxiliary/cci_class_5.rs
Expand Up @@ -9,8 +9,6 @@
// except according to those terms.

pub mod kitties {
use std::uint;

pub struct cat {
priv meows : uint,
how_hungry : int,
Expand All @@ -26,5 +24,4 @@ pub mod kitties {
how_hungry: in_y
}
}

}
2 changes: 0 additions & 2 deletions src/test/auxiliary/cci_class_cast.rs
Expand Up @@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use std::to_str::*;

pub mod kitty {
pub struct cat {
priv meows : uint,
Expand Down
2 changes: 1 addition & 1 deletion src/test/auxiliary/crate-method-reexport-grrrrrrr2.rs
Expand Up @@ -20,7 +20,7 @@ pub mod name_pool {
}

impl add for name_pool {
fn add(&self, s: ~str) {
fn add(&self, _s: ~str) {
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/auxiliary/crateresolve5-1.rs
Expand Up @@ -25,7 +25,7 @@ pub enum e {

pub fn nominal() -> e { e_val }

pub fn nominal_eq(e1: e, e2: e) -> bool { true }
pub fn nominal_eq(_e1: e, _e2: e) -> bool { true }

impl Eq for e {
fn eq(&self, other: &e) -> bool { nominal_eq(*self, *other) }
Expand Down
2 changes: 1 addition & 1 deletion src/test/auxiliary/crateresolve5-2.rs
Expand Up @@ -29,6 +29,6 @@ impl Eq for e {

pub fn nominal() -> e { e_val }

pub fn nominal_neq(e1: e, e2: e) -> bool { false }
pub fn nominal_neq(_e1: e, _e2: e) -> bool { false }

pub fn f() -> int { 20 }
4 changes: 1 addition & 3 deletions src/test/auxiliary/issue-2526.rs
Expand Up @@ -35,9 +35,7 @@ fn arc<T:Freeze>(_data: T) -> arc_destruct<T> {
}

fn init() -> arc_destruct<context_res> {
unsafe {
arc(context_res())
}
arc(context_res())
}

struct context_res {
Expand Down
2 changes: 1 addition & 1 deletion src/test/auxiliary/issue2378a.rs
Expand Up @@ -14,7 +14,7 @@
enum maybe<T> { just(T), nothing }

impl <T:Clone> Index<uint,T> for maybe<T> {
fn index(&self, idx: &uint) -> T {
fn index(&self, _idx: &uint) -> T {
match self {
&just(ref t) => (*t).clone(),
&nothing => { fail!(); }
Expand Down
2 changes: 2 additions & 0 deletions src/test/auxiliary/issue_2316_b.rs
Expand Up @@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#[allow(unused_imports)];

extern mod issue_2316_a;

pub mod cloth {
Expand Down
2 changes: 1 addition & 1 deletion src/test/auxiliary/moves_based_on_type_lib.rs
Expand Up @@ -23,5 +23,5 @@ impl Drop for S {
pub fn f() {
let x = S { x: 1 };
let y = x;
let z = y;
let _z = y;
}
2 changes: 1 addition & 1 deletion src/test/auxiliary/trait_default_method_xc_aux.rs
Expand Up @@ -19,7 +19,7 @@ impl A for Something {

trait B<T> {
fn thing<U>(&self, x: T, y: U) -> (T, U) { (x, y) }
fn staticthing<U>(z: &Self, x: T, y: U) -> (T, U) { (x, y) }
fn staticthing<U>(_z: &Self, x: T, y: U) -> (T, U) { (x, y) }
}

impl<T> B<T> for int { }
Expand Down
3 changes: 0 additions & 3 deletions src/test/bench/core-std.rs
Expand Up @@ -13,14 +13,11 @@
extern mod extra;

use extra::time::precise_time_s;
use std::int;
use std::io;
use std::os;
use std::rand::RngUtil;
use std::rand;
use std::result;
use std::str;
use std::uint;
use std::util;
use std::vec;

Expand Down
1 change: 0 additions & 1 deletion src/test/bench/msgsend-ring-mutex-arcs.rs
Expand Up @@ -21,7 +21,6 @@ use extra::arc;
use extra::future;
use extra::time;
use std::cell::Cell;
use std::io;
use std::os;
use std::uint;

Expand Down
1 change: 0 additions & 1 deletion src/test/bench/msgsend-ring-rw-arcs.rs
Expand Up @@ -21,7 +21,6 @@ use extra::arc;
use extra::future;
use extra::time;
use std::cell::Cell;
use std::io;
use std::os;
use std::uint;

Expand Down
1 change: 0 additions & 1 deletion src/test/bench/noise.rs
@@ -1,7 +1,6 @@
// Perlin noise benchmark from https://gist.github.com/1170424

use std::float;
use std::int;
use std::rand::{Rng, RngUtil};
use std::rand;

Expand Down
1 change: 0 additions & 1 deletion src/test/bench/rt-messaging-ping-pong.rs
Expand Up @@ -10,7 +10,6 @@

extern mod extra;

use std::task::spawn;
use std::os;
use std::uint;
use std::rt::test::spawntask_later;
Expand Down
1 change: 0 additions & 1 deletion src/test/bench/rt-parfib.rs
Expand Up @@ -10,7 +10,6 @@

extern mod extra;

use std::task::spawn;
use std::os;
use std::uint;
use std::rt::test::spawntask_later;
Expand Down
1 change: 0 additions & 1 deletion src/test/bench/shootout-ackermann.rs
Expand Up @@ -11,7 +11,6 @@
extern mod extra;

use std::int;
use std::io;
use std::os;

fn ack(m: int, n: int) -> int {
Expand Down
2 changes: 0 additions & 2 deletions src/test/bench/shootout-fasta.rs
Expand Up @@ -22,9 +22,7 @@ use std::io;
use std::os;
use std::rand::Rng;
use std::rand;
use std::result;
use std::str;
use std::uint;

static LINE_LENGTH: uint = 60u;

Expand Down
1 change: 0 additions & 1 deletion src/test/bench/shootout-fibo.rs
Expand Up @@ -11,7 +11,6 @@
extern mod extra;

use std::int;
use std::io;
use std::os;

fn fib(n: int) -> int {
Expand Down
1 change: 0 additions & 1 deletion src/test/bench/shootout-k-nucleotide-pipes.rs
Expand Up @@ -22,7 +22,6 @@ use std::io::ReaderUtil;
use std::io;
use std::option;
use std::os;
use std::result;
use std::str;
use std::task;
use std::util;
Expand Down
1 change: 0 additions & 1 deletion src/test/bench/sudoku.rs
Expand Up @@ -15,7 +15,6 @@ extern mod extra;
use std::io::{ReaderUtil, WriterUtil};
use std::io;
use std::os;
use std::u8;
use std::uint;
use std::unstable::intrinsics::cttz16;
use std::vec;
Expand Down
2 changes: 1 addition & 1 deletion src/test/codegen/scalar-function-call.rs
Expand Up @@ -14,5 +14,5 @@ fn foo(x: int) -> int {

#[no_mangle]
fn test() {
let x = foo(10);
let _x = foo(10);
}
2 changes: 2 additions & 0 deletions src/test/debug-info/basic-types.rs
Expand Up @@ -51,6 +51,8 @@
// debugger:print f64
// check:$15 = 3.5

#[allow(unused_variable)];

fn main() {
let b: bool = false;
let i: int = -1;
Expand Down
4 changes: 3 additions & 1 deletion src/test/debug-info/borrowed-basic.rs
Expand Up @@ -62,6 +62,8 @@
// debugger:print *f64_ref
// check:$15 = 3.5

#[allow(unused_variable)];

fn main() {
let bool_val: bool = true;
let bool_ref: &bool = &bool_val;
Expand Down Expand Up @@ -110,4 +112,4 @@ fn main() {
zzz();
}

fn zzz() {()}
fn zzz() {()}
4 changes: 3 additions & 1 deletion src/test/debug-info/borrowed-c-style-enum.rs
Expand Up @@ -24,6 +24,8 @@
// debugger:print *the_c_ref
// check:$3 = TheC

#[allow(unused_variable)];

enum ABC { TheA, TheB, TheC }

fn main() {
Expand All @@ -39,4 +41,4 @@ fn main() {
zzz();
}

fn zzz() {()}
fn zzz() {()}
4 changes: 3 additions & 1 deletion src/test/debug-info/borrowed-enum.rs
Expand Up @@ -24,6 +24,8 @@
// debugger:print *univariant_ref
// check:$3 = {4820353753753434}

#[allow(unused_variable)];

// The first element is to ensure proper alignment, irrespective of the machines word size. Since
// the size of the discriminant value is machine dependent, this has be taken into account when
// datatype layout should be predictable as in this case.
Expand Down Expand Up @@ -59,4 +61,4 @@ fn main() {
zzz();
}

fn zzz() {()}
fn zzz() {()}
3 changes: 2 additions & 1 deletion src/test/debug-info/borrowed-managed-basic.rs
Expand Up @@ -62,6 +62,7 @@
// debugger:print *f64_ref
// check:$15 = 3.5

#[allow(unused_variable)];

fn main() {
let bool_box: @bool = @true;
Expand Down Expand Up @@ -111,4 +112,4 @@ fn main() {
zzz();
}

fn zzz() {()}
fn zzz() {()}
4 changes: 2 additions & 2 deletions src/test/debug-info/borrowed-struct.rs
Expand Up @@ -45,7 +45,7 @@
// debugger:print *unique_val_interior_ref_2
// check:$10 = 26.5


#[allow(unused_variable)];

struct SomeStruct {
x: int,
Expand All @@ -72,4 +72,4 @@ fn main() {
zzz();
}

fn zzz() {()}
fn zzz() {()}
4 changes: 3 additions & 1 deletion src/test/debug-info/borrowed-tuple.rs
Expand Up @@ -27,6 +27,8 @@
// debugger:print *unique_val_ref
// check:$4 = {-17, -22}

#[allow(unused_variable)];

fn main() {
let stack_val: (i16, f32) = (-14, -19f32);
let stack_val_ref: &(i16, f32) = &stack_val;
Expand All @@ -41,4 +43,4 @@ fn main() {
zzz();
}

fn zzz() {()}
fn zzz() {()}

0 comments on commit 7503396

Please sign in to comment.