From be86bc81a754089e1e6ded8e118968f579a2eaca Mon Sep 17 00:00:00 2001 From: Erick Tryzelaar Date: Sat, 17 Aug 2013 08:40:53 -0700 Subject: [PATCH 1/4] Fix warnings in tests --- src/libstd/ptr.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libstd/ptr.rs b/src/libstd/ptr.rs index de8f8c69e8432..247447010bca8 100644 --- a/src/libstd/ptr.rs +++ b/src/libstd/ptr.rs @@ -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| { From e20d46056dc5891696faa8ebcccd2279b6c445d9 Mon Sep 17 00:00:00 2001 From: Erick Tryzelaar Date: Sat, 17 Aug 2013 08:37:07 -0700 Subject: [PATCH 2/4] Fix warnings in librustc and libsyntax --- src/librustc/middle/lint.rs | 4 ++-- src/libsyntax/parse/attr.rs | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/librustc/middle/lint.rs b/src/librustc/middle/lint.rs index 55425b6479530..435e7943d662f 100644 --- a/src/librustc/middle/lint.rs +++ b/src/librustc/middle/lint.rs @@ -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, ()); } } @@ -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, diff --git a/src/libsyntax/parse/attr.rs b/src/libsyntax/parse/attr.rs index f2489d80e1e69..78fc1f0babc41 100644 --- a/src/libsyntax/parse/attr.rs +++ b/src/libsyntax/parse/attr.rs @@ -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; From ad5c67685332dc0e45d459b45749e76c93270988 Mon Sep 17 00:00:00 2001 From: Erick Tryzelaar Date: Sat, 17 Aug 2013 08:37:42 -0700 Subject: [PATCH 3/4] Fix warnings it tests --- src/test/auxiliary/cci_capture_clause.rs | 1 - src/test/auxiliary/cci_class_5.rs | 3 --- src/test/auxiliary/cci_class_cast.rs | 2 -- .../crate-method-reexport-grrrrrrr2.rs | 2 +- src/test/auxiliary/crateresolve5-1.rs | 2 +- src/test/auxiliary/crateresolve5-2.rs | 2 +- src/test/auxiliary/issue-2526.rs | 4 +--- src/test/auxiliary/issue2378a.rs | 2 +- src/test/auxiliary/issue_2316_b.rs | 2 ++ src/test/auxiliary/moves_based_on_type_lib.rs | 2 +- .../auxiliary/trait_default_method_xc_aux.rs | 2 +- src/test/bench/core-std.rs | 3 --- src/test/bench/msgsend-ring-mutex-arcs.rs | 1 - src/test/bench/msgsend-ring-rw-arcs.rs | 1 - src/test/bench/noise.rs | 1 - src/test/bench/rt-messaging-ping-pong.rs | 1 - src/test/bench/rt-parfib.rs | 1 - src/test/bench/shootout-ackermann.rs | 1 - src/test/bench/shootout-fasta.rs | 2 -- src/test/bench/shootout-fibo.rs | 1 - src/test/bench/shootout-k-nucleotide-pipes.rs | 1 - src/test/bench/sudoku.rs | 1 - src/test/codegen/scalar-function-call.rs | 2 +- src/test/debug-info/basic-types.rs | 2 ++ src/test/debug-info/borrowed-basic.rs | 4 +++- src/test/debug-info/borrowed-c-style-enum.rs | 4 +++- src/test/debug-info/borrowed-enum.rs | 4 +++- src/test/debug-info/borrowed-managed-basic.rs | 3 ++- src/test/debug-info/borrowed-struct.rs | 4 ++-- src/test/debug-info/borrowed-tuple.rs | 4 +++- src/test/debug-info/borrowed-unique-basic.rs | 4 +++- src/test/debug-info/box.rs | 2 ++ src/test/debug-info/boxed-struct.rs | 4 +++- src/test/debug-info/boxed-vec.rs | 4 +++- .../debug-info/c-style-enum-in-composite.rs | 4 +++- src/test/debug-info/c-style-enum.rs | 4 +++- .../debug-info/destructured-fn-argument.rs | 3 ++- src/test/debug-info/destructured-local.rs | 3 ++- src/test/debug-info/evec-in-struct.rs | 4 +++- src/test/debug-info/managed-enum.rs | 4 +++- .../managed-pointer-within-unique-vec.rs | 4 +++- .../managed-pointer-within-unique.rs | 4 +++- .../multiple-functions-equal-var-names.rs | 2 ++ src/test/debug-info/multiple-functions.rs | 2 ++ src/test/debug-info/nil-enum.rs | 4 +++- .../packed-struct-with-destructor.rs | 4 +++- src/test/debug-info/packed-struct.rs | 4 +++- src/test/debug-info/simple-struct.rs | 3 ++- src/test/debug-info/simple-tuple.rs | 3 ++- src/test/debug-info/struct-in-enum.rs | 2 ++ src/test/debug-info/struct-in-struct.rs | 3 ++- src/test/debug-info/struct-style-enum.rs | 4 +++- src/test/debug-info/struct-with-destructor.rs | 2 ++ src/test/debug-info/tuple-in-struct.rs | 4 +++- src/test/debug-info/tuple-in-tuple.rs | 4 +++- src/test/debug-info/tuple-style-enum.rs | 4 +++- src/test/debug-info/unique-enum.rs | 4 +++- src/test/debug-info/vec-slices.rs | 2 ++ src/test/debug-info/vec.rs | 2 ++ src/test/pretty/block-arg-disambig.rs | 2 +- src/test/pretty/disamb-stmt-expr.rs | 2 +- src/test/pretty/fn-types.rs | 8 +++---- src/test/pretty/for-comment.rs | 4 +++- src/test/pretty/match-naked-expr-long.rs | 6 ++--- src/test/pretty/match-naked-expr.rs | 2 +- src/test/pretty/struct-tuple.rs | 4 ++-- src/test/pretty/vec-comments.pp | 8 +++---- src/test/pretty/vec-comments.rs | 8 +++---- src/test/pretty/vec-type.pp | 2 +- src/test/pretty/vec-type.rs | 2 +- src/test/run-fail/args-fail.rs | 2 +- ...-autoborrowvec-combined-fail-issue-6272.rs | 2 +- src/test/run-fail/borrowck-wg-fail-2.rs | 2 +- src/test/run-fail/borrowck-wg-fail-3.rs | 2 +- .../run-fail/borrowck-wg-fail-object-arg.rs | 2 +- src/test/run-fail/borrowck-wg-imm-then-mut.rs | 2 +- src/test/run-fail/borrowck-wg-mut-then-imm.rs | 2 +- src/test/run-fail/bug-811.rs | 2 +- src/test/run-fail/die-macro-expr.rs | 2 +- src/test/run-fail/divide-by-zero.rs | 2 +- src/test/run-fail/doublefail.rs | 2 ++ src/test/run-fail/explicit-fail-msg.rs | 7 +++++- src/test/run-fail/expr-if-fail.rs | 2 +- src/test/run-fail/expr-match-fail.rs | 2 +- src/test/run-fail/issue-2156.rs | 2 ++ src/test/run-fail/issue-2444.rs | 2 +- src/test/run-fail/issue-3029.rs | 4 ++++ src/test/run-fail/issue-948.rs | 2 ++ src/test/run-fail/match-bot-fail.rs | 3 +++ src/test/run-fail/mod-zero.rs | 2 +- src/test/run-fail/rhs-type.rs | 8 ++++++- src/test/run-fail/rt-set-exit-status-fail2.rs | 2 +- src/test/run-fail/task-spawn-barefn.rs | 1 - src/test/run-fail/unwind-assert.rs | 2 +- src/test/run-fail/unwind-closure.rs | 2 +- .../run-fail/unwind-initializer-indirect.rs | 2 +- src/test/run-fail/unwind-initializer.rs | 2 +- src/test/run-fail/unwind-interleaved.rs | 4 ++-- src/test/run-fail/unwind-iter.rs | 3 +++ src/test/run-fail/unwind-iter2.rs | 2 +- src/test/run-fail/unwind-lambda.rs | 2 +- src/test/run-fail/unwind-misc-1.rs | 4 ++-- src/test/run-fail/unwind-nested.rs | 4 ++-- src/test/run-fail/unwind-partial-box.rs | 2 +- src/test/run-fail/unwind-partial-unique.rs | 2 +- src/test/run-fail/unwind-partial-vec.rs | 2 +- src/test/run-fail/unwind-rec.rs | 2 +- src/test/run-fail/unwind-rec2.rs | 2 +- src/test/run-fail/unwind-resource-fail.rs | 2 +- src/test/run-fail/unwind-stacked.rs | 6 ++--- src/test/run-fail/unwind-tup.rs | 2 +- src/test/run-fail/unwind-tup2.rs | 2 +- src/test/run-fail/unwind-uninitialized.rs | 2 +- src/test/run-fail/while-body-fails.rs | 4 +++- src/test/run-fail/while-fail.rs | 2 ++ src/test/run-pass/argument-passing.rs | 4 ++-- src/test/run-pass/arith-unsigned.rs | 3 +-- src/test/run-pass/assign-assign.rs | 10 +++++++-- src/test/run-pass/attr-start.rs | 2 +- src/test/run-pass/bind-by-move.rs | 2 +- src/test/run-pass/binops.rs | 4 +--- src/test/run-pass/block-arg-in-parentheses.rs | 2 -- src/test/run-pass/block-arg.rs | 2 -- src/test/run-pass/borrowck-mut-uniq.rs | 1 - .../borrowck-pat-reassign-no-binding.rs | 1 + .../borrowck-preserve-box-in-arm-not-taken.rs | 4 ++-- .../run-pass/borrowck-preserve-box-in-pat.rs | 2 +- .../borrowck-preserve-box-sometimes-needed.rs | 5 +++-- .../run-pass/borrowck-preserve-cond-box.rs | 6 +++-- src/test/run-pass/box-in-tup.rs | 5 ++++- src/test/run-pass/box-inside-if.rs | 6 ++--- src/test/run-pass/box-inside-if2.rs | 6 ++--- src/test/run-pass/break.rs | 2 -- src/test/run-pass/c-stack-as-value.rs | 6 +---- src/test/run-pass/c-stack-returning-int64.rs | 19 +++++++--------- src/test/run-pass/capture_nil.rs | 1 - src/test/run-pass/cci_iter_exe.rs | 2 +- src/test/run-pass/child-outlives-parent.rs | 4 ++-- .../class-cast-to-trait-multiple-types.rs | 4 +--- .../class-impl-very-parameterized-trait.rs | 2 -- .../class-implement-trait-cross-crate.rs | 2 -- src/test/run-pass/class-implement-traits.rs | 2 -- .../run-pass/class-methods-cross-crate.rs | 2 +- src/test/run-pass/class-methods.rs | 2 +- src/test/run-pass/class-separate-impl.rs | 7 ++---- src/test/run-pass/class-str-field.rs | 2 +- src/test/run-pass/class-typarams.rs | 2 +- src/test/run-pass/classes-cross-crate.rs | 2 -- src/test/run-pass/classes-simple-method.rs | 2 +- src/test/run-pass/classes-simple.rs | 4 ++-- src/test/run-pass/cleanup-copy-mode.rs | 1 - .../run-pass/coerce-reborrow-imm-ptr-rcvr.rs | 2 +- src/test/run-pass/comm.rs | 3 +-- src/test/run-pass/complex.rs | 4 ++-- src/test/run-pass/conditional-compile.rs | 4 ++-- .../run-pass/const-fields-and-indexing.rs | 2 -- src/test/run-pass/const-region-ptrs.rs | 2 -- src/test/run-pass/const-struct.rs | 1 - src/test/run-pass/const-vecs-and-slices.rs | 2 -- src/test/run-pass/core-run-destroy.rs | 1 - src/test/run-pass/deep-vector2.rs | 2 +- src/test/run-pass/deref.rs | 5 ++++- src/test/run-pass/deriving-meta-multiple.rs | 2 +- src/test/run-pass/deriving-meta.rs | 2 +- src/test/run-pass/die-macro.rs | 4 +++- src/test/run-pass/do-empty-args.rs | 2 +- src/test/run-pass/do-no-args.rs | 4 ++-- src/test/run-pass/do-pure.rs | 2 +- src/test/run-pass/double-unbox.rs | 2 +- src/test/run-pass/drop-on-empty-block-exit.rs | 5 ++++- src/test/run-pass/drop-on-ret.rs | 8 ++++++- src/test/run-pass/drop-trait-generic.rs | 2 +- src/test/run-pass/drop-trait.rs | 2 +- src/test/run-pass/empty-mutable-vec.rs | 4 ++-- src/test/run-pass/enum-alignment.rs | 2 +- src/test/run-pass/enum-disr-val-pretty.rs | 2 +- src/test/run-pass/enum-export-inheritance.rs | 2 +- src/test/run-pass/enum-variants.rs | 5 ++++- src/test/run-pass/enum-vec-initializer.rs | 10 ++++----- src/test/run-pass/estr-slice.rs | 2 +- src/test/run-pass/estr-uniq.rs | 2 ++ src/test/run-pass/evec-internal-boxes.rs | 2 ++ src/test/run-pass/evec-slice.rs | 2 ++ src/test/run-pass/exec-env.rs | 2 +- src/test/run-pass/export-abstract-tag.rs | 2 +- .../run-pass/export-glob-imports-target.rs | 2 +- src/test/run-pass/export-tag-variant.rs | 2 +- src/test/run-pass/expr-block-fn.rs | 2 +- src/test/run-pass/expr-block-ref.rs | 2 +- src/test/run-pass/expr-elseif-ref.rs | 2 +- src/test/run-pass/expr-elseif-ref2.rs | 10 ++++++++- src/test/run-pass/expr-empty-ret.rs | 7 +++++- src/test/run-pass/expr-if-fail-all.rs | 8 ++++++- src/test/run-pass/expr-match-fail-all.rs | 2 +- src/test/run-pass/expr-match.rs | 2 +- src/test/run-pass/extern-mod-syntax.rs | 2 ++ src/test/run-pass/fn-coerce-field.rs | 2 +- src/test/run-pass/fn-lval.rs | 2 +- src/test/run-pass/fn-type-infer.rs | 4 +++- src/test/run-pass/foreign-call-no-runtime.rs | 6 ++--- src/test/run-pass/foreign-fn-linkname.rs | 16 ++++++-------- src/test/run-pass/foreign-mod-unused-const.rs | 4 +++- src/test/run-pass/foreign2.rs | 5 +++-- src/test/run-pass/generic-drop-glue.rs | 2 +- src/test/run-pass/generic-fn.rs | 3 +-- src/test/run-pass/generic-ivec-leak.rs | 2 +- src/test/run-pass/generic-ivec.rs | 2 +- src/test/run-pass/generic-recursive-tag.rs | 2 +- src/test/run-pass/generic-tag-corruption.rs | 2 +- src/test/run-pass/generic-tag-local.rs | 2 +- src/test/run-pass/generic-tag-match.rs | 4 ++-- src/test/run-pass/generic-tag.rs | 8 +++++-- src/test/run-pass/generic-type-synonym.rs | 2 +- src/test/run-pass/getopts_ref.rs | 2 +- src/test/run-pass/guards.rs | 2 +- src/test/run-pass/html-literals.rs | 2 +- src/test/run-pass/import-glob-crate.rs | 3 ++- src/test/run-pass/import3.rs | 1 + src/test/run-pass/import4.rs | 2 +- src/test/run-pass/import6.rs | 3 +++ src/test/run-pass/import7.rs | 3 +++ src/test/run-pass/init-res-into-things.rs | 16 ++++++-------- src/test/run-pass/instantiable.rs | 2 +- src/test/run-pass/int.rs | 2 +- src/test/run-pass/intrinsic-atomics-cc.rs | 8 +++---- src/test/run-pass/intrinsic-move-val.rs | 2 +- src/test/run-pass/intrinsics-math.rs | 2 -- src/test/run-pass/invoke-external-foreign.rs | 2 +- src/test/run-pass/issue-1696.rs | 1 - src/test/run-pass/issue-2214.rs | 1 - src/test/run-pass/issue-2288.rs | 2 +- src/test/run-pass/issue-2311-2.rs | 2 +- src/test/run-pass/issue-2312.rs | 2 +- src/test/run-pass/issue-2428.rs | 2 +- src/test/run-pass/issue-2445-b.rs | 4 ++-- src/test/run-pass/issue-2445.rs | 4 ++-- src/test/run-pass/issue-2463.rs | 4 ++-- src/test/run-pass/issue-2526-a.rs | 2 ++ src/test/run-pass/issue-2633.rs | 2 +- src/test/run-pass/issue-2718.rs | 19 ++++++---------- src/test/run-pass/issue-2804.rs | 2 +- src/test/run-pass/issue-2904.rs | 1 - src/test/run-pass/issue-2989.rs | 1 - src/test/run-pass/issue-3012-2.rs | 2 +- src/test/run-pass/issue-3429.rs | 2 +- src/test/run-pass/issue-3563-3.rs | 3 +-- src/test/run-pass/issue-3574.rs | 3 +++ src/test/run-pass/issue-3743.rs | 2 -- src/test/run-pass/issue-3860.rs | 2 +- src/test/run-pass/issue-3878.rs | 5 +++-- src/test/run-pass/issue-4107.rs | 2 +- src/test/run-pass/issue-4387.rs | 2 +- src/test/run-pass/issue-4542.rs | 2 +- src/test/run-pass/issue-4735.rs | 4 ++-- src/test/run-pass/issue-5192.rs | 2 +- src/test/run-pass/issue-5550.rs | 2 ++ src/test/run-pass/issue-5572.rs | 2 +- src/test/run-pass/issue-5741.rs | 2 ++ src/test/run-pass/issue-5884.rs | 2 +- src/test/run-pass/issue-5926.rs | 2 ++ src/test/run-pass/issue-6318.rs | 2 +- src/test/run-pass/issue-6557.rs | 2 +- src/test/run-pass/issue-979.rs | 6 ++--- src/test/run-pass/istr.rs | 16 +++++++------- src/test/run-pass/item-attributes.rs | 2 +- src/test/run-pass/ivec-pass-by-value.rs | 2 +- src/test/run-pass/ivec-tag.rs | 5 ++--- src/test/run-pass/lambda-infer-unresolved.rs | 2 +- src/test/run-pass/large-records.rs | 2 +- src/test/run-pass/leak-box-as-tydesc.rs | 2 +- src/test/run-pass/leak-tag-copy.rs | 3 ++- src/test/run-pass/leak-unique-as-tydesc.rs | 2 +- src/test/run-pass/let-destruct-fresh-mem.rs | 2 ++ .../liveness-assign-imm-local-after-loop.rs | 6 ++++- .../liveness-assign-imm-local-after-ret.rs | 2 ++ src/test/run-pass/log-err-phi.rs | 2 +- .../log-knows-the-names-of-variants-in-std.rs | 2 +- src/test/run-pass/log-linearized.rs | 4 ++-- src/test/run-pass/long-while.rs | 10 +++++++-- src/test/run-pass/loop-break-cont-1.rs | 2 +- src/test/run-pass/match-borrowed_str.rs | 2 ++ .../run-pass/match-implicit-copy-unique.rs | 2 +- src/test/run-pass/match-naked-record-expr.rs | 2 +- src/test/run-pass/match-naked-record.rs | 2 +- .../run-pass/match-pattern-no-type-params.rs | 5 ++++- src/test/run-pass/match-pattern-simple.rs | 2 +- src/test/run-pass/match-phi.rs | 3 ++- src/test/run-pass/match-with-ret-arm.rs | 2 +- src/test/run-pass/mod-view-items.rs | 2 +- .../module-qualified-struct-destructure.rs | 2 +- src/test/run-pass/monad.rs | 4 ++-- src/test/run-pass/move-3.rs | 2 +- src/test/run-pass/move-nullary-fn.rs | 2 +- src/test/run-pass/move-out-of-field.rs | 4 +--- src/test/run-pass/mut-vstore-expr.rs | 2 +- src/test/run-pass/mutable-alias-vec.rs | 2 -- src/test/run-pass/mutable-vec-drop.rs | 3 ++- src/test/run-pass/nested-matchs.rs | 2 +- src/test/run-pass/nested-pattern.rs | 4 ++-- src/test/run-pass/nested-patterns.rs | 2 +- .../run-pass/new-vstore-mut-box-syntax.rs | 2 +- src/test/run-pass/newlambdas.rs | 2 +- src/test/run-pass/newtype-struct-drop-run.rs | 2 +- src/test/run-pass/option-ext.rs | 6 ++--- src/test/run-pass/option-unwrap.rs | 6 ++--- src/test/run-pass/output-slot-variants.rs | 3 +++ src/test/run-pass/parse-fail.rs | 3 +-- src/test/run-pass/path.rs | 2 +- .../run-pass/pattern-bound-var-in-for-each.rs | 2 +- src/test/run-pass/pattern-in-closure.rs | 2 +- src/test/run-pass/pred-not-bool.rs | 2 +- src/test/run-pass/pub-use-xcrate.rs | 2 +- src/test/run-pass/pub_use_mods_xcrate_exe.rs | 2 ++ src/test/run-pass/rcvr-borrowed-to-slice.rs | 4 +--- src/test/run-pass/region-dependent-addr-of.rs | 12 +++++----- .../run-pass/regions-appearance-constraint.rs | 2 ++ src/test/run-pass/regions-bot.rs | 2 +- src/test/run-pass/regions-creating-enums5.rs | 2 +- src/test/run-pass/regions-fn-subtyping.rs | 3 +++ .../run-pass/resource-assign-is-not-copy.rs | 4 +--- src/test/run-pass/resource-cycle2.rs | 2 +- src/test/run-pass/resource-destruct.rs | 4 +--- src/test/run-pass/resource-in-struct.rs | 6 ++--- src/test/run-pass/return-nil.rs | 2 +- src/test/run-pass/send-resource.rs | 1 - src/test/run-pass/send-type-inference.rs | 4 +--- src/test/run-pass/shadow.rs | 2 +- src/test/run-pass/size-and-align.rs | 2 +- src/test/run-pass/spawn-types.rs | 5 ++--- src/test/run-pass/stat.rs | 1 - src/test/run-pass/static-impl.rs | 1 - src/test/run-pass/str-append.rs | 4 ++-- src/test/run-pass/string-self-append.rs | 2 -- .../run-pass/struct-like-variant-construct.rs | 2 +- src/test/run-pass/struct-order-of-eval-1.rs | 2 -- src/test/run-pass/struct-order-of-eval-2.rs | 2 -- src/test/run-pass/swap-overlapping.rs | 1 - src/test/run-pass/syntax-extension-fmt.rs | 22 +++++++++---------- src/test/run-pass/syntax-extension-minor.rs | 2 +- .../run-pass/syntax-extension-source-utils.rs | 6 ++--- src/test/run-pass/tag-in-block.rs | 2 +- src/test/run-pass/task-comm-0.rs | 1 - src/test/run-pass/task-comm-10.rs | 2 +- src/test/run-pass/task-comm-11.rs | 6 ++--- src/test/run-pass/task-comm-12.rs | 2 +- src/test/run-pass/task-comm-13.rs | 2 +- src/test/run-pass/task-comm-3.rs | 2 +- src/test/run-pass/task-comm-4.rs | 2 ++ src/test/run-pass/task-comm-5.rs | 2 +- src/test/run-pass/task-comm-6.rs | 2 ++ src/test/run-pass/task-comm-7.rs | 2 ++ src/test/run-pass/task-life-0.rs | 2 +- src/test/run-pass/task-spawn-move-and-copy.rs | 1 - src/test/run-pass/terminate-in-initializer.rs | 10 ++++----- src/test/run-pass/trait-default-method-xc.rs | 2 +- src/test/run-pass/trait-inheritance-num5.rs | 2 +- .../trait-static-method-overwriting.rs | 8 +++---- src/test/run-pass/trait-to-str.rs | 2 +- .../run-pass/traits-default-method-mut.rs | 2 ++ src/test/run-pass/type-in-nested-module.rs | 2 +- src/test/run-pass/type-param-constraints.rs | 6 ++--- src/test/run-pass/type-params-in-for-each.rs | 6 +++-- src/test/run-pass/typestate-cfg-nesting.rs | 3 ++- src/test/run-pass/uint.rs | 2 +- .../run-pass/unary-minus-suffix-inference.rs | 6 ++--- src/test/run-pass/unique-assign-drop.rs | 2 ++ src/test/run-pass/unique-containing-tag.rs | 2 +- src/test/run-pass/unique-copy-box.rs | 18 +++++++-------- src/test/run-pass/unique-decl.rs | 2 +- src/test/run-pass/unique-drop-complex.rs | 2 +- src/test/run-pass/unique-init.rs | 2 +- src/test/run-pass/unique-move-drop.rs | 2 ++ src/test/run-pass/unique-object-move.rs | 4 ++-- src/test/run-pass/unique-pinned-nocopy-2.rs | 6 ++--- src/test/run-pass/unique-send.rs | 2 -- src/test/run-pass/unit.rs | 4 ++-- src/test/run-pass/unnamed_argument_mode.rs | 6 ++--- src/test/run-pass/unreachable-code-1.rs | 2 ++ src/test/run-pass/unreachable-code.rs | 3 +++ src/test/run-pass/unused-move-capture.rs | 2 +- src/test/run-pass/unused-move.rs | 2 ++ src/test/run-pass/unwind-box.rs | 2 +- src/test/run-pass/unwind-resource2.rs | 2 +- src/test/run-pass/unwind-unique.rs | 2 +- src/test/run-pass/use-uninit-match.rs | 5 ++++- src/test/run-pass/use-uninit-match2.rs | 5 ++++- src/test/run-pass/use.rs | 2 ++ src/test/run-pass/utf8_chars.rs | 21 +++++++++--------- src/test/run-pass/vec-drop.rs | 2 +- src/test/run-pass/vec-ivec-deadlock.rs | 2 ++ src/test/run-pass/vec-matching-autoslice.rs | 2 +- src/test/run-pass/vec-slice-drop.rs | 4 +--- src/test/run-pass/vec-tail-matching.rs | 2 +- src/test/run-pass/vector-no-ann-2.rs | 2 +- src/test/run-pass/weird-exprs.rs | 2 +- src/test/run-pass/while-flow-graph.rs | 2 +- src/test/run-pass/while-loop-constraints-2.rs | 4 +++- src/test/run-pass/while-with-break.rs | 2 +- src/test/run-pass/x86stdcall2.rs | 2 +- src/test/run-pass/xcrate-unit-struct.rs | 2 -- 400 files changed, 701 insertions(+), 581 deletions(-) diff --git a/src/test/auxiliary/cci_capture_clause.rs b/src/test/auxiliary/cci_capture_clause.rs index 61a3ca1559c27..a9c3e1d2b0f86 100644 --- a/src/test/auxiliary/cci_capture_clause.rs +++ b/src/test/auxiliary/cci_capture_clause.rs @@ -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(x: T) -> Port { diff --git a/src/test/auxiliary/cci_class_5.rs b/src/test/auxiliary/cci_class_5.rs index 5b8bebda9248e..63a7392fc70b9 100644 --- a/src/test/auxiliary/cci_class_5.rs +++ b/src/test/auxiliary/cci_class_5.rs @@ -9,8 +9,6 @@ // except according to those terms. pub mod kitties { - use std::uint; - pub struct cat { priv meows : uint, how_hungry : int, @@ -26,5 +24,4 @@ pub mod kitties { how_hungry: in_y } } - } diff --git a/src/test/auxiliary/cci_class_cast.rs b/src/test/auxiliary/cci_class_cast.rs index c1e23f1f5c848..8fac4a3f322af 100644 --- a/src/test/auxiliary/cci_class_cast.rs +++ b/src/test/auxiliary/cci_class_cast.rs @@ -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, diff --git a/src/test/auxiliary/crate-method-reexport-grrrrrrr2.rs b/src/test/auxiliary/crate-method-reexport-grrrrrrr2.rs index ea42a51ff11d9..d8e3c2a9054a0 100644 --- a/src/test/auxiliary/crate-method-reexport-grrrrrrr2.rs +++ b/src/test/auxiliary/crate-method-reexport-grrrrrrr2.rs @@ -20,7 +20,7 @@ pub mod name_pool { } impl add for name_pool { - fn add(&self, s: ~str) { + fn add(&self, _s: ~str) { } } } diff --git a/src/test/auxiliary/crateresolve5-1.rs b/src/test/auxiliary/crateresolve5-1.rs index c120a971c6b90..f20a143b658ba 100644 --- a/src/test/auxiliary/crateresolve5-1.rs +++ b/src/test/auxiliary/crateresolve5-1.rs @@ -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) } diff --git a/src/test/auxiliary/crateresolve5-2.rs b/src/test/auxiliary/crateresolve5-2.rs index 230fdad046891..10adc3381596a 100644 --- a/src/test/auxiliary/crateresolve5-2.rs +++ b/src/test/auxiliary/crateresolve5-2.rs @@ -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 } diff --git a/src/test/auxiliary/issue-2526.rs b/src/test/auxiliary/issue-2526.rs index 8c491a4dfc83b..cbdd6b56b7da4 100644 --- a/src/test/auxiliary/issue-2526.rs +++ b/src/test/auxiliary/issue-2526.rs @@ -35,9 +35,7 @@ fn arc(_data: T) -> arc_destruct { } fn init() -> arc_destruct { - unsafe { - arc(context_res()) - } + arc(context_res()) } struct context_res { diff --git a/src/test/auxiliary/issue2378a.rs b/src/test/auxiliary/issue2378a.rs index eed271c5499fe..88439e32b0dda 100644 --- a/src/test/auxiliary/issue2378a.rs +++ b/src/test/auxiliary/issue2378a.rs @@ -14,7 +14,7 @@ enum maybe { just(T), nothing } impl Index for maybe { - fn index(&self, idx: &uint) -> T { + fn index(&self, _idx: &uint) -> T { match self { &just(ref t) => (*t).clone(), ¬hing => { fail!(); } diff --git a/src/test/auxiliary/issue_2316_b.rs b/src/test/auxiliary/issue_2316_b.rs index 32283e5373ca6..1c16e347b27be 100644 --- a/src/test/auxiliary/issue_2316_b.rs +++ b/src/test/auxiliary/issue_2316_b.rs @@ -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 { diff --git a/src/test/auxiliary/moves_based_on_type_lib.rs b/src/test/auxiliary/moves_based_on_type_lib.rs index cd72468511ea1..f45b80715953e 100644 --- a/src/test/auxiliary/moves_based_on_type_lib.rs +++ b/src/test/auxiliary/moves_based_on_type_lib.rs @@ -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; } diff --git a/src/test/auxiliary/trait_default_method_xc_aux.rs b/src/test/auxiliary/trait_default_method_xc_aux.rs index 4d910385cd683..105d7f758f787 100644 --- a/src/test/auxiliary/trait_default_method_xc_aux.rs +++ b/src/test/auxiliary/trait_default_method_xc_aux.rs @@ -19,7 +19,7 @@ impl A for Something { trait B { fn thing(&self, x: T, y: U) -> (T, U) { (x, y) } - fn staticthing(z: &Self, x: T, y: U) -> (T, U) { (x, y) } + fn staticthing(_z: &Self, x: T, y: U) -> (T, U) { (x, y) } } impl B for int { } diff --git a/src/test/bench/core-std.rs b/src/test/bench/core-std.rs index a0ceb654b5269..6735d623e6cdf 100644 --- a/src/test/bench/core-std.rs +++ b/src/test/bench/core-std.rs @@ -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; diff --git a/src/test/bench/msgsend-ring-mutex-arcs.rs b/src/test/bench/msgsend-ring-mutex-arcs.rs index 7de95f4d822c5..a5311d5c83134 100644 --- a/src/test/bench/msgsend-ring-mutex-arcs.rs +++ b/src/test/bench/msgsend-ring-mutex-arcs.rs @@ -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; diff --git a/src/test/bench/msgsend-ring-rw-arcs.rs b/src/test/bench/msgsend-ring-rw-arcs.rs index 1299e863db6b3..e25490bcd9ba8 100644 --- a/src/test/bench/msgsend-ring-rw-arcs.rs +++ b/src/test/bench/msgsend-ring-rw-arcs.rs @@ -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; diff --git a/src/test/bench/noise.rs b/src/test/bench/noise.rs index 8503b188b2f25..e5fac51249908 100644 --- a/src/test/bench/noise.rs +++ b/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; diff --git a/src/test/bench/rt-messaging-ping-pong.rs b/src/test/bench/rt-messaging-ping-pong.rs index 3d38d61bc2eb6..6c482c6d20729 100644 --- a/src/test/bench/rt-messaging-ping-pong.rs +++ b/src/test/bench/rt-messaging-ping-pong.rs @@ -10,7 +10,6 @@ extern mod extra; -use std::task::spawn; use std::os; use std::uint; use std::rt::test::spawntask_later; diff --git a/src/test/bench/rt-parfib.rs b/src/test/bench/rt-parfib.rs index 6669342f511a8..32f0a592273f5 100644 --- a/src/test/bench/rt-parfib.rs +++ b/src/test/bench/rt-parfib.rs @@ -10,7 +10,6 @@ extern mod extra; -use std::task::spawn; use std::os; use std::uint; use std::rt::test::spawntask_later; diff --git a/src/test/bench/shootout-ackermann.rs b/src/test/bench/shootout-ackermann.rs index e8659ba26d4bc..3ecb580874c4b 100644 --- a/src/test/bench/shootout-ackermann.rs +++ b/src/test/bench/shootout-ackermann.rs @@ -11,7 +11,6 @@ extern mod extra; use std::int; -use std::io; use std::os; fn ack(m: int, n: int) -> int { diff --git a/src/test/bench/shootout-fasta.rs b/src/test/bench/shootout-fasta.rs index 4e2ab8b0a498d..9d47e7fed237b 100644 --- a/src/test/bench/shootout-fasta.rs +++ b/src/test/bench/shootout-fasta.rs @@ -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; diff --git a/src/test/bench/shootout-fibo.rs b/src/test/bench/shootout-fibo.rs index 9c07df36eb3c1..a367beface217 100644 --- a/src/test/bench/shootout-fibo.rs +++ b/src/test/bench/shootout-fibo.rs @@ -11,7 +11,6 @@ extern mod extra; use std::int; -use std::io; use std::os; fn fib(n: int) -> int { diff --git a/src/test/bench/shootout-k-nucleotide-pipes.rs b/src/test/bench/shootout-k-nucleotide-pipes.rs index 66b9bdc0a42c9..0a036696544e8 100644 --- a/src/test/bench/shootout-k-nucleotide-pipes.rs +++ b/src/test/bench/shootout-k-nucleotide-pipes.rs @@ -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; diff --git a/src/test/bench/sudoku.rs b/src/test/bench/sudoku.rs index 6757354089534..17fe1135fd985 100644 --- a/src/test/bench/sudoku.rs +++ b/src/test/bench/sudoku.rs @@ -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; diff --git a/src/test/codegen/scalar-function-call.rs b/src/test/codegen/scalar-function-call.rs index e3631b73c022c..ca30fc2bd7b86 100644 --- a/src/test/codegen/scalar-function-call.rs +++ b/src/test/codegen/scalar-function-call.rs @@ -14,5 +14,5 @@ fn foo(x: int) -> int { #[no_mangle] fn test() { - let x = foo(10); + let _x = foo(10); } diff --git a/src/test/debug-info/basic-types.rs b/src/test/debug-info/basic-types.rs index 7125ebe8d564c..4e8f7d0d4aaa6 100644 --- a/src/test/debug-info/basic-types.rs +++ b/src/test/debug-info/basic-types.rs @@ -51,6 +51,8 @@ // debugger:print f64 // check:$15 = 3.5 +#[allow(unused_variable)]; + fn main() { let b: bool = false; let i: int = -1; diff --git a/src/test/debug-info/borrowed-basic.rs b/src/test/debug-info/borrowed-basic.rs index 7610301f6f035..9de460163f091 100644 --- a/src/test/debug-info/borrowed-basic.rs +++ b/src/test/debug-info/borrowed-basic.rs @@ -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; @@ -110,4 +112,4 @@ fn main() { zzz(); } -fn zzz() {()} \ No newline at end of file +fn zzz() {()} diff --git a/src/test/debug-info/borrowed-c-style-enum.rs b/src/test/debug-info/borrowed-c-style-enum.rs index 70c85258c7921..3b398201726c3 100644 --- a/src/test/debug-info/borrowed-c-style-enum.rs +++ b/src/test/debug-info/borrowed-c-style-enum.rs @@ -24,6 +24,8 @@ // debugger:print *the_c_ref // check:$3 = TheC +#[allow(unused_variable)]; + enum ABC { TheA, TheB, TheC } fn main() { @@ -39,4 +41,4 @@ fn main() { zzz(); } -fn zzz() {()} \ No newline at end of file +fn zzz() {()} diff --git a/src/test/debug-info/borrowed-enum.rs b/src/test/debug-info/borrowed-enum.rs index 38aa9c3881000..2052ce3c93256 100644 --- a/src/test/debug-info/borrowed-enum.rs +++ b/src/test/debug-info/borrowed-enum.rs @@ -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. @@ -59,4 +61,4 @@ fn main() { zzz(); } -fn zzz() {()} \ No newline at end of file +fn zzz() {()} diff --git a/src/test/debug-info/borrowed-managed-basic.rs b/src/test/debug-info/borrowed-managed-basic.rs index 9087bb36fa5d6..bf0edef83a0aa 100644 --- a/src/test/debug-info/borrowed-managed-basic.rs +++ b/src/test/debug-info/borrowed-managed-basic.rs @@ -62,6 +62,7 @@ // debugger:print *f64_ref // check:$15 = 3.5 +#[allow(unused_variable)]; fn main() { let bool_box: @bool = @true; @@ -111,4 +112,4 @@ fn main() { zzz(); } -fn zzz() {()} \ No newline at end of file +fn zzz() {()} diff --git a/src/test/debug-info/borrowed-struct.rs b/src/test/debug-info/borrowed-struct.rs index 8b6eca3e37f79..77f8bd21fb3d4 100644 --- a/src/test/debug-info/borrowed-struct.rs +++ b/src/test/debug-info/borrowed-struct.rs @@ -45,7 +45,7 @@ // debugger:print *unique_val_interior_ref_2 // check:$10 = 26.5 - +#[allow(unused_variable)]; struct SomeStruct { x: int, @@ -72,4 +72,4 @@ fn main() { zzz(); } -fn zzz() {()} \ No newline at end of file +fn zzz() {()} diff --git a/src/test/debug-info/borrowed-tuple.rs b/src/test/debug-info/borrowed-tuple.rs index da199941c8419..8810c493aed07 100644 --- a/src/test/debug-info/borrowed-tuple.rs +++ b/src/test/debug-info/borrowed-tuple.rs @@ -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; @@ -41,4 +43,4 @@ fn main() { zzz(); } -fn zzz() {()} \ No newline at end of file +fn zzz() {()} diff --git a/src/test/debug-info/borrowed-unique-basic.rs b/src/test/debug-info/borrowed-unique-basic.rs index 52f5a2cba1ebe..c62b05d13583a 100644 --- a/src/test/debug-info/borrowed-unique-basic.rs +++ b/src/test/debug-info/borrowed-unique-basic.rs @@ -62,6 +62,8 @@ // debugger:print *f64_ref // check:$15 = 3.5 +#[allow(unused_variable)]; + fn main() { let bool_box: ~bool = ~true; @@ -111,4 +113,4 @@ fn main() { zzz(); } -fn zzz() {()} \ No newline at end of file +fn zzz() {()} diff --git a/src/test/debug-info/box.rs b/src/test/debug-info/box.rs index c63cffd7b74bb..cc41267e5c202 100644 --- a/src/test/debug-info/box.rs +++ b/src/test/debug-info/box.rs @@ -24,6 +24,8 @@ // debugger:print d->val // check:$4 = false +#[allow(unused_variable)]; + fn main() { let a = ~1; let b = ~(2, 3.5); diff --git a/src/test/debug-info/boxed-struct.rs b/src/test/debug-info/boxed-struct.rs index 86162f0fa04cd..0e22980025be8 100644 --- a/src/test/debug-info/boxed-struct.rs +++ b/src/test/debug-info/boxed-struct.rs @@ -27,6 +27,8 @@ // debugger:print managed_dtor->val // check:$4 = {x = 33, y = 333, z = 3333, w = 33333} +#[allow(unused_variable)]; + struct StructWithSomePadding { x: i16, y: i32, @@ -56,4 +58,4 @@ fn main() { zzz(); } -fn zzz() {()} \ No newline at end of file +fn zzz() {()} diff --git a/src/test/debug-info/boxed-vec.rs b/src/test/debug-info/boxed-vec.rs index 8abead6519697..84b1ad44ebc1a 100644 --- a/src/test/debug-info/boxed-vec.rs +++ b/src/test/debug-info/boxed-vec.rs @@ -25,6 +25,8 @@ // debugger:print *((uint64_t[4]*)(unique->elements)) // check:$4 = {10, 11, 12, 13} +#[allow(unused_variable)]; + fn main() { let managed: @[i64] = @[7, 8, 9]; @@ -33,4 +35,4 @@ fn main() { zzz(); } -fn zzz() {()} \ No newline at end of file +fn zzz() {()} diff --git a/src/test/debug-info/c-style-enum-in-composite.rs b/src/test/debug-info/c-style-enum-in-composite.rs index 47e433ea814ab..def0a8275c07f 100644 --- a/src/test/debug-info/c-style-enum-in-composite.rs +++ b/src/test/debug-info/c-style-enum-in-composite.rs @@ -36,6 +36,8 @@ // debugger:print struct_with_drop // check:$7 = {{a = OneHundred, b = Vienna}, 9} +#[allow(unused_variable)]; + enum AnEnum { OneHundred = 100, OneThousand = 1000, @@ -116,4 +118,4 @@ fn main() { zzz(); } -fn zzz() {()} \ No newline at end of file +fn zzz() {()} diff --git a/src/test/debug-info/c-style-enum.rs b/src/test/debug-info/c-style-enum.rs index d7cce4e6f3fb5..1b57ab0d447e1 100644 --- a/src/test/debug-info/c-style-enum.rs +++ b/src/test/debug-info/c-style-enum.rs @@ -36,6 +36,8 @@ // debugger:print single_variant // check:$7 = TheOnlyVariant +#[allow(unused_variable)]; + enum AutoDiscriminant { One, Two, @@ -67,4 +69,4 @@ fn main() { zzz(); } -fn zzz() {()} \ No newline at end of file +fn zzz() {()} diff --git a/src/test/debug-info/destructured-fn-argument.rs b/src/test/debug-info/destructured-fn-argument.rs index 05718ab48909f..0269d3f415574 100644 --- a/src/test/debug-info/destructured-fn-argument.rs +++ b/src/test/debug-info/destructured-fn-argument.rs @@ -181,6 +181,7 @@ // check:$49 = 62 // debugger:continue +#[allow(unused_variable)]; struct Struct { a: i64, @@ -315,4 +316,4 @@ fn main() { } -fn zzz() {()} \ No newline at end of file +fn zzz() {()} diff --git a/src/test/debug-info/destructured-local.rs b/src/test/debug-info/destructured-local.rs index f8db7981c941b..bc78b6cd35e94 100644 --- a/src/test/debug-info/destructured-local.rs +++ b/src/test/debug-info/destructured-local.rs @@ -125,6 +125,7 @@ // debugger:print *nn // check:$43 = 56 +#[allow(unused_variable)]; struct Struct { a: i64, @@ -206,4 +207,4 @@ fn main() { zzz(); } -fn zzz() {()} \ No newline at end of file +fn zzz() {()} diff --git a/src/test/debug-info/evec-in-struct.rs b/src/test/debug-info/evec-in-struct.rs index 7e42690548e70..1594de4f5c05d 100644 --- a/src/test/debug-info/evec-in-struct.rs +++ b/src/test/debug-info/evec-in-struct.rs @@ -30,6 +30,8 @@ // debugger:print struct_padded_at_end // check:$5 = {x = {22, 23}, y = {24, 25}} +#[allow(unused_variable)]; + struct NoPadding1 { x: [u32, ..3], y: i32, @@ -85,4 +87,4 @@ fn main() { zzz(); } -fn zzz() {()} \ No newline at end of file +fn zzz() {()} diff --git a/src/test/debug-info/managed-enum.rs b/src/test/debug-info/managed-enum.rs index 1a3600a7d8cb3..f2d753fc88d8f 100644 --- a/src/test/debug-info/managed-enum.rs +++ b/src/test/debug-info/managed-enum.rs @@ -24,6 +24,8 @@ // debugger:print univariant->val // check:$3 = {-9747455} +#[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. @@ -60,4 +62,4 @@ fn main() { zzz(); } -fn zzz() {()} \ No newline at end of file +fn zzz() {()} diff --git a/src/test/debug-info/managed-pointer-within-unique-vec.rs b/src/test/debug-info/managed-pointer-within-unique-vec.rs index e42631599a9b9..a0b6f0e2b4f51 100644 --- a/src/test/debug-info/managed-pointer-within-unique-vec.rs +++ b/src/test/debug-info/managed-pointer-within-unique-vec.rs @@ -27,6 +27,8 @@ // debugger:print unique->val.elements[3]->val // check:$4 = 13 +#[allow(unused_variable)]; + fn main() { let unique: ~[@i64] = ~[@10, @11, @12, @13]; @@ -34,4 +36,4 @@ fn main() { zzz(); } -fn zzz() {()} \ No newline at end of file +fn zzz() {()} diff --git a/src/test/debug-info/managed-pointer-within-unique.rs b/src/test/debug-info/managed-pointer-within-unique.rs index 3eb1c2ef01e55..4acf8d6efc7da 100644 --- a/src/test/debug-info/managed-pointer-within-unique.rs +++ b/src/test/debug-info/managed-pointer-within-unique.rs @@ -25,6 +25,8 @@ // debugger:print managed_within_unique.val->y->val // check:$3 = -4 +#[allow(unused_variable)]; + struct ContainsManaged { x: int, @@ -44,4 +46,4 @@ fn main() { zzz(); } -fn zzz() {()} \ No newline at end of file +fn zzz() {()} diff --git a/src/test/debug-info/multiple-functions-equal-var-names.rs b/src/test/debug-info/multiple-functions-equal-var-names.rs index 5b690b9d067c4..3f9dd1a0748fb 100644 --- a/src/test/debug-info/multiple-functions-equal-var-names.rs +++ b/src/test/debug-info/multiple-functions-equal-var-names.rs @@ -28,6 +28,8 @@ // debugger:print abc // check:$3 = 30303 +#[allow(unused_variable)]; + fn function_one() { let abc = 10101; zzz(); diff --git a/src/test/debug-info/multiple-functions.rs b/src/test/debug-info/multiple-functions.rs index aaac723f1613e..4d709070763cd 100644 --- a/src/test/debug-info/multiple-functions.rs +++ b/src/test/debug-info/multiple-functions.rs @@ -28,6 +28,8 @@ // debugger:print c // check:$3 = 30303 +#[allow(unused_variable)]; + fn function_one() { let a = 10101; zzz(); diff --git a/src/test/debug-info/nil-enum.rs b/src/test/debug-info/nil-enum.rs index d3afd4b11f9cd..8622795ee9048 100644 --- a/src/test/debug-info/nil-enum.rs +++ b/src/test/debug-info/nil-enum.rs @@ -21,6 +21,8 @@ // debugger:print second // check:$2 = {} +#[allow(unused_variable)]; + enum ANilEnum {} enum AnotherNilEnum {} @@ -37,4 +39,4 @@ fn main() { } } -fn zzz() {()} \ No newline at end of file +fn zzz() {()} diff --git a/src/test/debug-info/packed-struct-with-destructor.rs b/src/test/debug-info/packed-struct-with-destructor.rs index 9ff91aa00d1c9..f36e8454da99e 100644 --- a/src/test/debug-info/packed-struct-with-destructor.rs +++ b/src/test/debug-info/packed-struct-with-destructor.rs @@ -41,6 +41,8 @@ // debugger:print deeplyNested // check:$8 = {a = {a = 1, b = {x = 2, y = 3, z = 4}, c = 5, d = {x = 6, y = 7, z = 8}}, b = {a = 9, b = {x = 10, y = 11, z = 12}, c = {x = 13, y = 14, z = 15}, d = 16}, c = {a = 17, b = {x = 18, y = 19, z = 20}, c = 21, d = {x = 22, y = 23, z = 24}}, d = {a = 25, b = {x = 26, y = 27, z = 28}, c = 29, d = {x = 30, y = 31, z = 32}}, e = {a = 33, b = {x = 34, y = 35, z = 36}, c = {x = 37, y = 38, z = 39}, d = 40}, f = {a = 41, b = {x = 42, y = 43, z = 44}, c = 45, d = {x = 46, y = 47, z = 48}}} +#[allow(unused_variable)]; + #[packed] struct Packed { x: i16, @@ -216,4 +218,4 @@ fn main() { zzz(); } -fn zzz() {()} \ No newline at end of file +fn zzz() {()} diff --git a/src/test/debug-info/packed-struct.rs b/src/test/debug-info/packed-struct.rs index 859166cb023a3..93d3a9f2f116e 100644 --- a/src/test/debug-info/packed-struct.rs +++ b/src/test/debug-info/packed-struct.rs @@ -34,6 +34,8 @@ // debugger:print sizeof(packedInPacked) // check:$6 = 40 +#[allow(unused_variable)]; + #[packed] struct Packed { x: i16, @@ -101,4 +103,4 @@ fn main() { zzz(); } -fn zzz() {()} \ No newline at end of file +fn zzz() {()} diff --git a/src/test/debug-info/simple-struct.rs b/src/test/debug-info/simple-struct.rs index 49e7bc255c10f..6532a3841e5ef 100644 --- a/src/test/debug-info/simple-struct.rs +++ b/src/test/debug-info/simple-struct.rs @@ -34,6 +34,7 @@ // debugger:print padding_at_end // check:$6 = {x = -10014, y = 10015} +#[allow(unused_variable)]; struct NoPadding16 { x: u16, @@ -81,4 +82,4 @@ fn main() { zzz(); } -fn zzz() {()} \ No newline at end of file +fn zzz() {()} diff --git a/src/test/debug-info/simple-tuple.rs b/src/test/debug-info/simple-tuple.rs index f45294221af16..81a6c4a3ee56e 100644 --- a/src/test/debug-info/simple-tuple.rs +++ b/src/test/debug-info/simple-tuple.rs @@ -33,6 +33,7 @@ // debugger:print paddingAtEnd // check:$7 = {15, 16} +#[allow(unused_variable)]; fn main() { let noPadding8: (i8, u8) = (-100, 100); @@ -48,4 +49,4 @@ fn main() { zzz(); } -fn zzz() {()} \ No newline at end of file +fn zzz() {()} diff --git a/src/test/debug-info/struct-in-enum.rs b/src/test/debug-info/struct-in-enum.rs index 1002266a1a985..c7879ac472092 100644 --- a/src/test/debug-info/struct-in-enum.rs +++ b/src/test/debug-info/struct-in-enum.rs @@ -25,6 +25,8 @@ // debugger:print univariant // check:$3 = {{x = 123, y = 456, z = 789}} +#[allow(unused_variable)]; + struct Struct { x: u32, y: i32, diff --git a/src/test/debug-info/struct-in-struct.rs b/src/test/debug-info/struct-in-struct.rs index 04c5eec610b73..ca02283de3788 100644 --- a/src/test/debug-info/struct-in-struct.rs +++ b/src/test/debug-info/struct-in-struct.rs @@ -25,6 +25,7 @@ // debugger:print padding_at_end_parent // check:$3 = {x = {x = 10, y = 11}, y = {x = 12, y = 13}, z = {x = 14, y = 15}} +#[allow(unused_variable)]; struct Simple { x: i32 @@ -142,4 +143,4 @@ fn main() { zzz(); } -fn zzz() {()} \ No newline at end of file +fn zzz() {()} diff --git a/src/test/debug-info/struct-style-enum.rs b/src/test/debug-info/struct-style-enum.rs index 61bbd2e215ff6..30be3b845634d 100644 --- a/src/test/debug-info/struct-style-enum.rs +++ b/src/test/debug-info/struct-style-enum.rs @@ -28,6 +28,8 @@ // debugger:print univariant // check:$4 = {a = -1} +#[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. @@ -70,4 +72,4 @@ fn main() { zzz(); } -fn zzz() {()} \ No newline at end of file +fn zzz() {()} diff --git a/src/test/debug-info/struct-with-destructor.rs b/src/test/debug-info/struct-with-destructor.rs index 0719f64b2564f..09bb690988c31 100644 --- a/src/test/debug-info/struct-with-destructor.rs +++ b/src/test/debug-info/struct-with-destructor.rs @@ -26,6 +26,8 @@ // debugger:print nested // check:$4 = {a = {a = {x = 7890, y = 9870}}} +#[allow(unused_variable)]; + struct NoDestructor { x: i32, y: i64 diff --git a/src/test/debug-info/tuple-in-struct.rs b/src/test/debug-info/tuple-in-struct.rs index 369c9fd28ccdf..b2611b3077d61 100644 --- a/src/test/debug-info/tuple-in-struct.rs +++ b/src/test/debug-info/tuple-in-struct.rs @@ -41,6 +41,8 @@ // debugger:print mixed_padding // check:$10 = {x = {{40, 41, 42}, {43, 44}}, y = {45, 46, 47, 48}} +#[allow(unused_variable)]; + struct NoPadding1 { x: (i32, i32), y: i32, @@ -148,4 +150,4 @@ fn main() { zzz(); } -fn zzz() {()} \ No newline at end of file +fn zzz() {()} diff --git a/src/test/debug-info/tuple-in-tuple.rs b/src/test/debug-info/tuple-in-tuple.rs index 9c6805dae67d3..940edd0897519 100644 --- a/src/test/debug-info/tuple-in-tuple.rs +++ b/src/test/debug-info/tuple-in-tuple.rs @@ -33,6 +33,8 @@ // debugger:print padding_at_end2 // check:$7 = {{21, 22}, 23} +#[allow(unused_variable)]; + fn main() { let no_padding1: ((u32, u32), u32, u32) = ((0, 1), 2, 3); let no_padding2: (u32, (u32, u32), u32) = (4, (5, 6), 7); @@ -47,4 +49,4 @@ fn main() { zzz(); } -fn zzz() {()} \ No newline at end of file +fn zzz() {()} diff --git a/src/test/debug-info/tuple-style-enum.rs b/src/test/debug-info/tuple-style-enum.rs index ba1d02bb62a3c..5dadfa84ba967 100644 --- a/src/test/debug-info/tuple-style-enum.rs +++ b/src/test/debug-info/tuple-style-enum.rs @@ -28,6 +28,8 @@ // debugger:print univariant // check:$4 = {-1} +#[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. @@ -70,4 +72,4 @@ fn main() { zzz(); } -fn zzz() {()} \ No newline at end of file +fn zzz() {()} diff --git a/src/test/debug-info/unique-enum.rs b/src/test/debug-info/unique-enum.rs index 443f641a85859..84f7e817d2488 100644 --- a/src/test/debug-info/unique-enum.rs +++ b/src/test/debug-info/unique-enum.rs @@ -24,6 +24,8 @@ // debugger:print *univariant // check:$3 = {123234} +#[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. @@ -60,4 +62,4 @@ fn main() { zzz(); } -fn zzz() {()} \ No newline at end of file +fn zzz() {()} diff --git a/src/test/debug-info/vec-slices.rs b/src/test/debug-info/vec-slices.rs index 4691de0491721..14ff159769d70 100644 --- a/src/test/debug-info/vec-slices.rs +++ b/src/test/debug-info/vec-slices.rs @@ -47,6 +47,8 @@ // debugger:print padded_struct.data_ptr[1] // check:$13 = {x = 13, y = 14, z = 15} +#[allow(unused_variable)]; + struct AStruct { x: i16, y: i32, diff --git a/src/test/debug-info/vec.rs b/src/test/debug-info/vec.rs index 57130b45eae30..8387214b3bc62 100644 --- a/src/test/debug-info/vec.rs +++ b/src/test/debug-info/vec.rs @@ -18,6 +18,8 @@ // debugger:print a // check:$1 = {1, 2, 3} +#[allow(unused_variable)]; + fn main() { let a = [1, 2, 3]; diff --git a/src/test/pretty/block-arg-disambig.rs b/src/test/pretty/block-arg-disambig.rs index 9e6f053e4c2b9..c0f173a1a0d6a 100644 --- a/src/test/pretty/block-arg-disambig.rs +++ b/src/test/pretty/block-arg-disambig.rs @@ -8,5 +8,5 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -fn blk1(b: &fn()) -> @fn() { return || { }; } +fn blk1(_b: &fn()) -> @fn() { return || { }; } fn test1() { (do blk1 { info!("hi"); })(); } diff --git a/src/test/pretty/disamb-stmt-expr.rs b/src/test/pretty/disamb-stmt-expr.rs index a6266c6a5dd28..f6787fa9c3d21 100644 --- a/src/test/pretty/disamb-stmt-expr.rs +++ b/src/test/pretty/disamb-stmt-expr.rs @@ -16,5 +16,5 @@ fn id(f: &fn() -> int) -> int { f() } -fn wsucc(n: int) -> int { (do id || { 1 }) - 0 } +fn wsucc(_n: int) -> int { (do id || { 1 }) - 0 } fn main() { } diff --git a/src/test/pretty/fn-types.rs b/src/test/pretty/fn-types.rs index b1f7828a2f425..0545e9ed166f2 100644 --- a/src/test/pretty/fn-types.rs +++ b/src/test/pretty/fn-types.rs @@ -10,8 +10,8 @@ // pp-exact -fn from_foreign_fn(x: extern "Rust" fn()) { } -fn from_stack_closure(x: &fn()) { } -fn from_box_closure(x: @fn()) { } -fn from_unique_closure(x: ~fn()) { } +fn from_foreign_fn(_x: extern "Rust" fn()) { } +fn from_stack_closure(_x: &fn()) { } +fn from_box_closure(_x: @fn()) { } +fn from_unique_closure(_x: ~fn()) { } fn main() { } diff --git a/src/test/pretty/for-comment.rs b/src/test/pretty/for-comment.rs index 6b4e6a30d87f4..2318e783b6947 100644 --- a/src/test/pretty/for-comment.rs +++ b/src/test/pretty/for-comment.rs @@ -10,9 +10,11 @@ // pp-exact -fn f(v: &[int]) { +fn f(v: &[int]) -> int { let mut n = 0; for e in v.iter() { n = *e; // This comment once triggered pretty printer bug } + + n } diff --git a/src/test/pretty/match-naked-expr-long.rs b/src/test/pretty/match-naked-expr-long.rs index 66ad3d558201d..75b42e8e59042 100644 --- a/src/test/pretty/match-naked-expr-long.rs +++ b/src/test/pretty/match-naked-expr-long.rs @@ -15,11 +15,11 @@ fn main() { let x = Some(3); - let y = + let _y = match x { Some(_) => - ~"some" + ~"very" + ~"very" + ~"very" + ~"very" + ~"very" + - ~"very" + ~"very" + ~"very" + ~"long" + ~"string", + ~"some" + "very" + "very" + "very" + "very" + "very" + "very" + + "very" + "very" + "long" + "string", None => ~"none" }; } diff --git a/src/test/pretty/match-naked-expr.rs b/src/test/pretty/match-naked-expr.rs index 15c49cd41157e..ac5ef5fcf5328 100644 --- a/src/test/pretty/match-naked-expr.rs +++ b/src/test/pretty/match-naked-expr.rs @@ -12,5 +12,5 @@ fn main() { let x = Some(3); - let y = match x { Some(_) => ~"some(_)", None => ~"none" }; + let _y = match x { Some(_) => ~"some(_)", None => ~"none" }; } diff --git a/src/test/pretty/struct-tuple.rs b/src/test/pretty/struct-tuple.rs index 0d54848a4a962..20d1678ee4153 100644 --- a/src/test/pretty/struct-tuple.rs +++ b/src/test/pretty/struct-tuple.rs @@ -5,6 +5,6 @@ struct Bar(int, int); fn main() { struct Foo2; struct Bar2(int, int, int); - let a = Bar(5, 5); - let b = Foo; + let _a = Bar(5, 5); + let _b = Foo; } diff --git a/src/test/pretty/vec-comments.pp b/src/test/pretty/vec-comments.pp index c41a4fd8e1da9..a09e341a9402f 100644 --- a/src/test/pretty/vec-comments.pp +++ b/src/test/pretty/vec-comments.pp @@ -12,7 +12,7 @@ // Testing that comments are correctly interleaved // pp-exact:vec-comments.pp fn main() { - let v1 = + let _v1 = ~[ // Comment 0, @@ -20,11 +20,11 @@ 1, // Comment 2]; - let v2 = + let _v2 = ~[0, // Comment 1, // Comment 2]; // Comment - let v3 = + let _v3 = ~[ /* Comment */ 0, @@ -32,7 +32,7 @@ 1, /* Comment */ 2]; - let v4 = + let _v4 = ~[0, /* Comment */ 1, /* Comment */ 2]; /* Comment */ diff --git a/src/test/pretty/vec-comments.rs b/src/test/pretty/vec-comments.rs index c41a4fd8e1da9..a09e341a9402f 100644 --- a/src/test/pretty/vec-comments.rs +++ b/src/test/pretty/vec-comments.rs @@ -12,7 +12,7 @@ // Testing that comments are correctly interleaved // pp-exact:vec-comments.pp fn main() { - let v1 = + let _v1 = ~[ // Comment 0, @@ -20,11 +20,11 @@ fn main() { 1, // Comment 2]; - let v2 = + let _v2 = ~[0, // Comment 1, // Comment 2]; // Comment - let v3 = + let _v3 = ~[ /* Comment */ 0, @@ -32,7 +32,7 @@ fn main() { 1, /* Comment */ 2]; - let v4 = + let _v4 = ~[0, /* Comment */ 1, /* Comment */ 2]; /* Comment */ diff --git a/src/test/pretty/vec-type.pp b/src/test/pretty/vec-type.pp index c0183bd9f2a75..d84f43d70050c 100644 --- a/src/test/pretty/vec-type.pp +++ b/src/test/pretty/vec-type.pp @@ -10,6 +10,6 @@ // pp-exact:vec-type.pp -fn f1(x: ~[int]) { } +fn f1(_x: ~[int]) { } fn g1() { f1(~[1, 2, 3]); } diff --git a/src/test/pretty/vec-type.rs b/src/test/pretty/vec-type.rs index c0183bd9f2a75..d84f43d70050c 100644 --- a/src/test/pretty/vec-type.rs +++ b/src/test/pretty/vec-type.rs @@ -10,6 +10,6 @@ // pp-exact:vec-type.pp -fn f1(x: ~[int]) { } +fn f1(_x: ~[int]) { } fn g1() { f1(~[1, 2, 3]); } diff --git a/src/test/run-fail/args-fail.rs b/src/test/run-fail/args-fail.rs index 911409b6898a3..b803d7488b073 100644 --- a/src/test/run-fail/args-fail.rs +++ b/src/test/run-fail/args-fail.rs @@ -9,6 +9,6 @@ // except according to those terms. // error-pattern:meep -fn f(a: int, b: int, c: @int) { fail!("moop"); } +fn f(_a: int, _b: int, _c: @int) { fail!("moop"); } fn main() { f(1, fail!("meep"), @42); } diff --git a/src/test/run-fail/borrowck-wg-autoderef-and-autoborrowvec-combined-fail-issue-6272.rs b/src/test/run-fail/borrowck-wg-autoderef-and-autoborrowvec-combined-fail-issue-6272.rs index 2d3e7dd616d33..6e15f6edddc89 100644 --- a/src/test/run-fail/borrowck-wg-autoderef-and-autoborrowvec-combined-fail-issue-6272.rs +++ b/src/test/run-fail/borrowck-wg-autoderef-and-autoborrowvec-combined-fail-issue-6272.rs @@ -14,7 +14,7 @@ fn main() { let c = @mut b; // this should freeze `a` only - let x: &mut [int] = c[0]; + let _x: &mut [int] = c[0]; // hence this should fail a[0] = a[0]; diff --git a/src/test/run-fail/borrowck-wg-fail-2.rs b/src/test/run-fail/borrowck-wg-fail-2.rs index 59a5fecd34003..24b928920c2b8 100644 --- a/src/test/run-fail/borrowck-wg-fail-2.rs +++ b/src/test/run-fail/borrowck-wg-fail-2.rs @@ -9,7 +9,7 @@ struct S { fn main() { let x = @mut S { x: 3 }; - let y: &S = x; + let _y: &S = x; let z = x; z.x = 5; } diff --git a/src/test/run-fail/borrowck-wg-fail-3.rs b/src/test/run-fail/borrowck-wg-fail-3.rs index a40faa1ac6fc3..8a72d2680d92f 100644 --- a/src/test/run-fail/borrowck-wg-fail-3.rs +++ b/src/test/run-fail/borrowck-wg-fail-3.rs @@ -5,7 +5,7 @@ fn main() { let x = @mut 3; - let y: &mut int = x; + let _y: &mut int = x; let z = x; *z = 5; } diff --git a/src/test/run-fail/borrowck-wg-fail-object-arg.rs b/src/test/run-fail/borrowck-wg-fail-object-arg.rs index c70d752ef3033..1456f13733872 100644 --- a/src/test/run-fail/borrowck-wg-fail-object-arg.rs +++ b/src/test/run-fail/borrowck-wg-fail-object-arg.rs @@ -10,7 +10,7 @@ impl Foo for int { } } -fn it_takes_two(f: &Foo, g: &mut Foo) { +fn it_takes_two(_f: &Foo, _g: &mut Foo) { } fn main() { diff --git a/src/test/run-fail/borrowck-wg-imm-then-mut.rs b/src/test/run-fail/borrowck-wg-imm-then-mut.rs index e2c8a0b549c36..fa82029855d70 100644 --- a/src/test/run-fail/borrowck-wg-imm-then-mut.rs +++ b/src/test/run-fail/borrowck-wg-imm-then-mut.rs @@ -14,6 +14,6 @@ fn add2(_:&mut int) pub fn main() { let a = @mut 3; - let b = &*a; // freezes a + let _b = &*a; // freezes a add1(a); } diff --git a/src/test/run-fail/borrowck-wg-mut-then-imm.rs b/src/test/run-fail/borrowck-wg-mut-then-imm.rs index 58b2a1d87beed..9d6b958711332 100644 --- a/src/test/run-fail/borrowck-wg-mut-then-imm.rs +++ b/src/test/run-fail/borrowck-wg-mut-then-imm.rs @@ -14,6 +14,6 @@ fn add2(_:&int) pub fn main() { let a = @mut 3; - let b = &mut *a; // freezes a + let _b = &mut *a; // freezes a add1(a); } diff --git a/src/test/run-fail/bug-811.rs b/src/test/run-fail/bug-811.rs index 992747187f635..2a256b9a4e384 100644 --- a/src/test/run-fail/bug-811.rs +++ b/src/test/run-fail/bug-811.rs @@ -19,6 +19,6 @@ struct chan_t { port: port_id, } -fn send(ch: chan_t, data: T) { fail!(); } +fn send(_ch: chan_t, _data: T) { fail!(); } fn main() { fail!("quux"); } diff --git a/src/test/run-fail/die-macro-expr.rs b/src/test/run-fail/die-macro-expr.rs index cf6f5a009d530..8ff62d5a43d10 100644 --- a/src/test/run-fail/die-macro-expr.rs +++ b/src/test/run-fail/die-macro-expr.rs @@ -1,5 +1,5 @@ // error-pattern:test fn main() { - let i: int = fail!("test"); + let _i: int = fail!("test"); } diff --git a/src/test/run-fail/divide-by-zero.rs b/src/test/run-fail/divide-by-zero.rs index 9c996807ad866..de69b7b9fa670 100644 --- a/src/test/run-fail/divide-by-zero.rs +++ b/src/test/run-fail/divide-by-zero.rs @@ -11,5 +11,5 @@ // error-pattern:attempted to divide by zero fn main() { let y = 0; - let z = 1 / y; + let _z = 1 / y; } diff --git a/src/test/run-fail/doublefail.rs b/src/test/run-fail/doublefail.rs index ccf7aa5701908..1ceeee1b6ed11 100644 --- a/src/test/run-fail/doublefail.rs +++ b/src/test/run-fail/doublefail.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#[allow(unreachable_code)]; + //error-pattern:One fn main() { fail!("One"); diff --git a/src/test/run-fail/explicit-fail-msg.rs b/src/test/run-fail/explicit-fail-msg.rs index 28fd9aff009b7..ab8cea0a3051a 100644 --- a/src/test/run-fail/explicit-fail-msg.rs +++ b/src/test/run-fail/explicit-fail-msg.rs @@ -8,7 +8,12 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#[allow(dead_assignment)]; +#[allow(unused_variable)]; + // error-pattern:wooooo fn main() { - let mut a = 1; if 1 == 1 { a = 2; } fail!(~"woooo" + "o"); + let mut a = 1; + if 1 == 1 { a = 2; } + fail!(~"woooo" + "o"); } diff --git a/src/test/run-fail/expr-if-fail.rs b/src/test/run-fail/expr-if-fail.rs index c1663866519b7..73259e6e140f5 100644 --- a/src/test/run-fail/expr-if-fail.rs +++ b/src/test/run-fail/expr-if-fail.rs @@ -12,4 +12,4 @@ // error-pattern:explicit failure -fn main() { let x = if false { 0 } else if true { fail!() } else { 10 }; } +fn main() { let _x = if false { 0 } else if true { fail!() } else { 10 }; } diff --git a/src/test/run-fail/expr-match-fail.rs b/src/test/run-fail/expr-match-fail.rs index e2bf6052a1038..075f6f5b4b190 100644 --- a/src/test/run-fail/expr-match-fail.rs +++ b/src/test/run-fail/expr-match-fail.rs @@ -12,4 +12,4 @@ // error-pattern:explicit failure -fn main() { let x = match true { false => { 0 } true => { fail!() } }; } +fn main() { let _x = match true { false => { 0 } true => { fail!() } }; } diff --git a/src/test/run-fail/issue-2156.rs b/src/test/run-fail/issue-2156.rs index 0e0bd81d659ac..863663334f8ed 100644 --- a/src/test/run-fail/issue-2156.rs +++ b/src/test/run-fail/issue-2156.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#[allow(unnecessary_allocation)]; + // error-pattern:explicit failure // Don't double free the string extern mod extra; diff --git a/src/test/run-fail/issue-2444.rs b/src/test/run-fail/issue-2444.rs index 5e7c7cf519b05..c1357988f7db5 100644 --- a/src/test/run-fail/issue-2444.rs +++ b/src/test/run-fail/issue-2444.rs @@ -18,5 +18,5 @@ enum e { e(arc::Arc) } fn foo() -> e {fail!();} fn main() { - let f = foo(); + let _f = foo(); } diff --git a/src/test/run-fail/issue-3029.rs b/src/test/run-fail/issue-3029.rs index caee00027883a..44364007c067e 100644 --- a/src/test/run-fail/issue-3029.rs +++ b/src/test/run-fail/issue-3029.rs @@ -8,6 +8,10 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#[allow(unnecessary_allocation)]; +#[allow(unreachable_code)]; +#[allow(unused_variable)]; + // error-pattern:so long fn main() { let mut x = ~[]; diff --git a/src/test/run-fail/issue-948.rs b/src/test/run-fail/issue-948.rs index 1ad4422e1a943..db954bc59466a 100644 --- a/src/test/run-fail/issue-948.rs +++ b/src/test/run-fail/issue-948.rs @@ -10,6 +10,8 @@ // error-pattern:beep boop +#[allow(unused_variable)]; + struct Point { x: int, y: int } fn main() { diff --git a/src/test/run-fail/match-bot-fail.rs b/src/test/run-fail/match-bot-fail.rs index 2ba78e21374ea..a54422ef8f535 100644 --- a/src/test/run-fail/match-bot-fail.rs +++ b/src/test/run-fail/match-bot-fail.rs @@ -10,6 +10,9 @@ // error-pattern:explicit failure +#[allow(unreachable_code)]; +#[allow(unused_variable)]; + fn foo(s: ~str) { } fn main() { diff --git a/src/test/run-fail/mod-zero.rs b/src/test/run-fail/mod-zero.rs index b3e083c77fb23..76d4de7ecb03c 100644 --- a/src/test/run-fail/mod-zero.rs +++ b/src/test/run-fail/mod-zero.rs @@ -11,5 +11,5 @@ // error-pattern:attempted remainder with a divisor of zero fn main() { let y = 0; - let z = 1 % y; + let _z = 1 % y; } diff --git a/src/test/run-fail/rhs-type.rs b/src/test/run-fail/rhs-type.rs index 444c899188fad..ca267608025c3 100644 --- a/src/test/run-fail/rhs-type.rs +++ b/src/test/run-fail/rhs-type.rs @@ -12,6 +12,12 @@ // as a _|_-typed thing, not a str-typed thing // error-pattern:bye +#[allow(unreachable_code)]; +#[allow(unused_variable)]; + struct T { t: ~str } -fn main() { let pth = fail!("bye"); let rs: T = T {t: pth}; } +fn main() { + let pth = fail!("bye"); + let _rs: T = T {t: pth}; +} diff --git a/src/test/run-fail/rt-set-exit-status-fail2.rs b/src/test/run-fail/rt-set-exit-status-fail2.rs index ee268f409a5e9..d78dedfa39dc0 100644 --- a/src/test/run-fail/rt-set-exit-status-fail2.rs +++ b/src/test/run-fail/rt-set-exit-status-fail2.rs @@ -35,7 +35,7 @@ fn r(x:int) -> r { fn main() { error!(~"whatever"); do task::spawn { - let i = r(5); + let _i = r(5); }; fail!(); } diff --git a/src/test/run-fail/task-spawn-barefn.rs b/src/test/run-fail/task-spawn-barefn.rs index 6e1af6ff7e095..75b50c4f6ed6f 100644 --- a/src/test/run-fail/task-spawn-barefn.rs +++ b/src/test/run-fail/task-spawn-barefn.rs @@ -10,7 +10,6 @@ // error-pattern:Ensure that the child task runs by failing -use std::str; use std::task; fn main() { diff --git a/src/test/run-fail/unwind-assert.rs b/src/test/run-fail/unwind-assert.rs index 0e685a7a4693d..36954d2bad67e 100644 --- a/src/test/run-fail/unwind-assert.rs +++ b/src/test/run-fail/unwind-assert.rs @@ -11,6 +11,6 @@ // error-pattern:fail fn main() { - let a = @0; + let _a = @0; assert!(false); } diff --git a/src/test/run-fail/unwind-closure.rs b/src/test/run-fail/unwind-closure.rs index b84ae2e94fcea..5ea71c94e1468 100644 --- a/src/test/run-fail/unwind-closure.rs +++ b/src/test/run-fail/unwind-closure.rs @@ -10,7 +10,7 @@ // error-pattern:fail -fn f(a: @int) { +fn f(_a: @int) { fail!(); } diff --git a/src/test/run-fail/unwind-initializer-indirect.rs b/src/test/run-fail/unwind-initializer-indirect.rs index e7f8a86654310..fd1ab88ff9647 100644 --- a/src/test/run-fail/unwind-initializer-indirect.rs +++ b/src/test/run-fail/unwind-initializer-indirect.rs @@ -13,5 +13,5 @@ fn f() -> @int { fail!(); } fn main() { - let a: @int = f(); + let _a: @int = f(); } diff --git a/src/test/run-fail/unwind-initializer.rs b/src/test/run-fail/unwind-initializer.rs index 0293e5ba07e59..0d1584f3dc8db 100644 --- a/src/test/run-fail/unwind-initializer.rs +++ b/src/test/run-fail/unwind-initializer.rs @@ -11,7 +11,7 @@ // error-pattern:fail fn main() { - let a: @int = { + let _a: @int = { fail!(); }; } diff --git a/src/test/run-fail/unwind-interleaved.rs b/src/test/run-fail/unwind-interleaved.rs index 142813bcc30b7..365204d5c9e4d 100644 --- a/src/test/run-fail/unwind-interleaved.rs +++ b/src/test/run-fail/unwind-interleaved.rs @@ -15,8 +15,8 @@ fn a() { } fn b() { fail!(); } fn main() { - let x = ~[0]; + let _x = ~[0]; a(); - let y = ~[0]; + let _y = ~[0]; b(); } diff --git a/src/test/run-fail/unwind-iter.rs b/src/test/run-fail/unwind-iter.rs index 1b28d2f6c6d63..51c6cb3adf318 100644 --- a/src/test/run-fail/unwind-iter.rs +++ b/src/test/run-fail/unwind-iter.rs @@ -10,6 +10,9 @@ // error-pattern:fail +#[allow(unreachable_code)]; +#[allow(unused_variable)]; + fn x(it: &fn(int)) { fail!(); it(0); diff --git a/src/test/run-fail/unwind-iter2.rs b/src/test/run-fail/unwind-iter2.rs index 286e5f4976430..17936df6959f2 100644 --- a/src/test/run-fail/unwind-iter2.rs +++ b/src/test/run-fail/unwind-iter2.rs @@ -11,7 +11,7 @@ // error-pattern:fail fn x(it: &fn(int)) { - let a = @0; + let _a = @0; it(1); } diff --git a/src/test/run-fail/unwind-lambda.rs b/src/test/run-fail/unwind-lambda.rs index 640be6635ee29..74d6ab00802e0 100644 --- a/src/test/run-fail/unwind-lambda.rs +++ b/src/test/run-fail/unwind-lambda.rs @@ -21,7 +21,7 @@ fn main() { let mush = food + cheese; let cheese = cheese.clone(); let f: &fn() = || { - let chew = mush + cheese; + let _chew = mush + cheese; fail!("so yummy") }; f(); diff --git a/src/test/run-fail/unwind-misc-1.rs b/src/test/run-fail/unwind-misc-1.rs index 336c2d3c8ea70..d215927c7d03f 100644 --- a/src/test/run-fail/unwind-misc-1.rs +++ b/src/test/run-fail/unwind-misc-1.rs @@ -12,10 +12,10 @@ // error-pattern:fail fn main() { - let count = @mut 0u; + let _count = @mut 0u; let mut map = std::hashmap::HashMap::new(); let mut arr = ~[]; - for i in range(0u, 10u) { + for _i in range(0u, 10u) { arr.push(@~"key stuff"); map.insert(arr.clone(), arr + &[@~"value stuff"]); if arr.len() == 5 { diff --git a/src/test/run-fail/unwind-nested.rs b/src/test/run-fail/unwind-nested.rs index ca9a761cfa1e1..f8a63be2e9ad0 100644 --- a/src/test/run-fail/unwind-nested.rs +++ b/src/test/run-fail/unwind-nested.rs @@ -11,9 +11,9 @@ // error-pattern:fail fn main() { - let a = @0; + let _a = @0; { - let b = @0; + let _b = @0; { fail!(); } diff --git a/src/test/run-fail/unwind-partial-box.rs b/src/test/run-fail/unwind-partial-box.rs index d1e3b63698bc5..88f71a5ed7cea 100644 --- a/src/test/run-fail/unwind-partial-box.rs +++ b/src/test/run-fail/unwind-partial-box.rs @@ -19,7 +19,7 @@ fn prime() { } fn partial() { - let x = @f(); + let _x = @f(); } fn main() { diff --git a/src/test/run-fail/unwind-partial-unique.rs b/src/test/run-fail/unwind-partial-unique.rs index 5976add8800a4..e9bbbd46c03ff 100644 --- a/src/test/run-fail/unwind-partial-unique.rs +++ b/src/test/run-fail/unwind-partial-unique.rs @@ -19,7 +19,7 @@ fn prime() { } fn partial() { - let x = ~f(); + let _x = ~f(); } fn main() { diff --git a/src/test/run-fail/unwind-partial-vec.rs b/src/test/run-fail/unwind-partial-vec.rs index d51c83a06d9c0..3d6d26937dbac 100644 --- a/src/test/run-fail/unwind-partial-vec.rs +++ b/src/test/run-fail/unwind-partial-vec.rs @@ -19,7 +19,7 @@ fn prime() { } fn partial() { - let x = ~[~[0], f(), ~[0]]; + let _x = ~[~[0], f(), ~[0]]; } fn main() { diff --git a/src/test/run-fail/unwind-rec.rs b/src/test/run-fail/unwind-rec.rs index 378816476e4dd..016654500b4ac 100644 --- a/src/test/run-fail/unwind-rec.rs +++ b/src/test/run-fail/unwind-rec.rs @@ -17,7 +17,7 @@ fn build() -> ~[int] { struct Blk { node: ~[int] } fn main() { - let blk = Blk { + let _blk = Blk { node: build() }; } diff --git a/src/test/run-fail/unwind-rec2.rs b/src/test/run-fail/unwind-rec2.rs index 1abf6d53600b9..49a35181a8b2e 100644 --- a/src/test/run-fail/unwind-rec2.rs +++ b/src/test/run-fail/unwind-rec2.rs @@ -21,7 +21,7 @@ fn build2() -> ~[int] { struct Blk { node: ~[int], span: ~[int] } fn main() { - let blk = Blk { + let _blk = Blk { node: build1(), span: build2() }; diff --git a/src/test/run-fail/unwind-resource-fail.rs b/src/test/run-fail/unwind-resource-fail.rs index b4b0150013a50..d695caf7b5f97 100644 --- a/src/test/run-fail/unwind-resource-fail.rs +++ b/src/test/run-fail/unwind-resource-fail.rs @@ -22,5 +22,5 @@ fn r(i: int) -> r { r { i: i } } fn main() { @0; - let r = r(0); + let _r = r(0); } diff --git a/src/test/run-fail/unwind-stacked.rs b/src/test/run-fail/unwind-stacked.rs index a8faa550c8fbe..8249807af74ad 100644 --- a/src/test/run-fail/unwind-stacked.rs +++ b/src/test/run-fail/unwind-stacked.rs @@ -11,16 +11,16 @@ // error-pattern:fail fn f() { - let a = @0; + let _a = @0; fail!(); } fn g() { - let b = @0; + let _b = @0; f(); } fn main() { - let a = @0; + let _a = @0; g(); } diff --git a/src/test/run-fail/unwind-tup.rs b/src/test/run-fail/unwind-tup.rs index b135b9f609b88..15fa3ceed5356 100644 --- a/src/test/run-fail/unwind-tup.rs +++ b/src/test/run-fail/unwind-tup.rs @@ -15,5 +15,5 @@ fn fold_local() -> @~[int]{ } fn main() { - let lss = (fold_local(), 0); + let _lss = (fold_local(), 0); } diff --git a/src/test/run-fail/unwind-tup2.rs b/src/test/run-fail/unwind-tup2.rs index 5e299c52a2905..236ff8172207b 100644 --- a/src/test/run-fail/unwind-tup2.rs +++ b/src/test/run-fail/unwind-tup2.rs @@ -19,5 +19,5 @@ fn fold_remote() -> @~[int]{ } fn main() { - let lss = (fold_local(), fold_remote()); + let _lss = (fold_local(), fold_remote()); } diff --git a/src/test/run-fail/unwind-uninitialized.rs b/src/test/run-fail/unwind-uninitialized.rs index e45c5c94ed4b1..d5a06ffb9036b 100644 --- a/src/test/run-fail/unwind-uninitialized.rs +++ b/src/test/run-fail/unwind-uninitialized.rs @@ -16,5 +16,5 @@ fn f() { fn main() { f(); - let a = @0; + let _a = @0; } diff --git a/src/test/run-fail/while-body-fails.rs b/src/test/run-fail/while-body-fails.rs index 836ed9c015586..32e1425b28c8a 100644 --- a/src/test/run-fail/while-body-fails.rs +++ b/src/test/run-fail/while-body-fails.rs @@ -8,5 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#[allow(while_true)]; + // error-pattern:quux -fn main() { let x: int = { while true { fail!("quux"); } ; 8 } ; } +fn main() { let _x: int = { while true { fail!("quux"); } ; 8 } ; } diff --git a/src/test/run-fail/while-fail.rs b/src/test/run-fail/while-fail.rs index db04026ed9739..a0b437814fd8d 100644 --- a/src/test/run-fail/while-fail.rs +++ b/src/test/run-fail/while-fail.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#[allow(while_true)]; + // error-pattern:giraffe fn main() { fail!({ while true { fail!("giraffe") }; "clandestine" }); diff --git a/src/test/run-pass/argument-passing.rs b/src/test/run-pass/argument-passing.rs index 90a1762519573..6d6ae3da62fef 100644 --- a/src/test/run-pass/argument-passing.rs +++ b/src/test/run-pass/argument-passing.rs @@ -26,10 +26,10 @@ fn f2(a: int, f: &fn(int)) -> int { f(1); return a; } pub fn main() { let mut a = X {x: 1}; let mut b = 2; - let mut c = 3; + let c = 3; assert_eq!(f1(&mut a, &mut b, c), 6); assert_eq!(a.x, 0); assert_eq!(b, 10); - assert_eq!(f2(a.x, |x| a.x = 50), 0); + assert_eq!(f2(a.x, |_| a.x = 50), 0); assert_eq!(a.x, 50); } diff --git a/src/test/run-pass/arith-unsigned.rs b/src/test/run-pass/arith-unsigned.rs index 0eb4e7ad92e78..ae94ad379d012 100644 --- a/src/test/run-pass/arith-unsigned.rs +++ b/src/test/run-pass/arith-unsigned.rs @@ -8,8 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. - - +#[allow(type_limits)]; // Unsigned integer operations pub fn main() { diff --git a/src/test/run-pass/assign-assign.rs b/src/test/run-pass/assign-assign.rs index 5fe2aa6cc7c0e..0f5d27015fb74 100644 --- a/src/test/run-pass/assign-assign.rs +++ b/src/test/run-pass/assign-assign.rs @@ -11,22 +11,28 @@ // Issue 483 - Assignment expressions result in nil fn test_assign() { let mut x: int; - let mut y: () = x = 10; + let y: () = x = 10; assert_eq!(x, 10); + assert_eq!(y, ()); let mut z = x = 11; assert_eq!(x, 11); + assert_eq!(z, ()); z = x = 12; assert_eq!(x, 12); + assert_eq!(z, ()); } fn test_assign_op() { let mut x: int = 0; - let mut y: () = x += 10; + let y: () = x += 10; assert_eq!(x, 10); + assert_eq!(y, ()); let mut z = x += 11; assert_eq!(x, 21); + assert_eq!(z, ()); z = x += 12; assert_eq!(x, 33); + assert_eq!(z, ()); } pub fn main() { test_assign(); test_assign_op(); } diff --git a/src/test/run-pass/attr-start.rs b/src/test/run-pass/attr-start.rs index 933405bfc448d..ba54e92ef9978 100644 --- a/src/test/run-pass/attr-start.rs +++ b/src/test/run-pass/attr-start.rs @@ -11,6 +11,6 @@ //xfail-fast #[start] -fn start(argc:int, argv: **u8, crate_map: *u8) -> int { +fn start(_argc: int, _argv: **u8, _crate_map: *u8) -> int { return 0; } diff --git a/src/test/run-pass/bind-by-move.rs b/src/test/run-pass/bind-by-move.rs index 9d808d19af2e9..a7a4aa9885e6e 100644 --- a/src/test/run-pass/bind-by-move.rs +++ b/src/test/run-pass/bind-by-move.rs @@ -11,7 +11,7 @@ // xfail-fast extern mod extra; use extra::arc; -fn dispose(_x: arc::Arc) { unsafe { } } +fn dispose(_x: arc::Arc) { } pub fn main() { let p = arc::Arc::new(true); diff --git a/src/test/run-pass/binops.rs b/src/test/run-pass/binops.rs index 4bfdb20d9f2b9..eb0f04b8b7da1 100644 --- a/src/test/run-pass/binops.rs +++ b/src/test/run-pass/binops.rs @@ -10,8 +10,6 @@ // Binop corner cases -use std::libc; - fn test_nil() { assert_eq!((), ()); assert!((!(() != ()))); @@ -95,7 +93,7 @@ fn p(x: int, y: int) -> p { } fn test_class() { - let mut q = p(1, 2); + let q = p(1, 2); let mut r = p(1, 2); unsafe { diff --git a/src/test/run-pass/block-arg-in-parentheses.rs b/src/test/run-pass/block-arg-in-parentheses.rs index 4bff3c6bb64e6..fcd6a8d7c85e5 100644 --- a/src/test/run-pass/block-arg-in-parentheses.rs +++ b/src/test/run-pass/block-arg-in-parentheses.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::vec; - fn w_semi(v: ~[int]) -> int { // the semicolon causes compiler not to // complain about the ignored return value: diff --git a/src/test/run-pass/block-arg.rs b/src/test/run-pass/block-arg.rs index aabc005c57fb3..717093e9de704 100644 --- a/src/test/run-pass/block-arg.rs +++ b/src/test/run-pass/block-arg.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::vec; - // Check usage and precedence of block arguments in expressions: pub fn main() { let v = ~[-1f, 0f, 1f, 2f, 3f]; diff --git a/src/test/run-pass/borrowck-mut-uniq.rs b/src/test/run-pass/borrowck-mut-uniq.rs index 20c9032fbd294..633e0f71b9e0b 100644 --- a/src/test/run-pass/borrowck-mut-uniq.rs +++ b/src/test/run-pass/borrowck-mut-uniq.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::uint; use std::util; struct Ints {sum: ~int, values: ~[int]} diff --git a/src/test/run-pass/borrowck-pat-reassign-no-binding.rs b/src/test/run-pass/borrowck-pat-reassign-no-binding.rs index d7551f792f3b7..4ccbf6b5b0fed 100644 --- a/src/test/run-pass/borrowck-pat-reassign-no-binding.rs +++ b/src/test/run-pass/borrowck-pat-reassign-no-binding.rs @@ -18,4 +18,5 @@ pub fn main() { } Some(_) => { } } + assert_eq!(x, Some(0)); } diff --git a/src/test/run-pass/borrowck-preserve-box-in-arm-not-taken.rs b/src/test/run-pass/borrowck-preserve-box-in-arm-not-taken.rs index 47bc6344bc271..a8e14b5297ff1 100644 --- a/src/test/run-pass/borrowck-preserve-box-in-arm-not-taken.rs +++ b/src/test/run-pass/borrowck-preserve-box-in-arm-not-taken.rs @@ -13,9 +13,9 @@ pub fn main() { let x: @mut @Option<~int> = @mut @None; match x { - @@Some(ref y) => { + @@Some(ref _y) => { // here, the refcount of `*x` is bumped so - // `y` remains valid even if `*x` is modified. + // `_y` remains valid even if `*x` is modified. *x = @None; } @@None => { diff --git a/src/test/run-pass/borrowck-preserve-box-in-pat.rs b/src/test/run-pass/borrowck-preserve-box-in-pat.rs index 8fad933281118..c53b4b4e747d5 100644 --- a/src/test/run-pass/borrowck-preserve-box-in-pat.rs +++ b/src/test/run-pass/borrowck-preserve-box-in-pat.rs @@ -15,7 +15,7 @@ use std::ptr; struct F { f: ~int } pub fn main() { - let mut x = @mut @F {f: ~3}; + let x = @mut @F {f: ~3}; match x { @@F{f: ref b_x} => { assert_eq!(**b_x, 3); diff --git a/src/test/run-pass/borrowck-preserve-box-sometimes-needed.rs b/src/test/run-pass/borrowck-preserve-box-sometimes-needed.rs index e3f8f98f4b6b1..3f3534ca43e27 100644 --- a/src/test/run-pass/borrowck-preserve-box-sometimes-needed.rs +++ b/src/test/run-pass/borrowck-preserve-box-sometimes-needed.rs @@ -13,9 +13,10 @@ fn switcher(x: Option<@int>) { let mut x = x; match x { - Some(@y) => { y.clone(); x = None; } - None => { } + Some(@y) => { y.clone(); x = None; } + None => { } } + assert_eq!(x, None); } pub fn main() { diff --git a/src/test/run-pass/borrowck-preserve-cond-box.rs b/src/test/run-pass/borrowck-preserve-cond-box.rs index e5cef1dbc0599..dc3718275fce9 100644 --- a/src/test/run-pass/borrowck-preserve-cond-box.rs +++ b/src/test/run-pass/borrowck-preserve-cond-box.rs @@ -15,8 +15,8 @@ fn testfn(cond: bool) { let mut y = @4; // borrow x and y - let mut r_x = &*x; - let mut r_y = &*y; + let r_x = &*x; + let r_y = &*y; let mut r = r_x; let mut exp = 3; @@ -33,6 +33,8 @@ fn testfn(cond: bool) { info!("*r = %d, exp = %d", *r, exp); assert_eq!(*r, exp); + assert_eq!(x, @5); + assert_eq!(y, @6); } pub fn main() { diff --git a/src/test/run-pass/box-in-tup.rs b/src/test/run-pass/box-in-tup.rs index 22857aaefec5a..315b69f3f2752 100644 --- a/src/test/run-pass/box-in-tup.rs +++ b/src/test/run-pass/box-in-tup.rs @@ -8,4 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -pub fn main() { let i: (@int, int) = (@10, 10); let (a, _) = i; } +pub fn main() { + let i: (@int, int) = (@10, 10); + let (_a, _) = i; +} diff --git a/src/test/run-pass/box-inside-if.rs b/src/test/run-pass/box-inside-if.rs index e9838ec17aeeb..ea2b7d58a1112 100644 --- a/src/test/run-pass/box-inside-if.rs +++ b/src/test/run-pass/box-inside-if.rs @@ -14,11 +14,11 @@ fn some_box(x: int) -> @int { return @x; } -fn is_odd(n: int) -> bool { return true; } +fn is_odd(_n: int) -> bool { return true; } -fn length_is_even(vs: @int) -> bool { return true; } +fn length_is_even(_vs: @int) -> bool { return true; } -fn foo(acc: int, n: int) { +fn foo(_acc: int, n: int) { if is_odd(n) && length_is_even(some_box(1)) { error!("bloop"); } } diff --git a/src/test/run-pass/box-inside-if2.rs b/src/test/run-pass/box-inside-if2.rs index bcadc69bb0a2e..53b4684706091 100644 --- a/src/test/run-pass/box-inside-if2.rs +++ b/src/test/run-pass/box-inside-if2.rs @@ -14,11 +14,11 @@ fn some_box(x: int) -> @int { return @x; } -fn is_odd(n: int) -> bool { return true; } +fn is_odd(_n: int) -> bool { return true; } -fn length_is_even(vs: @int) -> bool { return true; } +fn length_is_even(_vs: @int) -> bool { return true; } -fn foo(acc: int, n: int) { +fn foo(_acc: int, n: int) { if is_odd(n) || length_is_even(some_box(1)) { error!("bloop"); } } diff --git a/src/test/run-pass/break.rs b/src/test/run-pass/break.rs index aff4b7bd26e05..5903e42146500 100644 --- a/src/test/run-pass/break.rs +++ b/src/test/run-pass/break.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::vec; - pub fn main() { let mut i = 0; while i < 20 { i += 1; if i == 10 { break; } } diff --git a/src/test/run-pass/c-stack-as-value.rs b/src/test/run-pass/c-stack-as-value.rs index 85e22cfecb428..ac7b221cff81c 100644 --- a/src/test/run-pass/c-stack-as-value.rs +++ b/src/test/run-pass/c-stack-as-value.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::libc; - mod rustrt { use std::libc; @@ -20,7 +18,5 @@ mod rustrt { } pub fn main() { - unsafe { - let _foo = rustrt::rust_get_test_int; - } + let _foo = rustrt::rust_get_test_int; } diff --git a/src/test/run-pass/c-stack-returning-int64.rs b/src/test/run-pass/c-stack-returning-int64.rs index 22c5e9dad25a4..a0276e7e564fc 100644 --- a/src/test/run-pass/c-stack-returning-int64.rs +++ b/src/test/run-pass/c-stack-returning-int64.rs @@ -8,29 +8,26 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::str; - mod libc { + use std::libc::{c_char, c_long, c_longlong}; + #[abi = "cdecl"] #[nolink] extern { - pub fn atol(x: *u8) -> int; - pub fn atoll(x: *u8) -> i64; + pub fn atol(x: *c_char) -> c_long; + pub fn atoll(x: *c_char) -> c_longlong; } } fn atol(s: ~str) -> int { - s.with_c_str(|x| unsafe { libc::atol(x as *u8) }) + s.with_c_str(|x| unsafe { libc::atol(x) as int }) } fn atoll(s: ~str) -> i64 { - s.with_c_str(|x| unsafe { libc::atoll(x as *u8) }) + s.with_c_str(|x| unsafe { libc::atoll(x) as i64 }) } pub fn main() { - unsafe { - assert_eq!(atol(~"1024") * 10, atol(~"10240")); - assert!((atoll(~"11111111111111111") * 10i64) - == atoll(~"111111111111111110")); - } + assert_eq!(atol(~"1024") * 10, atol(~"10240")); + assert!((atoll(~"11111111111111111") * 10) == atoll(~"111111111111111110")); } diff --git a/src/test/run-pass/capture_nil.rs b/src/test/run-pass/capture_nil.rs index 6182ec79a3ba9..edd1a9cce65b4 100644 --- a/src/test/run-pass/capture_nil.rs +++ b/src/test/run-pass/capture_nil.rs @@ -24,7 +24,6 @@ // course preferable, as the value itself is // irrelevant). -use std::comm::*; use std::task; fn foo(x: ()) -> Port<()> { diff --git a/src/test/run-pass/cci_iter_exe.rs b/src/test/run-pass/cci_iter_exe.rs index 4db0b1871d078..50afcac4e3ab3 100644 --- a/src/test/run-pass/cci_iter_exe.rs +++ b/src/test/run-pass/cci_iter_exe.rs @@ -16,7 +16,7 @@ extern mod cci_iter_lib; pub fn main() { //let bt0 = sys::rusti::frame_address(1u32); //info!("%?", bt0); - do cci_iter_lib::iter(~[1, 2, 3]) |i| { + do cci_iter_lib::iter([1, 2, 3]) |i| { printf!("%d", *i); //assert!(bt0 == sys::rusti::frame_address(2u32)); } diff --git a/src/test/run-pass/child-outlives-parent.rs b/src/test/run-pass/child-outlives-parent.rs index 9232547dd8bd5..233a43188468f 100644 --- a/src/test/run-pass/child-outlives-parent.rs +++ b/src/test/run-pass/child-outlives-parent.rs @@ -12,8 +12,8 @@ use std::task; -fn child2(s: ~str) { } +fn child2(_s: ~str) { } pub fn main() { - let x = task::spawn(|| child2(~"hi")); + let _x = task::spawn(|| child2(~"hi")); } diff --git a/src/test/run-pass/class-cast-to-trait-multiple-types.rs b/src/test/run-pass/class-cast-to-trait-multiple-types.rs index a134ffe49fd02..dd63d96907760 100644 --- a/src/test/run-pass/class-cast-to-trait-multiple-types.rs +++ b/src/test/run-pass/class-cast-to-trait-multiple-types.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::uint; - trait noisy { fn speak(&self) -> int; } @@ -83,7 +81,7 @@ fn cat(in_x : uint, in_y : int, in_name: ~str) -> cat { fn annoy_neighbors(critter: @noisy) { - for i in range(0u, 10) { critter.speak(); } + for _i in range(0u, 10) { critter.speak(); } } pub fn main() { diff --git a/src/test/run-pass/class-impl-very-parameterized-trait.rs b/src/test/run-pass/class-impl-very-parameterized-trait.rs index d42c57c3b81a0..01907da38ad9d 100644 --- a/src/test/run-pass/class-impl-very-parameterized-trait.rs +++ b/src/test/run-pass/class-impl-very-parameterized-trait.rs @@ -11,8 +11,6 @@ // xfail-fast use std::cmp; -use std::int; -use std::uint; enum cat_type { tuxedo, tabby, tortoiseshell } diff --git a/src/test/run-pass/class-implement-trait-cross-crate.rs b/src/test/run-pass/class-implement-trait-cross-crate.rs index d4e1d438c9442..9443904b46d21 100644 --- a/src/test/run-pass/class-implement-trait-cross-crate.rs +++ b/src/test/run-pass/class-implement-trait-cross-crate.rs @@ -13,8 +13,6 @@ extern mod cci_class_trait; use cci_class_trait::animals::*; -use std::uint; - struct cat { priv meows: uint, diff --git a/src/test/run-pass/class-implement-traits.rs b/src/test/run-pass/class-implement-traits.rs index a064ce6769b82..433d7f7a22ff4 100644 --- a/src/test/run-pass/class-implement-traits.rs +++ b/src/test/run-pass/class-implement-traits.rs @@ -10,8 +10,6 @@ // xfail-fast -use std::uint; - trait noisy { fn speak(&mut self); } diff --git a/src/test/run-pass/class-methods-cross-crate.rs b/src/test/run-pass/class-methods-cross-crate.rs index c5e37cab2b84a..159a100e61aaf 100644 --- a/src/test/run-pass/class-methods-cross-crate.rs +++ b/src/test/run-pass/class-methods-cross-crate.rs @@ -15,7 +15,7 @@ use cci_class_3::kitties::*; pub fn main() { let mut nyan : cat = cat(52u, 99); - let mut kitty = cat(1000u, 2); + let kitty = cat(1000u, 2); assert_eq!(nyan.how_hungry, 99); assert_eq!(kitty.how_hungry, 2); nyan.speak(); diff --git a/src/test/run-pass/class-methods.rs b/src/test/run-pass/class-methods.rs index fca128b9a9735..f5fa72e4ce510 100644 --- a/src/test/run-pass/class-methods.rs +++ b/src/test/run-pass/class-methods.rs @@ -28,7 +28,7 @@ fn cat(in_x: uint, in_y: int) -> cat { pub fn main() { let mut nyan: cat = cat(52u, 99); - let mut kitty = cat(1000u, 2); + let kitty = cat(1000u, 2); assert_eq!(nyan.how_hungry, 99); assert_eq!(kitty.how_hungry, 2); nyan.speak(); diff --git a/src/test/run-pass/class-separate-impl.rs b/src/test/run-pass/class-separate-impl.rs index fcce5a73cf853..5555125a03b22 100644 --- a/src/test/run-pass/class-separate-impl.rs +++ b/src/test/run-pass/class-separate-impl.rs @@ -52,10 +52,7 @@ fn cat(in_x : uint, in_y : int, in_name: ~str) -> cat { impl ToStr for cat { fn to_str(&self) -> ~str { - // FIXME #5384: this unsafe block is to work around purity - unsafe { - self.name.clone() - } + self.name.clone() } } @@ -66,6 +63,6 @@ fn print_out(thing: @ToStr, expected: ~str) { } pub fn main() { - let mut nyan : @ToStr = @cat(0u, 2, ~"nyan") as @ToStr; + let nyan : @ToStr = @cat(0u, 2, ~"nyan") as @ToStr; print_out(nyan, ~"nyan"); } diff --git a/src/test/run-pass/class-str-field.rs b/src/test/run-pass/class-str-field.rs index db70d6e3b362c..452242dd082af 100644 --- a/src/test/run-pass/class-str-field.rs +++ b/src/test/run-pass/class-str-field.rs @@ -21,5 +21,5 @@ fn cat(in_name: ~str) -> cat { } pub fn main() { - let nyan = cat(~"nyan"); + let _nyan = cat(~"nyan"); } diff --git a/src/test/run-pass/class-typarams.rs b/src/test/run-pass/class-typarams.rs index 8533add411949..ab6a8b1597bf6 100644 --- a/src/test/run-pass/class-typarams.rs +++ b/src/test/run-pass/class-typarams.rs @@ -28,6 +28,6 @@ fn cat(in_x : uint, in_y : int) -> cat { pub fn main() { - let mut _nyan : cat = cat::(52u, 99); + let _nyan : cat = cat::(52u, 99); // let mut kitty = cat(1000u, 2); } diff --git a/src/test/run-pass/classes-cross-crate.rs b/src/test/run-pass/classes-cross-crate.rs index e7848f3b960e4..4c7823b4107a0 100644 --- a/src/test/run-pass/classes-cross-crate.rs +++ b/src/test/run-pass/classes-cross-crate.rs @@ -13,8 +13,6 @@ extern mod cci_class_4; use cci_class_4::kitties::*; -use std::uint; - pub fn main() { let mut nyan = cat(0u, 2, ~"nyan"); nyan.eat(); diff --git a/src/test/run-pass/classes-simple-method.rs b/src/test/run-pass/classes-simple-method.rs index f27738cf4216e..6e08a4db14e94 100644 --- a/src/test/run-pass/classes-simple-method.rs +++ b/src/test/run-pass/classes-simple-method.rs @@ -27,7 +27,7 @@ fn cat(in_x : uint, in_y : int) -> cat { pub fn main() { let mut nyan : cat = cat(52u, 99); - let mut kitty = cat(1000u, 2); + let kitty = cat(1000u, 2); assert_eq!(nyan.how_hungry, 99); assert_eq!(kitty.how_hungry, 2); nyan.speak(); diff --git a/src/test/run-pass/classes-simple.rs b/src/test/run-pass/classes-simple.rs index 3d2b08d7a851d..49e8f5c04e36a 100644 --- a/src/test/run-pass/classes-simple.rs +++ b/src/test/run-pass/classes-simple.rs @@ -22,8 +22,8 @@ fn cat(in_x : uint, in_y : int) -> cat { } pub fn main() { - let mut nyan : cat = cat(52u, 99); - let mut kitty = cat(1000u, 2); + let nyan : cat = cat(52u, 99); + let kitty = cat(1000u, 2); assert_eq!(nyan.how_hungry, 99); assert_eq!(kitty.how_hungry, 2); } diff --git a/src/test/run-pass/cleanup-copy-mode.rs b/src/test/run-pass/cleanup-copy-mode.rs index 45375efe9d630..d3b3c0c059178 100644 --- a/src/test/run-pass/cleanup-copy-mode.rs +++ b/src/test/run-pass/cleanup-copy-mode.rs @@ -10,7 +10,6 @@ // xfail-win32 -use std::result; use std::task; fn adder(x: @int, y: @int) -> int { return *x + *y; } diff --git a/src/test/run-pass/coerce-reborrow-imm-ptr-rcvr.rs b/src/test/run-pass/coerce-reborrow-imm-ptr-rcvr.rs index 438c70c6583f4..5525062581c1a 100644 --- a/src/test/run-pass/coerce-reborrow-imm-ptr-rcvr.rs +++ b/src/test/run-pass/coerce-reborrow-imm-ptr-rcvr.rs @@ -11,6 +11,6 @@ fn foo(speaker: &const SpeechMaker) -> uint { } pub fn main() { - let mut lincoln = SpeechMaker {speeches: 22}; + let lincoln = SpeechMaker {speeches: 22}; assert_eq!(foo(&const lincoln), 55); } diff --git a/src/test/run-pass/comm.rs b/src/test/run-pass/comm.rs index b0bdfd598fb79..ac9501a71103a 100644 --- a/src/test/run-pass/comm.rs +++ b/src/test/run-pass/comm.rs @@ -9,12 +9,11 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::comm::*; use std::task; pub fn main() { let (p, ch) = stream(); - let t = task::spawn(|| child(&ch) ); + let _t = task::spawn(|| child(&ch) ); let y = p.recv(); error!("received"); error!(y); diff --git a/src/test/run-pass/complex.rs b/src/test/run-pass/complex.rs index e01c7d32f85c6..7a085c5d3e2dd 100644 --- a/src/test/run-pass/complex.rs +++ b/src/test/run-pass/complex.rs @@ -16,9 +16,9 @@ type t = int; fn nothing() { } -fn putstr(s: ~str) { } +fn putstr(_s: ~str) { } -fn putint(i: int) { +fn putint(_i: int) { let mut i: int = 33; while i < 36 { putstr(~"hi"); i = i + 1; } } diff --git a/src/test/run-pass/conditional-compile.rs b/src/test/run-pass/conditional-compile.rs index fdf8edc5861a4..00be4cd26f43a 100644 --- a/src/test/run-pass/conditional-compile.rs +++ b/src/test/run-pass/conditional-compile.rs @@ -89,8 +89,8 @@ pub fn main() { // Exercise some of the configured items in ways that wouldn't be possible // if they had the bogus definition assert!((b)); - let x: t = true; - let y: tg = bar; + let _x: t = true; + let _y: tg = bar; test_in_fn_ctxt(); } diff --git a/src/test/run-pass/const-fields-and-indexing.rs b/src/test/run-pass/const-fields-and-indexing.rs index 6dca5d60f1111..b31dcc8342840 100644 --- a/src/test/run-pass/const-fields-and-indexing.rs +++ b/src/test/run-pass/const-fields-and-indexing.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::io; - static x : [int, ..4] = [1,2,3,4]; static p : int = x[2]; static y : &'static [int] = &[1,2,3,4]; diff --git a/src/test/run-pass/const-region-ptrs.rs b/src/test/run-pass/const-region-ptrs.rs index c2103a40bfea7..3e79fad542e16 100644 --- a/src/test/run-pass/const-region-ptrs.rs +++ b/src/test/run-pass/const-region-ptrs.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::io; - struct Pair<'self> { a: int, b: &'self int } static x: &'static int = &10; diff --git a/src/test/run-pass/const-struct.rs b/src/test/run-pass/const-struct.rs index 684111c491730..111fe3870ba3b 100644 --- a/src/test/run-pass/const-struct.rs +++ b/src/test/run-pass/const-struct.rs @@ -9,7 +9,6 @@ // except according to those terms. use std::cmp; -use std::io; struct foo { a: int, b: int, c: int } diff --git a/src/test/run-pass/const-vecs-and-slices.rs b/src/test/run-pass/const-vecs-and-slices.rs index 01ef3284e32f9..8a1db762b440c 100644 --- a/src/test/run-pass/const-vecs-and-slices.rs +++ b/src/test/run-pass/const-vecs-and-slices.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::io; - static x : [int, ..4] = [1,2,3,4]; static y : &'static [int] = &[1,2,3,4]; diff --git a/src/test/run-pass/core-run-destroy.rs b/src/test/run-pass/core-run-destroy.rs index 64f9ecc9de220..2551d1a5cfcba 100644 --- a/src/test/run-pass/core-run-destroy.rs +++ b/src/test/run-pass/core-run-destroy.rs @@ -16,7 +16,6 @@ // instead of in std. use std::libc; -use std::os; use std::run::*; use std::run; use std::str; diff --git a/src/test/run-pass/deep-vector2.rs b/src/test/run-pass/deep-vector2.rs index ab08a538723e4..b644d1a8b1f9d 100644 --- a/src/test/run-pass/deep-vector2.rs +++ b/src/test/run-pass/deep-vector2.rs @@ -9,7 +9,7 @@ // except according to those terms. pub fn main() { - let x = ~[ + let _x = ~[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, diff --git a/src/test/run-pass/deref.rs b/src/test/run-pass/deref.rs index 01a7792ce8847..9951531d2d171 100644 --- a/src/test/run-pass/deref.rs +++ b/src/test/run-pass/deref.rs @@ -10,4 +10,7 @@ -pub fn main() { let x: @int = @10; let y: int = *x; } +pub fn main() { + let x: @int = @10; + let _y: int = *x; +} diff --git a/src/test/run-pass/deriving-meta-multiple.rs b/src/test/run-pass/deriving-meta-multiple.rs index f0b2d2ec827bb..b17632e4ee752 100644 --- a/src/test/run-pass/deriving-meta-multiple.rs +++ b/src/test/run-pass/deriving-meta-multiple.rs @@ -19,7 +19,7 @@ struct Foo { } pub fn main() { - use std::hash::{Hash, HashUtil}; // necessary for IterBytes check + use std::hash::HashUtil; // necessary for IterBytes check let a = Foo {bar: 4, baz: -3}; diff --git a/src/test/run-pass/deriving-meta.rs b/src/test/run-pass/deriving-meta.rs index aef671ba757aa..2fa77ee16356b 100644 --- a/src/test/run-pass/deriving-meta.rs +++ b/src/test/run-pass/deriving-meta.rs @@ -17,7 +17,7 @@ struct Foo { } pub fn main() { - use std::hash::{Hash, HashUtil}; // necessary for IterBytes check + use std::hash::HashUtil; // necessary for IterBytes check let a = Foo {bar: 4, baz: -3}; diff --git a/src/test/run-pass/die-macro.rs b/src/test/run-pass/die-macro.rs index c4f5e2640ee1d..f08e5f054a9da 100644 --- a/src/test/run-pass/die-macro.rs +++ b/src/test/run-pass/die-macro.rs @@ -1,9 +1,11 @@ // Just testing that fail!() type checks in statement or expr +#[allow(unreachable_code)]; + fn f() { fail!(); - let x: int = fail!(); + let _x: int = fail!(); } pub fn main() { diff --git a/src/test/run-pass/do-empty-args.rs b/src/test/run-pass/do-empty-args.rs index b7c97392ec156..485d59da7d4b2 100644 --- a/src/test/run-pass/do-empty-args.rs +++ b/src/test/run-pass/do-empty-args.rs @@ -11,7 +11,7 @@ // no-reformat // Testing various forms of `do` with empty arg lists -fn f(f: &fn() -> bool) -> bool { +fn f(_f: &fn() -> bool) -> bool { true } diff --git a/src/test/run-pass/do-no-args.rs b/src/test/run-pass/do-no-args.rs index 2af441993225b..6aef1f5f9e567 100644 --- a/src/test/run-pass/do-no-args.rs +++ b/src/test/run-pass/do-no-args.rs @@ -10,9 +10,9 @@ // Testing that we can drop the || in do exprs -fn f(f: @fn() -> bool) -> bool { true } +fn f(_f: @fn() -> bool) -> bool { true } -fn d(f: @fn()) { } +fn d(_f: @fn()) { } pub fn main() { do d { } diff --git a/src/test/run-pass/do-pure.rs b/src/test/run-pass/do-pure.rs index 08056f59acd3f..8a0509c177432 100644 --- a/src/test/run-pass/do-pure.rs +++ b/src/test/run-pass/do-pure.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -fn f(f: &fn()) { +fn f(_f: &fn()) { } fn g() { diff --git a/src/test/run-pass/double-unbox.rs b/src/test/run-pass/double-unbox.rs index 9f4c354b2bf05..c6ea32ba29046 100644 --- a/src/test/run-pass/double-unbox.rs +++ b/src/test/run-pass/double-unbox.rs @@ -12,7 +12,7 @@ struct Quux { bar: int } -fn g(i: int) { } +fn g(_i: int) { } fn f(foo: @@Quux) { g(foo.bar); } pub fn main() { } diff --git a/src/test/run-pass/drop-on-empty-block-exit.rs b/src/test/run-pass/drop-on-empty-block-exit.rs index 246306e4c47a1..07a73e0d8a941 100644 --- a/src/test/run-pass/drop-on-empty-block-exit.rs +++ b/src/test/run-pass/drop-on-empty-block-exit.rs @@ -12,4 +12,7 @@ enum t { foo(@int), } -pub fn main() { let tt = foo(@10); match tt { foo(z) => { } } } +pub fn main() { + let tt = foo(@10); + match tt { foo(_z) => { } } +} diff --git a/src/test/run-pass/drop-on-ret.rs b/src/test/run-pass/drop-on-ret.rs index 932da027b7024..afc9e532ad854 100644 --- a/src/test/run-pass/drop-on-ret.rs +++ b/src/test/run-pass/drop-on-ret.rs @@ -12,6 +12,12 @@ // -*- rust -*- -fn f() -> int { if true { let s: ~str = ~"should not leak"; return 1; } return 0; } +fn f() -> int { + if true { + let _s: ~str = ~"should not leak"; + return 1; + } + return 0; +} pub fn main() { f(); } diff --git a/src/test/run-pass/drop-trait-generic.rs b/src/test/run-pass/drop-trait-generic.rs index 557a153bce239..cb5a5294acf92 100644 --- a/src/test/run-pass/drop-trait-generic.rs +++ b/src/test/run-pass/drop-trait-generic.rs @@ -20,5 +20,5 @@ impl ::std::ops::Drop for S { } pub fn main() { - let x = S { x: 1 }; + let _x = S { x: 1 }; } diff --git a/src/test/run-pass/drop-trait.rs b/src/test/run-pass/drop-trait.rs index 0ed5a27eb1948..35d59770d12e8 100644 --- a/src/test/run-pass/drop-trait.rs +++ b/src/test/run-pass/drop-trait.rs @@ -19,5 +19,5 @@ impl Drop for Foo { } pub fn main() { - let x: Foo = Foo { x: 3 }; + let _x: Foo = Foo { x: 3 }; } diff --git a/src/test/run-pass/empty-mutable-vec.rs b/src/test/run-pass/empty-mutable-vec.rs index d7e649a8fb684..6c90e011218c4 100644 --- a/src/test/run-pass/empty-mutable-vec.rs +++ b/src/test/run-pass/empty-mutable-vec.rs @@ -8,6 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#[allow(unused_mut)]; - -pub fn main() { let mut v: ~[int] = ~[]; } +pub fn main() { let mut _v: ~[int] = ~[]; } diff --git a/src/test/run-pass/enum-alignment.rs b/src/test/run-pass/enum-alignment.rs index c23f02e1bedf7..58a91d4dbce4b 100644 --- a/src/test/run-pass/enum-alignment.rs +++ b/src/test/run-pass/enum-alignment.rs @@ -14,7 +14,7 @@ use std::sys; fn addr_of(ptr: &T) -> uint { let ptr = ptr::to_unsafe_ptr(ptr); - unsafe { ptr as uint } + ptr as uint } fn is_aligned(ptr: &T) -> bool { diff --git a/src/test/run-pass/enum-disr-val-pretty.rs b/src/test/run-pass/enum-disr-val-pretty.rs index 2c61351cf44a5..083e851f9659a 100644 --- a/src/test/run-pass/enum-disr-val-pretty.rs +++ b/src/test/run-pass/enum-disr-val-pretty.rs @@ -19,7 +19,7 @@ pub fn main() { test_color(imaginary, -1, ~"imaginary"); } -fn test_color(color: color, val: int, name: ~str) { +fn test_color(color: color, val: int, _name: ~str) { assert!(color as int == val); assert!(color as float == val as float); } diff --git a/src/test/run-pass/enum-export-inheritance.rs b/src/test/run-pass/enum-export-inheritance.rs index 49823155043f4..09834269d0b7b 100644 --- a/src/test/run-pass/enum-export-inheritance.rs +++ b/src/test/run-pass/enum-export-inheritance.rs @@ -17,5 +17,5 @@ mod a { } pub fn main() { - let x = a::Bar; + let _x = a::Bar; } diff --git a/src/test/run-pass/enum-variants.rs b/src/test/run-pass/enum-variants.rs index a8a0a72dd3cbd..430823b295073 100644 --- a/src/test/run-pass/enum-variants.rs +++ b/src/test/run-pass/enum-variants.rs @@ -1,3 +1,6 @@ +#[allow(dead_assignment)]; +#[allow(unused_variable)]; + enum Animal { Dog (~str, float), Cat { name: ~str, weight: float } @@ -7,5 +10,5 @@ pub fn main() { let mut a: Animal = Dog(~"Cocoa", 37.2); a = Cat{ name: ~"Spotty", weight: 2.7 }; // permuting the fields should work too - let c = Cat { weight: 3.1, name: ~"Spreckles" }; + let _c = Cat { weight: 3.1, name: ~"Spreckles" }; } diff --git a/src/test/run-pass/enum-vec-initializer.rs b/src/test/run-pass/enum-vec-initializer.rs index ae590ad7d1f71..d240e849ad049 100644 --- a/src/test/run-pass/enum-vec-initializer.rs +++ b/src/test/run-pass/enum-vec-initializer.rs @@ -16,9 +16,9 @@ static BAR:uint = Bunny as uint; static BAR2:uint = BAR; fn main() { - let v = [0, .. Bunny as uint]; - let v = [0, .. BAR]; - let v = [0, .. BAR2]; + let _v = [0, .. Bunny as uint]; + let _v = [0, .. BAR]; + let _v = [0, .. BAR2]; static BAR3:uint = BAR2; - let v = [0, .. BAR3]; -} \ No newline at end of file + let _v = [0, .. BAR3]; +} diff --git a/src/test/run-pass/estr-slice.rs b/src/test/run-pass/estr-slice.rs index 268b6974d7f6c..ca2039fedede1 100644 --- a/src/test/run-pass/estr-slice.rs +++ b/src/test/run-pass/estr-slice.rs @@ -12,7 +12,7 @@ pub fn main() { let x = &"hello"; let v = &"hello"; - let mut y : &str = &"there"; + let y : &str = &"there"; info!(x); info!(y); diff --git a/src/test/run-pass/estr-uniq.rs b/src/test/run-pass/estr-uniq.rs index a096a8456739e..7935886d39b3b 100644 --- a/src/test/run-pass/estr-uniq.rs +++ b/src/test/run-pass/estr-uniq.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#[allow(dead_assignment)]; + pub fn main() { let x : ~str = ~"hello"; let _y : ~str = ~"there"; diff --git a/src/test/run-pass/evec-internal-boxes.rs b/src/test/run-pass/evec-internal-boxes.rs index 64c8a4caf80ae..c872ee5a9c58d 100644 --- a/src/test/run-pass/evec-internal-boxes.rs +++ b/src/test/run-pass/evec-internal-boxes.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#[allow(dead_assignment)]; + pub fn main() { let x : [@int, ..5] = [@1,@2,@3,@4,@5]; let _y : [@int, ..5] = [@1,@2,@3,@4,@5]; diff --git a/src/test/run-pass/evec-slice.rs b/src/test/run-pass/evec-slice.rs index 38891d35e8e6c..4a14faf1f84e1 100644 --- a/src/test/run-pass/evec-slice.rs +++ b/src/test/run-pass/evec-slice.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#[allow(dead_assignment)]; + pub fn main() { let x : &[int] = &[1,2,3,4,5]; let mut z = &[1,2,3,4,5]; diff --git a/src/test/run-pass/exec-env.rs b/src/test/run-pass/exec-env.rs index 2437946a1f094..735891b25d48c 100644 --- a/src/test/run-pass/exec-env.rs +++ b/src/test/run-pass/exec-env.rs @@ -14,5 +14,5 @@ use std::os; pub fn main() { - assert_eq!(os::getenv(~"TEST_EXEC_ENV"), Some(~"22")); + assert_eq!(os::getenv("TEST_EXEC_ENV"), Some(~"22")); } diff --git a/src/test/run-pass/export-abstract-tag.rs b/src/test/run-pass/export-abstract-tag.rs index 209dbb3741a06..adc4b553d0959 100644 --- a/src/test/run-pass/export-abstract-tag.rs +++ b/src/test/run-pass/export-abstract-tag.rs @@ -17,4 +17,4 @@ mod foo { pub fn f() -> t { return t1; } } -pub fn main() { let v: foo::t = foo::f(); } +pub fn main() { let _v: foo::t = foo::f(); } diff --git a/src/test/run-pass/export-glob-imports-target.rs b/src/test/run-pass/export-glob-imports-target.rs index 6b97c9031f0a9..ab2750dc4af04 100644 --- a/src/test/run-pass/export-glob-imports-target.rs +++ b/src/test/run-pass/export-glob-imports-target.rs @@ -21,7 +21,7 @@ mod foo { pub static a : int = 10; } pub fn zum() { - let b = a; + let _b = a; } } diff --git a/src/test/run-pass/export-tag-variant.rs b/src/test/run-pass/export-tag-variant.rs index 47ac4bd4a9ace..d0aa23e81fa1d 100644 --- a/src/test/run-pass/export-tag-variant.rs +++ b/src/test/run-pass/export-tag-variant.rs @@ -12,4 +12,4 @@ mod foo { pub enum t { t1, } } -pub fn main() { let v = foo::t1; } +pub fn main() { let _v = foo::t1; } diff --git a/src/test/run-pass/expr-block-fn.rs b/src/test/run-pass/expr-block-fn.rs index a44afac80f44d..dbb1ac1f64989 100644 --- a/src/test/run-pass/expr-block-fn.rs +++ b/src/test/run-pass/expr-block-fn.rs @@ -14,7 +14,7 @@ fn test_fn() { type t = @fn() -> int; fn ten() -> int { return 10; } let rs: t = { ten }; - //assert!((rs() == 10)); + assert!((rs() == 10)); } pub fn main() { test_fn(); } diff --git a/src/test/run-pass/expr-block-ref.rs b/src/test/run-pass/expr-block-ref.rs index 8b10bd7c51c2c..c77cad8858e00 100644 --- a/src/test/run-pass/expr-block-ref.rs +++ b/src/test/run-pass/expr-block-ref.rs @@ -9,4 +9,4 @@ // except according to those terms. // Regression test for issue #388 -pub fn main() { let x = { { @10 } }; } +pub fn main() { let _x = { { @10 } }; } diff --git a/src/test/run-pass/expr-elseif-ref.rs b/src/test/run-pass/expr-elseif-ref.rs index b13f7ceba4bfe..669acf1feb45a 100644 --- a/src/test/run-pass/expr-elseif-ref.rs +++ b/src/test/run-pass/expr-elseif-ref.rs @@ -12,6 +12,6 @@ // values from the else if branch pub fn main() { let y: @uint = @10u; - let x = if false { y } else if true { y } else { y }; + let _x = if false { y } else if true { y } else { y }; assert_eq!(*y, 10u); } diff --git a/src/test/run-pass/expr-elseif-ref2.rs b/src/test/run-pass/expr-elseif-ref2.rs index 2832e4a760c1e..96acaf43e3413 100644 --- a/src/test/run-pass/expr-elseif-ref2.rs +++ b/src/test/run-pass/expr-elseif-ref2.rs @@ -9,4 +9,12 @@ // except according to those terms. // Regression test for issue #388 -pub fn main() { let x = if false { @0u } else if true { @10u } else { @0u }; } +pub fn main() { + let _x = if false { + @0u + } else if true { + @10u + } else { + @0u + }; +} diff --git a/src/test/run-pass/expr-empty-ret.rs b/src/test/run-pass/expr-empty-ret.rs index fa84e81f775c1..afc7dfaf9b441 100644 --- a/src/test/run-pass/expr-empty-ret.rs +++ b/src/test/run-pass/expr-empty-ret.rs @@ -10,6 +10,11 @@ // Issue #521 -fn f() { let x = match true { true => { 10 } false => { return } }; } +fn f() { + let _x = match true { + true => { 10 } + false => { return } + }; +} pub fn main() { } diff --git a/src/test/run-pass/expr-if-fail-all.rs b/src/test/run-pass/expr-if-fail-all.rs index 19a046fd27e0d..a34620d2e1be4 100644 --- a/src/test/run-pass/expr-if-fail-all.rs +++ b/src/test/run-pass/expr-if-fail-all.rs @@ -10,4 +10,10 @@ // When all branches of an if expression result in fail, the entire if // expression results in fail. -pub fn main() { let x = if true { 10 } else { if true { fail!() } else { fail!() } }; } +pub fn main() { + let _x = if true { + 10 + } else { + if true { fail!() } else { fail!() } + }; +} diff --git a/src/test/run-pass/expr-match-fail-all.rs b/src/test/run-pass/expr-match-fail-all.rs index 5234f58578e9d..aef11a78e0dbb 100644 --- a/src/test/run-pass/expr-match-fail-all.rs +++ b/src/test/run-pass/expr-match-fail-all.rs @@ -14,7 +14,7 @@ // When all branches of an match expression result in fail, the entire // match expression results in fail. pub fn main() { - let x = + let _x = match true { true => { 10 } false => { match true { true => { fail!() } false => { fail!() } } } diff --git a/src/test/run-pass/expr-match.rs b/src/test/run-pass/expr-match.rs index a6324b98ebcaa..1e9ad5283d1ed 100644 --- a/src/test/run-pass/expr-match.rs +++ b/src/test/run-pass/expr-match.rs @@ -22,7 +22,7 @@ fn test_basic() { } fn test_inferrence() { - let mut rs = match true { true => { true } false => { false } }; + let rs = match true { true => { true } false => { false } }; assert!((rs)); } diff --git a/src/test/run-pass/extern-mod-syntax.rs b/src/test/run-pass/extern-mod-syntax.rs index b78f607792b8f..4643c809961e7 100644 --- a/src/test/run-pass/extern-mod-syntax.rs +++ b/src/test/run-pass/extern-mod-syntax.rs @@ -10,6 +10,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#[allow(unused_imports)]; + extern mod extra; use extra::json::Object; diff --git a/src/test/run-pass/fn-coerce-field.rs b/src/test/run-pass/fn-coerce-field.rs index 39e4f52873a39..22aab1aa66191 100644 --- a/src/test/run-pass/fn-coerce-field.rs +++ b/src/test/run-pass/fn-coerce-field.rs @@ -14,5 +14,5 @@ struct r { pub fn main() { fn f() {} - let i: r = r {field: f}; + let _i: r = r {field: f}; } diff --git a/src/test/run-pass/fn-lval.rs b/src/test/run-pass/fn-lval.rs index 2754fdea4d4e8..b19708a971203 100644 --- a/src/test/run-pass/fn-lval.rs +++ b/src/test/run-pass/fn-lval.rs @@ -12,7 +12,7 @@ // -*- rust -*- -fn foo(f: extern fn(int) -> int) { } +fn foo(_f: extern fn(int) -> int) { } fn id(x: int) -> int { return x; } diff --git a/src/test/run-pass/fn-type-infer.rs b/src/test/run-pass/fn-type-infer.rs index a753005069ff9..bb9254589f7b3 100644 --- a/src/test/run-pass/fn-type-infer.rs +++ b/src/test/run-pass/fn-type-infer.rs @@ -8,9 +8,11 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#[allow(unused_variable)]; + pub fn main() { // We should be able to type infer inside of @fns. - let f = || { + let _f = || { let i = 10; }; } diff --git a/src/test/run-pass/foreign-call-no-runtime.rs b/src/test/run-pass/foreign-call-no-runtime.rs index e9bf17a037ae5..1d17959645acd 100644 --- a/src/test/run-pass/foreign-call-no-runtime.rs +++ b/src/test/run-pass/foreign-call-no-runtime.rs @@ -9,10 +9,8 @@ extern { pub fn main() { unsafe { do run_in_bare_thread() { - unsafe { - let i = &100; - rust_dbg_call(callback, cast::transmute(i)); - } + let i = &100; + rust_dbg_call(callback, cast::transmute(i)); } } } diff --git a/src/test/run-pass/foreign-fn-linkname.rs b/src/test/run-pass/foreign-fn-linkname.rs index 827f950dab241..9ba332fb8221e 100644 --- a/src/test/run-pass/foreign-fn-linkname.rs +++ b/src/test/run-pass/foreign-fn-linkname.rs @@ -10,24 +10,22 @@ extern mod extra; -use std::libc; -use std::str; -use std::vec; - mod libc { + use std::libc::{c_char, size_t}; + #[nolink] #[abi = "cdecl"] extern { #[link_name = "strlen"] - pub fn my_strlen(str: *u8) -> uint; + pub fn my_strlen(str: *c_char) -> size_t; } } fn strlen(str: ~str) -> uint { - unsafe { - // C string is terminated with a zero - do str.with_c_str |buf| { - libc::my_strlen(buf as *u8) + // C string is terminated with a zero + do str.with_c_str |buf| { + unsafe { + libc::my_strlen(buf) as uint } } } diff --git a/src/test/run-pass/foreign-mod-unused-const.rs b/src/test/run-pass/foreign-mod-unused-const.rs index a1f6cf6988bf7..977488d4529af 100644 --- a/src/test/run-pass/foreign-mod-unused-const.rs +++ b/src/test/run-pass/foreign-mod-unused-const.rs @@ -9,9 +9,11 @@ // except according to those terms. mod foo { + use std::libc::c_int; + #[nolink] extern { - pub static errno: int; + pub static errno: c_int; } } diff --git a/src/test/run-pass/foreign2.rs b/src/test/run-pass/foreign2.rs index 72bdd5e2946b9..2cc7e27077284 100644 --- a/src/test/run-pass/foreign2.rs +++ b/src/test/run-pass/foreign2.rs @@ -21,11 +21,12 @@ mod zed { } mod libc { + use std::libc::{c_int, c_void, size_t, ssize_t}; + #[abi = "cdecl"] #[nolink] extern { - pub fn write(fd: int, buf: *u8, count: ::std::libc::size_t) - -> ::std::libc::ssize_t; + pub fn write(fd: c_int, buf: *c_void, count: size_t) -> ssize_t; } } diff --git a/src/test/run-pass/generic-drop-glue.rs b/src/test/run-pass/generic-drop-glue.rs index 9592f9ff73616..9e0dbfba0e75f 100644 --- a/src/test/run-pass/generic-drop-glue.rs +++ b/src/test/run-pass/generic-drop-glue.rs @@ -11,6 +11,6 @@ struct Pair { x: @int, y: @int } -fn f(t: T) { let t1: T = t; } +fn f(t: T) { let _t1: T = t; } pub fn main() { let x = Pair {x: @10, y: @12}; f(x); } diff --git a/src/test/run-pass/generic-fn.rs b/src/test/run-pass/generic-fn.rs index 34fb22ea0f45b..d14ee82e45eab 100644 --- a/src/test/run-pass/generic-fn.rs +++ b/src/test/run-pass/generic-fn.rs @@ -8,8 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. - - +#[allow(dead_assignment)]; // -*- rust -*- fn id(x: T) -> T { return x; } diff --git a/src/test/run-pass/generic-ivec-leak.rs b/src/test/run-pass/generic-ivec-leak.rs index ac6e3e1a69a99..17de964dd868e 100644 --- a/src/test/run-pass/generic-ivec-leak.rs +++ b/src/test/run-pass/generic-ivec-leak.rs @@ -10,4 +10,4 @@ enum wrapper { wrapped(T), } -pub fn main() { let w = wrapped(~[1, 2, 3, 4, 5]); } +pub fn main() { let _w = wrapped(~[1, 2, 3, 4, 5]); } diff --git a/src/test/run-pass/generic-ivec.rs b/src/test/run-pass/generic-ivec.rs index 2a288c8abbf35..aac390dc6ec86 100644 --- a/src/test/run-pass/generic-ivec.rs +++ b/src/test/run-pass/generic-ivec.rs @@ -8,5 +8,5 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -fn f(v: @T) { } +fn f(_v: @T) { } pub fn main() { f(@~[1, 2, 3, 4, 5]); } diff --git a/src/test/run-pass/generic-recursive-tag.rs b/src/test/run-pass/generic-recursive-tag.rs index af92bb4c8d86a..6111acfe42c7f 100644 --- a/src/test/run-pass/generic-recursive-tag.rs +++ b/src/test/run-pass/generic-recursive-tag.rs @@ -13,6 +13,6 @@ enum list { cons(@T, @list), nil, } pub fn main() { - let a: list = + let _a: list = cons::(@10, @cons::(@12, @cons::(@13, @nil::))); } diff --git a/src/test/run-pass/generic-tag-corruption.rs b/src/test/run-pass/generic-tag-corruption.rs index 5cf56b8083d2a..4fd8b73c81918 100644 --- a/src/test/run-pass/generic-tag-corruption.rs +++ b/src/test/run-pass/generic-tag-corruption.rs @@ -14,4 +14,4 @@ // This causes memory corruption in stage0. enum thing { some(K), } -pub fn main() { let x = some(~"hi"); } +pub fn main() { let _x = some(~"hi"); } diff --git a/src/test/run-pass/generic-tag-local.rs b/src/test/run-pass/generic-tag-local.rs index 21e113f40a502..fb8140790e3e9 100644 --- a/src/test/run-pass/generic-tag-local.rs +++ b/src/test/run-pass/generic-tag-local.rs @@ -12,4 +12,4 @@ enum clam { a(T), } -pub fn main() { let c = a(3); } +pub fn main() { let _c = a(3); } diff --git a/src/test/run-pass/generic-tag-match.rs b/src/test/run-pass/generic-tag-match.rs index 55b527989de53..f740d8cb2d159 100644 --- a/src/test/run-pass/generic-tag-match.rs +++ b/src/test/run-pass/generic-tag-match.rs @@ -8,13 +8,13 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. - +#[allow(dead_assignment)]; enum foo { arm(T), } fn altfoo(f: foo) { let mut hit = false; - match f { arm::(x) => { info!("in arm"); hit = true; } } + match f { arm::(_x) => { info!("in arm"); hit = true; } } assert!((hit)); } diff --git a/src/test/run-pass/generic-tag.rs b/src/test/run-pass/generic-tag.rs index b38c494662f0b..16836b0d7b830 100644 --- a/src/test/run-pass/generic-tag.rs +++ b/src/test/run-pass/generic-tag.rs @@ -8,8 +8,12 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. - +#[allow(dead_assignment)]; +#[allow(unused_variable)]; enum option { some(@T), none, } -pub fn main() { let mut a: option = some::(@10); a = none::; } +pub fn main() { + let mut a: option = some::(@10); + a = none::; +} diff --git a/src/test/run-pass/generic-type-synonym.rs b/src/test/run-pass/generic-type-synonym.rs index f481797fb444c..a1cf581fe4a81 100644 --- a/src/test/run-pass/generic-type-synonym.rs +++ b/src/test/run-pass/generic-type-synonym.rs @@ -16,6 +16,6 @@ struct Foo { type Bar = Foo; -fn takebar(b: Bar) { } +fn takebar(_b: Bar) { } pub fn main() { } diff --git a/src/test/run-pass/getopts_ref.rs b/src/test/run-pass/getopts_ref.rs index 161f37eb444e0..cebd291007036 100644 --- a/src/test/run-pass/getopts_ref.rs +++ b/src/test/run-pass/getopts_ref.rs @@ -16,7 +16,7 @@ use extra::getopts::*; pub fn main() { let args = ~[]; - let opts = ~[optopt(~"b")]; + let opts = ~[optopt("b")]; match getopts(args, opts) { Ok(ref m) => diff --git a/src/test/run-pass/guards.rs b/src/test/run-pass/guards.rs index 86bff013eefc6..bf29fa603c7ec 100644 --- a/src/test/run-pass/guards.rs +++ b/src/test/run-pass/guards.rs @@ -19,7 +19,7 @@ pub fn main() { match Pair {x: 10, y: 20} { x if x.x < 5 && x.y < 5 => { 1 } Pair {x: x, y: y} if x == 10 && y == 20 => { 2 } - Pair {x: x, y: y} => { 3 } + Pair {x: _x, y: _y} => { 3 } }; assert_eq!(b, 2); } diff --git a/src/test/run-pass/html-literals.rs b/src/test/run-pass/html-literals.rs index 42a4075d411a8..be0f9cd046b79 100644 --- a/src/test/run-pass/html-literals.rs +++ b/src/test/run-pass/html-literals.rs @@ -85,7 +85,7 @@ macro_rules! parse_node ( ) pub fn main() { - let page = html! ( + let _page = html! ( This is the title. diff --git a/src/test/run-pass/import-glob-crate.rs b/src/test/run-pass/import-glob-crate.rs index d09ef3bc25c3a..2f863d3da62ac 100644 --- a/src/test/run-pass/import-glob-crate.rs +++ b/src/test/run-pass/import-glob-crate.rs @@ -10,12 +10,13 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#[allow(dead_assignment)]; extern mod extra; use std::vec::*; pub fn main() { let mut v = from_elem(0u, 0); - v = append(v, ~[4, 2]); + v = append(v, [4, 2]); assert_eq!(from_fn(2, |i| 2*(i+1)), ~[2, 4]); } diff --git a/src/test/run-pass/import3.rs b/src/test/run-pass/import3.rs index 8e53affd2dd36..64d47bf22195f 100644 --- a/src/test/run-pass/import3.rs +++ b/src/test/run-pass/import3.rs @@ -10,6 +10,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#[allow(unused_imports)]; use baz::zed; use baz::zed::bar; diff --git a/src/test/run-pass/import4.rs b/src/test/run-pass/import4.rs index d52877fa11db9..d368ab2e993db 100644 --- a/src/test/run-pass/import4.rs +++ b/src/test/run-pass/import4.rs @@ -17,4 +17,4 @@ mod zed { pub fn bar() { info!("bar"); } } -pub fn main() { let zed = 42; bar(); } +pub fn main() { let _zed = 42; bar(); } diff --git a/src/test/run-pass/import6.rs b/src/test/run-pass/import6.rs index 296b0c605d625..4f813247576c8 100644 --- a/src/test/run-pass/import6.rs +++ b/src/test/run-pass/import6.rs @@ -10,8 +10,11 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#[allow(unused_imports)]; + use foo::zed; use bar::baz; + mod foo { pub mod zed { pub fn baz() { info!("baz"); } diff --git a/src/test/run-pass/import7.rs b/src/test/run-pass/import7.rs index 969d2b176cfb2..63a30ccee2ceb 100644 --- a/src/test/run-pass/import7.rs +++ b/src/test/run-pass/import7.rs @@ -10,8 +10,11 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#[allow(unused_imports)]; + use foo::zed; use bar::baz; + mod foo { pub mod zed { pub fn baz() { info!("baz"); } diff --git a/src/test/run-pass/init-res-into-things.rs b/src/test/run-pass/init-res-into-things.rs index cad6661bbce1b..0b5e58526f634 100644 --- a/src/test/run-pass/init-res-into-things.rs +++ b/src/test/run-pass/init-res-into-things.rs @@ -20,9 +20,7 @@ struct Box { x: r } #[unsafe_destructor] impl Drop for r { fn drop(&self) { - unsafe { - *(self.i) = *(self.i) + 1; - } + *(self.i) = *(self.i) + 1; } } @@ -35,7 +33,7 @@ fn r(i: @mut int) -> r { fn test_box() { let i = @mut 0; { - let a = @r(i); + let _a = @r(i); } assert_eq!(*i, 1); } @@ -43,7 +41,7 @@ fn test_box() { fn test_rec() { let i = @mut 0; { - let a = Box {x: r(i)}; + let _a = Box {x: r(i)}; } assert_eq!(*i, 1); } @@ -55,7 +53,7 @@ fn test_tag() { let i = @mut 0; { - let a = t0(r(i)); + let _a = t0(r(i)); } assert_eq!(*i, 1); } @@ -63,7 +61,7 @@ fn test_tag() { fn test_tup() { let i = @mut 0; { - let a = (r(i), 0); + let _a = (r(i), 0); } assert_eq!(*i, 1); } @@ -71,7 +69,7 @@ fn test_tup() { fn test_unique() { let i = @mut 0; { - let a = ~r(i); + let _a = ~r(i); } assert_eq!(*i, 1); } @@ -79,7 +77,7 @@ fn test_unique() { fn test_box_rec() { let i = @mut 0; { - let a = @Box { + let _a = @Box { x: r(i) }; } diff --git a/src/test/run-pass/instantiable.rs b/src/test/run-pass/instantiable.rs index 5415a6ad25812..41ddce7a96ee2 100644 --- a/src/test/run-pass/instantiable.rs +++ b/src/test/run-pass/instantiable.rs @@ -17,5 +17,5 @@ struct foo(X); struct X { x: uint, nxt: *foo } pub fn main() { - let x = foo(X {x: 0, nxt: ptr::null()}); + let _x = foo(X {x: 0, nxt: ptr::null()}); } diff --git a/src/test/run-pass/int.rs b/src/test/run-pass/int.rs index 33239a1441cc9..c6632f8cd6c32 100644 --- a/src/test/run-pass/int.rs +++ b/src/test/run-pass/int.rs @@ -12,4 +12,4 @@ // -*- rust -*- -pub fn main() { let x: int = 10; } +pub fn main() { let _x: int = 10; } diff --git a/src/test/run-pass/intrinsic-atomics-cc.rs b/src/test/run-pass/intrinsic-atomics-cc.rs index ad285e9a85fb9..a55149b7d0366 100644 --- a/src/test/run-pass/intrinsic-atomics-cc.rs +++ b/src/test/run-pass/intrinsic-atomics-cc.rs @@ -15,9 +15,7 @@ extern mod cci_intrinsic; use cci_intrinsic::atomic_xchg; pub fn main() { - unsafe { - let mut x = 1; - atomic_xchg(&mut x, 5); - assert_eq!(x, 5); - } + let mut x = 1; + atomic_xchg(&mut x, 5); + assert_eq!(x, 5); } diff --git a/src/test/run-pass/intrinsic-move-val.rs b/src/test/run-pass/intrinsic-move-val.rs index 18d63b32a1f77..90f352c845b5b 100644 --- a/src/test/run-pass/intrinsic-move-val.rs +++ b/src/test/run-pass/intrinsic-move-val.rs @@ -18,7 +18,7 @@ mod rusti { pub fn main() { unsafe { - let mut x = @1; + let x = @1; let mut y = @2; rusti::move_val(&mut y, x); assert_eq!(*y, 1); diff --git a/src/test/run-pass/intrinsics-math.rs b/src/test/run-pass/intrinsics-math.rs index fb58d8681a539..62a01613c2065 100644 --- a/src/test/run-pass/intrinsics-math.rs +++ b/src/test/run-pass/intrinsics-math.rs @@ -10,8 +10,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::f64; - mod rusti { #[abi = "rust-intrinsic"] extern "rust-intrinsic" { diff --git a/src/test/run-pass/invoke-external-foreign.rs b/src/test/run-pass/invoke-external-foreign.rs index 4ccd5355987fb..7e79311c5ad1f 100644 --- a/src/test/run-pass/invoke-external-foreign.rs +++ b/src/test/run-pass/invoke-external-foreign.rs @@ -19,6 +19,6 @@ extern mod foreign_lib; pub fn main() { unsafe { - let foo = foreign_lib::rustrt::rust_get_test_int(); + let _foo = foreign_lib::rustrt::rust_get_test_int(); } } diff --git a/src/test/run-pass/issue-1696.rs b/src/test/run-pass/issue-1696.rs index 103679a13eff9..d8023d2e7167d 100644 --- a/src/test/run-pass/issue-1696.rs +++ b/src/test/run-pass/issue-1696.rs @@ -11,7 +11,6 @@ // except according to those terms. use std::hashmap::HashMap; -use std::str; pub fn main() { let mut m = HashMap::new(); diff --git a/src/test/run-pass/issue-2214.rs b/src/test/run-pass/issue-2214.rs index 19785a49cd02d..5ca7a589c6c49 100644 --- a/src/test/run-pass/issue-2214.rs +++ b/src/test/run-pass/issue-2214.rs @@ -12,7 +12,6 @@ use std::cast; use std::libc::{c_double, c_int}; -use std::f64::*; fn to_c_int(v: &mut int) -> &mut c_int { unsafe { diff --git a/src/test/run-pass/issue-2288.rs b/src/test/run-pass/issue-2288.rs index e951eef370563..57d6fed041aaf 100644 --- a/src/test/run-pass/issue-2288.rs +++ b/src/test/run-pass/issue-2288.rs @@ -16,7 +16,7 @@ struct foo { } impl clam for foo { - fn chowder(&self, y: A) { + fn chowder(&self, _y: A) { } } diff --git a/src/test/run-pass/issue-2311-2.rs b/src/test/run-pass/issue-2311-2.rs index df7c3b6e7d977..b03bfb958af1b 100644 --- a/src/test/run-pass/issue-2311-2.rs +++ b/src/test/run-pass/issue-2311-2.rs @@ -14,7 +14,7 @@ struct foo { } impl foo { - pub fn bar>(&self, c: C) -> B { + pub fn bar>(&self, _c: C) -> B { fail!(); } } diff --git a/src/test/run-pass/issue-2312.rs b/src/test/run-pass/issue-2312.rs index 59ca02f50fc3a..14b5efe904db8 100644 --- a/src/test/run-pass/issue-2312.rs +++ b/src/test/run-pass/issue-2312.rs @@ -15,7 +15,7 @@ trait clam { } struct foo(int); impl foo { - pub fn bar>(&self, c: C) -> B { fail!(); } + pub fn bar>(&self, _c: C) -> B { fail!(); } } pub fn main() { } diff --git a/src/test/run-pass/issue-2428.rs b/src/test/run-pass/issue-2428.rs index 548f068979665..4e73be8d84e3a 100644 --- a/src/test/run-pass/issue-2428.rs +++ b/src/test/run-pass/issue-2428.rs @@ -9,7 +9,7 @@ // except according to those terms. pub fn main() { - let foo = 100; + let _foo = 100; static quux: int = 5; enum Stuff { diff --git a/src/test/run-pass/issue-2445-b.rs b/src/test/run-pass/issue-2445-b.rs index 432e8c19d2a98..91f76fc5ae061 100644 --- a/src/test/run-pass/issue-2445-b.rs +++ b/src/test/run-pass/issue-2445-b.rs @@ -13,7 +13,7 @@ struct c1 { } impl c1 { - pub fn f1(&self, x: int) { + pub fn f1(&self, _x: int) { } } @@ -24,7 +24,7 @@ fn c1(x: T) -> c1 { } impl c1 { - pub fn f2(&self, x: int) { + pub fn f2(&self, _x: int) { } } diff --git a/src/test/run-pass/issue-2445.rs b/src/test/run-pass/issue-2445.rs index 3c0a9355b5878..6356c87bfc961 100644 --- a/src/test/run-pass/issue-2445.rs +++ b/src/test/run-pass/issue-2445.rs @@ -13,7 +13,7 @@ struct c1 { } impl c1 { - pub fn f1(&self, x: T) {} + pub fn f1(&self, _x: T) {} } fn c1(x: T) -> c1 { @@ -23,7 +23,7 @@ fn c1(x: T) -> c1 { } impl c1 { - pub fn f2(&self, x: T) {} + pub fn f2(&self, _x: T) {} } diff --git a/src/test/run-pass/issue-2463.rs b/src/test/run-pass/issue-2463.rs index 9b774ed52435e..051ebd1ec045f 100644 --- a/src/test/run-pass/issue-2463.rs +++ b/src/test/run-pass/issue-2463.rs @@ -17,13 +17,13 @@ pub fn main() { g: 0, }; - let y = Pair { + let _y = Pair { f: 1, g: 1, .. x }; - let z = Pair { + let _z = Pair { f: 1, .. x }; diff --git a/src/test/run-pass/issue-2526-a.rs b/src/test/run-pass/issue-2526-a.rs index 39ce74947e997..851c27deaa080 100644 --- a/src/test/run-pass/issue-2526-a.rs +++ b/src/test/run-pass/issue-2526-a.rs @@ -11,6 +11,8 @@ // xfail-fast // aux-build:issue-2526.rs +#[allow(unused_imports)]; + extern mod issue_2526; use issue_2526::*; diff --git a/src/test/run-pass/issue-2633.rs b/src/test/run-pass/issue-2633.rs index c86ce953de5e4..e7da12861378b 100644 --- a/src/test/run-pass/issue-2633.rs +++ b/src/test/run-pass/issue-2633.rs @@ -26,6 +26,6 @@ fn nyan(kitty: cat, _kitty_info: KittyInfo) { } pub fn main() { - let mut kitty = cat(); + let kitty = cat(); nyan(kitty, KittyInfo {kitty: kitty}); } diff --git a/src/test/run-pass/issue-2718.rs b/src/test/run-pass/issue-2718.rs index fbd06c5e9cea1..226d9beb62763 100644 --- a/src/test/run-pass/issue-2718.rs +++ b/src/test/run-pass/issue-2718.rs @@ -10,8 +10,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::util; - pub type Task = int; // tjc: I don't know why @@ -62,7 +60,7 @@ pub mod pipes { // We should consider moving this to ::std::unsafe, although I // suspect graydon would want us to use void pointers instead. pub unsafe fn uniquify(x: *T) -> ~T { - unsafe { cast::transmute(x) } + cast::transmute(x) } pub fn swap_state_acq(dst: &mut state, src: state) -> state { @@ -78,7 +76,7 @@ pub mod pipes { } pub fn send(mut p: send_packet, payload: T) { - let mut p = p.unwrap(); + let p = p.unwrap(); let mut p = unsafe { uniquify(p) }; assert!((*p).payload.is_none()); (*p).payload = Some(payload); @@ -104,7 +102,7 @@ pub mod pipes { } pub fn recv(mut p: recv_packet) -> Option { - let mut p = p.unwrap(); + let p = p.unwrap(); let mut p = unsafe { uniquify(p) }; loop { let old_state = swap_state_acq(&mut (*p).state, @@ -123,7 +121,7 @@ pub mod pipes { } } - pub fn sender_terminate(mut p: *packet) { + pub fn sender_terminate(p: *packet) { let mut p = unsafe { uniquify(p) }; match swap_state_rel(&mut (*p).state, terminated) { empty | blocked => { @@ -140,7 +138,7 @@ pub mod pipes { } } - pub fn receiver_terminate(mut p: *packet) { + pub fn receiver_terminate(p: *packet) { let mut p = unsafe { uniquify(p) }; match swap_state_rel(&mut (*p).state, terminated) { empty => { @@ -225,15 +223,13 @@ pub mod pipes { pub mod pingpong { use std::cast; - use std::ptr; - use std::util; pub struct ping(::pipes::send_packet); pub struct pong(::pipes::send_packet); pub fn liberate_ping(p: ping) -> ::pipes::send_packet { unsafe { - let addr : *::pipes::send_packet = match &p { + let _addr : *::pipes::send_packet = match &p { &ping(ref x) => { cast::transmute(x) } }; fail!() @@ -242,7 +238,7 @@ pub mod pingpong { pub fn liberate_pong(p: pong) -> ::pipes::send_packet { unsafe { - let addr : *::pipes::send_packet = match &p { + let _addr : *::pipes::send_packet = match &p { &pong(ref x) => { cast::transmute(x) } }; fail!() @@ -254,7 +250,6 @@ pub mod pingpong { } pub mod client { - use std::option; use pingpong; pub type ping = ::pipes::send_packet; diff --git a/src/test/run-pass/issue-2804.rs b/src/test/run-pass/issue-2804.rs index aa9be2203c6b2..37cf2658ebc87 100644 --- a/src/test/run-pass/issue-2804.rs +++ b/src/test/run-pass/issue-2804.rs @@ -37,7 +37,7 @@ fn lookup(table: ~json::Object, key: ~str, default: ~str) -> ~str } } -fn add_interface(store: int, managed_ip: ~str, data: extra::json::Json) -> (~str, object) +fn add_interface(_store: int, managed_ip: ~str, data: extra::json::Json) -> (~str, object) { match &data { &extra::json::Object(ref interface) => { diff --git a/src/test/run-pass/issue-2904.rs b/src/test/run-pass/issue-2904.rs index 3f86114796347..978099be119bd 100644 --- a/src/test/run-pass/issue-2904.rs +++ b/src/test/run-pass/issue-2904.rs @@ -16,7 +16,6 @@ extern mod extra; use std::io::ReaderUtil; use std::io; -use std::str; use std::to_str; enum square { diff --git a/src/test/run-pass/issue-2989.rs b/src/test/run-pass/issue-2989.rs index f2ecd0413bd1c..d4470dc34ff0a 100644 --- a/src/test/run-pass/issue-2989.rs +++ b/src/test/run-pass/issue-2989.rs @@ -10,7 +10,6 @@ extern mod extra; -use std::io; use std::vec; trait methods { diff --git a/src/test/run-pass/issue-3012-2.rs b/src/test/run-pass/issue-3012-2.rs index 7d478bbabebba..c57257502e40a 100644 --- a/src/test/run-pass/issue-3012-2.rs +++ b/src/test/run-pass/issue-3012-2.rs @@ -17,5 +17,5 @@ use std::libc; pub fn main() { let fd: libc::c_int = 1 as libc::c_int; - let sock = @socket::socket_handle(fd); + let _sock = @socket::socket_handle(fd); } diff --git a/src/test/run-pass/issue-3429.rs b/src/test/run-pass/issue-3429.rs index 7bfb928e86d7d..abea01cefd339 100644 --- a/src/test/run-pass/issue-3429.rs +++ b/src/test/run-pass/issue-3429.rs @@ -11,5 +11,5 @@ pub fn main() { let x = 1; let y: @fn() -> int = || x; - let z = y(); + let _z = y(); } diff --git a/src/test/run-pass/issue-3563-3.rs b/src/test/run-pass/issue-3563-3.rs index 69cc7851cd9e0..e6429aa550826 100644 --- a/src/test/run-pass/issue-3563-3.rs +++ b/src/test/run-pass/issue-3563-3.rs @@ -20,7 +20,6 @@ extern mod extra; // Extern mod controls linkage. Use controls the visibility of names to modules that are // already linked in. Using WriterUtil allows us to use the write_line method. -use std::int; use std::io::WriterUtil; use std::io; use std::str; @@ -67,7 +66,7 @@ impl Drop for AsciiArt { fn AsciiArt(width: uint, height: uint, fill: char) -> AsciiArt { // Use an anonymous function to build a vector of vectors containing // blank characters for each position in our canvas. - let mut lines = do vec::build_sized(height) |push| { + let lines = do vec::build_sized(height) |push| { do height.times { push(vec::from_elem(width, '.')); } diff --git a/src/test/run-pass/issue-3574.rs b/src/test/run-pass/issue-3574.rs index dc1ce95cfae54..eb59b3e12b610 100644 --- a/src/test/run-pass/issue-3574.rs +++ b/src/test/run-pass/issue-3574.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#[allow(unnecessary_allocation)]; + // rustc --test match_borrowed_str.rs.rs && ./match_borrowed_str.rs extern mod extra; @@ -23,5 +25,6 @@ fn compare(x: &str, y: &str) -> bool pub fn main() { assert!(compare("foo", "foo")); + assert!(compare(~"foo", ~"foo")); assert!(compare(@"foo", @"foo")); } diff --git a/src/test/run-pass/issue-3743.rs b/src/test/run-pass/issue-3743.rs index e42b70b5a5e0d..f666571c2add4 100644 --- a/src/test/run-pass/issue-3743.rs +++ b/src/test/run-pass/issue-3743.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::io; - struct Vec2 { x: float, y: float diff --git a/src/test/run-pass/issue-3860.rs b/src/test/run-pass/issue-3860.rs index 0a22e8bcfd07e..ee9516e552eff 100644 --- a/src/test/run-pass/issue-3860.rs +++ b/src/test/run-pass/issue-3860.rs @@ -17,7 +17,7 @@ impl Foo { } pub fn main() { - let mut x = @mut Foo { x: 3 }; + let x = @mut Foo { x: 3 }; // Neither of the next two lines should cause an error let _ = x.stuff(); x.stuff(); diff --git a/src/test/run-pass/issue-3878.rs b/src/test/run-pass/issue-3878.rs index a5791e3834351..0db4e6eb24480 100644 --- a/src/test/run-pass/issue-3878.rs +++ b/src/test/run-pass/issue-3878.rs @@ -8,8 +8,9 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -pub fn main() -{ +#[allow(path_statement)]; + +pub fn main() { let y = ~1; y; } diff --git a/src/test/run-pass/issue-4107.rs b/src/test/run-pass/issue-4107.rs index 549d9cb734c00..f922857fb3f3f 100644 --- a/src/test/run-pass/issue-4107.rs +++ b/src/test/run-pass/issue-4107.rs @@ -9,7 +9,7 @@ // except according to those terms. pub fn main() { - let id: &Mat2 = &Matrix::identity(); + let _id: &Mat2 = &Matrix::identity(); } pub trait Index { } diff --git a/src/test/run-pass/issue-4387.rs b/src/test/run-pass/issue-4387.rs index f6ad444f94a9c..f2973256199fa 100644 --- a/src/test/run-pass/issue-4387.rs +++ b/src/test/run-pass/issue-4387.rs @@ -9,5 +9,5 @@ // except according to those terms. pub fn main() { - let foo = [0, ..2*4]; + let _foo = [0, ..2*4]; } diff --git a/src/test/run-pass/issue-4542.rs b/src/test/run-pass/issue-4542.rs index f12aa6c3356ca..e6a3d2fa3b241 100644 --- a/src/test/run-pass/issue-4542.rs +++ b/src/test/run-pass/issue-4542.rs @@ -14,7 +14,7 @@ pub fn main() { let x = os::args(); for arg in x.iter() { match arg.clone() { - s => { } + _s => { } } } } diff --git a/src/test/run-pass/issue-4735.rs b/src/test/run-pass/issue-4735.rs index 3da90ba1edcb3..c1ea98283b15c 100644 --- a/src/test/run-pass/issue-4735.rs +++ b/src/test/run-pass/issue-4735.rs @@ -17,12 +17,12 @@ struct NonCopyable(*c_void); impl Drop for NonCopyable { fn drop(&self) { let p = **self; - let v = unsafe { transmute::<*c_void, ~int>(p) }; + let _v = unsafe { transmute::<*c_void, ~int>(p) }; } } fn main() { let t = ~0; let p = unsafe { transmute::<~int, *c_void>(t) }; - let z = NonCopyable(p); + let _z = NonCopyable(p); } diff --git a/src/test/run-pass/issue-5192.rs b/src/test/run-pass/issue-5192.rs index d5a1a779d45ed..b9048257cfb58 100644 --- a/src/test/run-pass/issue-5192.rs +++ b/src/test/run-pass/issue-5192.rs @@ -40,5 +40,5 @@ impl Scheduler { } fn main() { - let mut sched = Scheduler::new(~UvEventLoop::new() as ~EventLoop); + let _sched = Scheduler::new(~UvEventLoop::new() as ~EventLoop); } diff --git a/src/test/run-pass/issue-5550.rs b/src/test/run-pass/issue-5550.rs index 54abc85053298..c1875988dc666 100644 --- a/src/test/run-pass/issue-5550.rs +++ b/src/test/run-pass/issue-5550.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#[allow(dead_assignment)]; + fn main() { let s: ~str = ~"foobar"; let mut t: &str = s; diff --git a/src/test/run-pass/issue-5572.rs b/src/test/run-pass/issue-5572.rs index 064413dd93cb5..daf5edd1d28b8 100644 --- a/src/test/run-pass/issue-5572.rs +++ b/src/test/run-pass/issue-5572.rs @@ -1,3 +1,3 @@ -fn foo(t: T) { } +fn foo(_t: T) { } fn main() { } diff --git a/src/test/run-pass/issue-5741.rs b/src/test/run-pass/issue-5741.rs index d6d09cb051022..039d9bcd16e25 100644 --- a/src/test/run-pass/issue-5741.rs +++ b/src/test/run-pass/issue-5741.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#[allow(unreachable_code)]; + use std::io; fn main() { diff --git a/src/test/run-pass/issue-5884.rs b/src/test/run-pass/issue-5884.rs index ea0e40be86692..519211bdaf2c5 100644 --- a/src/test/run-pass/issue-5884.rs +++ b/src/test/run-pass/issue-5884.rs @@ -18,7 +18,7 @@ struct Bar<'self> { } fn check(a: @Foo) { - let mut _ic = Bar{ b: a, a: ~None }; + let _ic = Bar{ b: a, a: ~None }; } pub fn main(){} diff --git a/src/test/run-pass/issue-5926.rs b/src/test/run-pass/issue-5926.rs index 7557df27f49af..d941e6326648d 100644 --- a/src/test/run-pass/issue-5926.rs +++ b/src/test/run-pass/issue-5926.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#[allow(unused_mut)]; + pub fn main() { let mut your_favorite_numbers = @[1,2,3]; let mut my_favorite_numbers = @[4,5,6]; diff --git a/src/test/run-pass/issue-6318.rs b/src/test/run-pass/issue-6318.rs index bf586eed700b4..00a94c0cc376a 100644 --- a/src/test/run-pass/issue-6318.rs +++ b/src/test/run-pass/issue-6318.rs @@ -20,7 +20,7 @@ impl Foo for Struct {} pub fn main() { match A(~Struct as ~Foo) { - A(a) => 0, + A(_a) => 0, }; } diff --git a/src/test/run-pass/issue-6557.rs b/src/test/run-pass/issue-6557.rs index 1ba505369789e..5722461257324 100644 --- a/src/test/run-pass/issue-6557.rs +++ b/src/test/run-pass/issue-6557.rs @@ -8,6 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -fn foo(~(x, y): ~(int, int)) {} +fn foo(~(_x, _y): ~(int, int)) {} pub fn main() {} diff --git a/src/test/run-pass/issue-979.rs b/src/test/run-pass/issue-979.rs index 34a9055ae8349..a68aaeb38a297 100644 --- a/src/test/run-pass/issue-979.rs +++ b/src/test/run-pass/issue-979.rs @@ -15,9 +15,7 @@ struct r { #[unsafe_destructor] impl Drop for r { fn drop(&self) { - unsafe { - *(self.b) += 1; - } + *(self.b) += 1; } } @@ -30,7 +28,7 @@ fn r(b: @mut int) -> r { pub fn main() { let b = @mut 0; { - let p = Some(r(b)); + let _p = Some(r(b)); } assert_eq!(*b, 1); diff --git a/src/test/run-pass/istr.rs b/src/test/run-pass/istr.rs index 66ad233866afa..254954fbde975 100644 --- a/src/test/run-pass/istr.rs +++ b/src/test/run-pass/istr.rs @@ -30,33 +30,33 @@ fn test_heap_assign() { fn test_heap_log() { let s = ~"a big ol' string"; info!(s); } fn test_stack_add() { - assert_eq!(~"a" + ~"b", ~"ab"); + assert_eq!(~"a" + "b", ~"ab"); let s: ~str = ~"a"; assert_eq!(s + s, ~"aa"); - assert_eq!(~"" + ~"", ~""); + assert_eq!(~"" + "", ~""); } -fn test_stack_heap_add() { assert!((~"a" + ~"bracadabra" == ~"abracadabra")); } +fn test_stack_heap_add() { assert!((~"a" + "bracadabra" == ~"abracadabra")); } fn test_heap_add() { - assert_eq!(~"this should" + ~" totally work", ~"this should totally work"); + assert_eq!(~"this should" + " totally work", ~"this should totally work"); } fn test_append() { let mut s = ~""; - s.push_str(~"a"); + s.push_str("a"); assert_eq!(s, ~"a"); let mut s = ~"a"; - s.push_str(~"b"); + s.push_str("b"); info!(s.clone()); assert_eq!(s, ~"ab"); let mut s = ~"c"; - s.push_str(~"offee"); + s.push_str("offee"); assert!(s == ~"coffee"); - s.push_str(~"&tea"); + s.push_str("&tea"); assert!(s == ~"coffee&tea"); } diff --git a/src/test/run-pass/item-attributes.rs b/src/test/run-pass/item-attributes.rs index 2d2a82ddb1b18..29c1c63066047 100644 --- a/src/test/run-pass/item-attributes.rs +++ b/src/test/run-pass/item-attributes.rs @@ -151,7 +151,7 @@ mod test_distinguish_syntax_ext { extern mod extra; pub fn f() { - fmt!("test%s", ~"s"); + fmt!("test%s", "s"); #[attr = "val"] fn g() { } } diff --git a/src/test/run-pass/ivec-pass-by-value.rs b/src/test/run-pass/ivec-pass-by-value.rs index 3a3b5746b9d6f..4a82e6844b979 100644 --- a/src/test/run-pass/ivec-pass-by-value.rs +++ b/src/test/run-pass/ivec-pass-by-value.rs @@ -8,5 +8,5 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -fn f(a: ~[int]) { } +fn f(_a: ~[int]) { } pub fn main() { f(~[1, 2, 3, 4, 5]); } diff --git a/src/test/run-pass/ivec-tag.rs b/src/test/run-pass/ivec-tag.rs index 8d87ff400614c..4b76f2f3214d4 100644 --- a/src/test/run-pass/ivec-tag.rs +++ b/src/test/run-pass/ivec-tag.rs @@ -1,4 +1,3 @@ -use std::comm::*; use std::task; fn producer(c: &Chan<~[u8]>) { @@ -9,7 +8,7 @@ fn producer(c: &Chan<~[u8]>) { pub fn main() { let (p, ch) = stream::<~[u8]>(); - let prod = task::spawn(|| producer(&ch) ); + let _prod = task::spawn(|| producer(&ch) ); - let data: ~[u8] = p.recv(); + let _data: ~[u8] = p.recv(); } diff --git a/src/test/run-pass/lambda-infer-unresolved.rs b/src/test/run-pass/lambda-infer-unresolved.rs index 056e3a4ff490f..9eecc788a69c1 100644 --- a/src/test/run-pass/lambda-infer-unresolved.rs +++ b/src/test/run-pass/lambda-infer-unresolved.rs @@ -16,6 +16,6 @@ struct Refs { refs: ~[int], n: int } pub fn main() { let e = @mut Refs{refs: ~[], n: 0}; - let f: @fn() = || error!(e.n); + let _f: @fn() = || error!(e.n); e.refs.push(1); } diff --git a/src/test/run-pass/large-records.rs b/src/test/run-pass/large-records.rs index 1ba5b10e9b7a7..788d9cf03e073 100644 --- a/src/test/run-pass/large-records.rs +++ b/src/test/run-pass/large-records.rs @@ -26,7 +26,7 @@ struct Large {a: int, k: int, l: int} fn f() { - let foo: Large = + let _foo: Large = Large {a: 0, b: 0, c: 0, diff --git a/src/test/run-pass/leak-box-as-tydesc.rs b/src/test/run-pass/leak-box-as-tydesc.rs index 94bd54e5b7ca5..0e266c2818cdb 100644 --- a/src/test/run-pass/leak-box-as-tydesc.rs +++ b/src/test/run-pass/leak-box-as-tydesc.rs @@ -10,6 +10,6 @@ -fn leaky(t: T) { } +fn leaky(_t: T) { } pub fn main() { let x = @10; leaky::<@int>(x); } diff --git a/src/test/run-pass/leak-tag-copy.rs b/src/test/run-pass/leak-tag-copy.rs index 05b8e361ae72d..93e2fcd824974 100644 --- a/src/test/run-pass/leak-tag-copy.rs +++ b/src/test/run-pass/leak-tag-copy.rs @@ -8,7 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. - +#[allow(dead_assignment)]; +#[allow(unused_variable)]; enum t { a, b(@int), } diff --git a/src/test/run-pass/leak-unique-as-tydesc.rs b/src/test/run-pass/leak-unique-as-tydesc.rs index 98c092a68c968..ab186d935df36 100644 --- a/src/test/run-pass/leak-unique-as-tydesc.rs +++ b/src/test/run-pass/leak-unique-as-tydesc.rs @@ -10,6 +10,6 @@ -fn leaky(t: T) { } +fn leaky(_t: T) { } pub fn main() { let x = ~10; leaky::<~int>(x); } diff --git a/src/test/run-pass/let-destruct-fresh-mem.rs b/src/test/run-pass/let-destruct-fresh-mem.rs index 2615396653d3a..13c12a77fd994 100644 --- a/src/test/run-pass/let-destruct-fresh-mem.rs +++ b/src/test/run-pass/let-destruct-fresh-mem.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#[allow(dead_assignment)]; + struct X { x: int, y: @A } struct A { a: int } diff --git a/src/test/run-pass/liveness-assign-imm-local-after-loop.rs b/src/test/run-pass/liveness-assign-imm-local-after-loop.rs index 5d59c4c14716f..a2f0c81f1164a 100644 --- a/src/test/run-pass/liveness-assign-imm-local-after-loop.rs +++ b/src/test/run-pass/liveness-assign-imm-local-after-loop.rs @@ -8,7 +8,11 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -fn test(cond: bool) { +#[allow(dead_assignment)]; +#[allow(unreachable_code)]; +#[allow(unused_variable)]; + +fn test(_cond: bool) { let v: int; v = 1; loop { } // loop never terminates, so no error is reported diff --git a/src/test/run-pass/liveness-assign-imm-local-after-ret.rs b/src/test/run-pass/liveness-assign-imm-local-after-ret.rs index e9c12277286d1..fe70573744ecb 100644 --- a/src/test/run-pass/liveness-assign-imm-local-after-ret.rs +++ b/src/test/run-pass/liveness-assign-imm-local-after-ret.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#[allow(unreachable_code)]; + fn test() { let _v: int; _v = 1; diff --git a/src/test/run-pass/log-err-phi.rs b/src/test/run-pass/log-err-phi.rs index 31c0c98fa962d..586a13771774d 100644 --- a/src/test/run-pass/log-err-phi.rs +++ b/src/test/run-pass/log-err-phi.rs @@ -10,4 +10,4 @@ -pub fn main() { if false { error!(~"foo" + ~"bar"); } } +pub fn main() { if false { error!(~"foo" + "bar"); } } diff --git a/src/test/run-pass/log-knows-the-names-of-variants-in-std.rs b/src/test/run-pass/log-knows-the-names-of-variants-in-std.rs index d7897223d4710..5318e5ca348d3 100644 --- a/src/test/run-pass/log-knows-the-names-of-variants-in-std.rs +++ b/src/test/run-pass/log-knows-the-names-of-variants-in-std.rs @@ -24,7 +24,7 @@ fn check_log(exp: ~str, v: T) { } pub fn main() { - let x = list::from_vec(~[a(22u), b(~"hi")]); + let x = list::from_vec([a(22u), b(~"hi")]); let exp = ~"@Cons(a(22), @Cons(b(~\"hi\"), @Nil))"; let act = fmt!("%?", x); assert!(act == exp); diff --git a/src/test/run-pass/log-linearized.rs b/src/test/run-pass/log-linearized.rs index 97b8c77c31567..a67eb282a142a 100644 --- a/src/test/run-pass/log-linearized.rs +++ b/src/test/run-pass/log-linearized.rs @@ -20,12 +20,12 @@ struct Smallintmap {v: ~[option]} struct V { v: ~[option] } fn mk() -> @mut Smallintmap { - let mut v: ~[option] = ~[]; + let v: ~[option] = ~[]; return @mut Smallintmap {v: v}; } fn f() { - let mut sim = mk::(); + let sim = mk::(); error!(sim); } diff --git a/src/test/run-pass/long-while.rs b/src/test/run-pass/long-while.rs index 3e4a33981d92f..2b1fb3b779ce9 100644 --- a/src/test/run-pass/long-while.rs +++ b/src/test/run-pass/long-while.rs @@ -8,6 +8,12 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#[allow(unused_variable)]; - -pub fn main() { let mut i: int = 0; while i < 1000000 { i += 1; let x = 3; } } +pub fn main() { + let mut i: int = 0; + while i < 1000000 { + i += 1; + let x = 3; + } +} diff --git a/src/test/run-pass/loop-break-cont-1.rs b/src/test/run-pass/loop-break-cont-1.rs index 7ed4a0ba5ce0b..3b7e03ae58de4 100644 --- a/src/test/run-pass/loop-break-cont-1.rs +++ b/src/test/run-pass/loop-break-cont-1.rs @@ -9,7 +9,7 @@ // except according to those terms. pub fn main() { - let i = 0u; + let _i = 0u; loop { break; } diff --git a/src/test/run-pass/match-borrowed_str.rs b/src/test/run-pass/match-borrowed_str.rs index 7a30f5152d01d..a33c38d242874 100644 --- a/src/test/run-pass/match-borrowed_str.rs +++ b/src/test/run-pass/match-borrowed_str.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#[allow(unnecessary_allocation)]; + fn f1(ref_string: &str) -> ~str { match ref_string { "a" => ~"found a", diff --git a/src/test/run-pass/match-implicit-copy-unique.rs b/src/test/run-pass/match-implicit-copy-unique.rs index 0497f11202f3b..23074894490d6 100644 --- a/src/test/run-pass/match-implicit-copy-unique.rs +++ b/src/test/run-pass/match-implicit-copy-unique.rs @@ -13,7 +13,7 @@ struct Pair { a: ~int, b: ~int } pub fn main() { let mut x = ~Pair {a: ~10, b: ~20}; match x { - ~Pair {a: ref mut a, b: ref mut b} => { + ~Pair {a: ref mut a, b: ref mut _b} => { assert!(**a == 10); *a = ~30; assert!(**a == 30); } } diff --git a/src/test/run-pass/match-naked-record-expr.rs b/src/test/run-pass/match-naked-record-expr.rs index 649bdd202df10..433cf23626bbf 100644 --- a/src/test/run-pass/match-naked-record-expr.rs +++ b/src/test/run-pass/match-naked-record-expr.rs @@ -11,7 +11,7 @@ struct X { x: int } pub fn main() { - let x = match 0 { + let _x = match 0 { _ => X { x: 0 }.x diff --git a/src/test/run-pass/match-naked-record.rs b/src/test/run-pass/match-naked-record.rs index 4d89fdc69104e..fe12b7c158568 100644 --- a/src/test/run-pass/match-naked-record.rs +++ b/src/test/run-pass/match-naked-record.rs @@ -11,7 +11,7 @@ struct X { x: int } pub fn main() { - let x = match 0 { + let _x = match 0 { _ => X { x: 0 } diff --git a/src/test/run-pass/match-pattern-no-type-params.rs b/src/test/run-pass/match-pattern-no-type-params.rs index feabf7a8f4d11..2076f46e8ab7b 100644 --- a/src/test/run-pass/match-pattern-no-type-params.rs +++ b/src/test/run-pass/match-pattern-no-type-params.rs @@ -11,7 +11,10 @@ enum maybe { nothing, just(T), } fn foo(x: maybe) { - match x { nothing => { error!("A"); } just(a) => { error!("B"); } } + match x { + nothing => { error!("A"); } + just(_a) => { error!("B"); } + } } pub fn main() { } diff --git a/src/test/run-pass/match-pattern-simple.rs b/src/test/run-pass/match-pattern-simple.rs index f40560081030f..92a753902228d 100644 --- a/src/test/run-pass/match-pattern-simple.rs +++ b/src/test/run-pass/match-pattern-simple.rs @@ -10,6 +10,6 @@ -fn altsimple(f: int) { match f { x => () } } +fn altsimple(f: int) { match f { _x => () } } pub fn main() { } diff --git a/src/test/run-pass/match-phi.rs b/src/test/run-pass/match-phi.rs index 40d2158835002..c25f573e73bce 100644 --- a/src/test/run-pass/match-phi.rs +++ b/src/test/run-pass/match-phi.rs @@ -8,7 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. - +#[allow(dead_assignment)]; +#[allow(unused_variable)]; enum thing { a, b, c, } diff --git a/src/test/run-pass/match-with-ret-arm.rs b/src/test/run-pass/match-with-ret-arm.rs index fb85064bfdee5..06d0b4a80ea01 100644 --- a/src/test/run-pass/match-with-ret-arm.rs +++ b/src/test/run-pass/match-with-ret-arm.rs @@ -14,7 +14,7 @@ pub fn main() { // sometimes we have had trouble finding // the right type for f, as we unified // bot and u32 here - let f = match uint::from_str(~"1234") { + let f = match uint::from_str("1234") { None => return (), Some(num) => num as u32 }; diff --git a/src/test/run-pass/mod-view-items.rs b/src/test/run-pass/mod-view-items.rs index 2fc2d4b371605..21e841b1f60c8 100644 --- a/src/test/run-pass/mod-view-items.rs +++ b/src/test/run-pass/mod-view-items.rs @@ -21,4 +21,4 @@ mod m { pub fn f() -> ~[int] { vec::from_elem(1u, 0) } } -pub fn main() { let x = m::f(); } +pub fn main() { let _x = m::f(); } diff --git a/src/test/run-pass/module-qualified-struct-destructure.rs b/src/test/run-pass/module-qualified-struct-destructure.rs index 87c854d32be8b..5655ff8ff2496 100644 --- a/src/test/run-pass/module-qualified-struct-destructure.rs +++ b/src/test/run-pass/module-qualified-struct-destructure.rs @@ -17,5 +17,5 @@ mod m { pub fn main() { let x = m::S { x: 1, y: 2 }; - let m::S { x: a, y: b } = x; + let m::S { x: _a, y: _b } = x; } diff --git a/src/test/run-pass/monad.rs b/src/test/run-pass/monad.rs index eeac89f49669a..4529ebf831fdd 100644 --- a/src/test/run-pass/monad.rs +++ b/src/test/run-pass/monad.rs @@ -47,7 +47,7 @@ pub fn main() { assert_eq!(transform(Some(10)), Some(~"11")); assert_eq!(transform(None), None); assert!((~[~"hi"]) - .bind(|x| ~[x.clone(), *x + ~"!"] ) - .bind(|x| ~[x.clone(), *x + ~"?"] ) == + .bind(|x| ~[x.clone(), *x + "!"] ) + .bind(|x| ~[x.clone(), *x + "?"] ) == ~[~"hi", ~"hi?", ~"hi!", ~"hi!?"]); } diff --git a/src/test/run-pass/move-3.rs b/src/test/run-pass/move-3.rs index dbc7886adc993..c9e480d3d7176 100644 --- a/src/test/run-pass/move-3.rs +++ b/src/test/run-pass/move-3.rs @@ -21,7 +21,7 @@ fn test(x: bool, foo: @Triple) -> int { pub fn main() { let x = @Triple{x: 1, y: 2, z: 3}; - for i in range(0u, 10000u) { + for _i in range(0u, 10000u) { assert_eq!(test(true, x), 2); } assert_eq!(test(false, x), 5); diff --git a/src/test/run-pass/move-nullary-fn.rs b/src/test/run-pass/move-nullary-fn.rs index ab66bb936354f..464d915b2c43c 100644 --- a/src/test/run-pass/move-nullary-fn.rs +++ b/src/test/run-pass/move-nullary-fn.rs @@ -9,7 +9,7 @@ // except according to those terms. // Issue #922 -fn f2(thing: @fn()) { } +fn f2(_thing: @fn()) { } fn f(thing: @fn()) { f2(thing); diff --git a/src/test/run-pass/move-out-of-field.rs b/src/test/run-pass/move-out-of-field.rs index a3c2872803adc..93ea35e262956 100644 --- a/src/test/run-pass/move-out-of-field.rs +++ b/src/test/run-pass/move-out-of-field.rs @@ -1,5 +1,3 @@ -use std::str; - struct StringBuffer { s: ~str } @@ -20,4 +18,4 @@ fn main() { sb.append("World!"); let str = to_str(sb); assert_eq!(str, ~"Hello, World!"); -} \ No newline at end of file +} diff --git a/src/test/run-pass/mut-vstore-expr.rs b/src/test/run-pass/mut-vstore-expr.rs index fa6dde5b3ef88..a276e902fbcfc 100644 --- a/src/test/run-pass/mut-vstore-expr.rs +++ b/src/test/run-pass/mut-vstore-expr.rs @@ -9,5 +9,5 @@ // except according to those terms. pub fn main() { - let x: &mut [int] = &mut [ 1, 2, 3 ]; + let _x: &mut [int] = &mut [ 1, 2, 3 ]; } diff --git a/src/test/run-pass/mutable-alias-vec.rs b/src/test/run-pass/mutable-alias-vec.rs index da96e14695246..d8ea95be658ab 100644 --- a/src/test/run-pass/mutable-alias-vec.rs +++ b/src/test/run-pass/mutable-alias-vec.rs @@ -11,8 +11,6 @@ // -*- rust -*- extern mod extra; -use std::vec; - fn grow(v: &mut ~[int]) { v.push(1); } diff --git a/src/test/run-pass/mutable-vec-drop.rs b/src/test/run-pass/mutable-vec-drop.rs index d807791027f56..5e05722053d4f 100644 --- a/src/test/run-pass/mutable-vec-drop.rs +++ b/src/test/run-pass/mutable-vec-drop.rs @@ -8,11 +8,12 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#[allow(unused_mut)]; struct Pair { a: int, b: int} pub fn main() { // This just tests whether the vec leaks its members. - let mut pvec: ~[@Pair] = + let mut _pvec: ~[@Pair] = ~[@Pair{a: 1, b: 2}, @Pair{a: 3, b: 4}, @Pair{a: 5, b: 6}]; } diff --git a/src/test/run-pass/nested-matchs.rs b/src/test/run-pass/nested-matchs.rs index 181ec238b0e71..cddbf60c382b0 100644 --- a/src/test/run-pass/nested-matchs.rs +++ b/src/test/run-pass/nested-matchs.rs @@ -13,7 +13,7 @@ fn baz() -> ! { fail!(); } fn foo() { match Some::(5) { - Some::(x) => { + Some::(_x) => { let mut bar; match None:: { None:: => { bar = 5; } _ => { baz(); } } info!(bar); diff --git a/src/test/run-pass/nested-pattern.rs b/src/test/run-pass/nested-pattern.rs index eee2d18be8e33..0bc6280393cff 100644 --- a/src/test/run-pass/nested-pattern.rs +++ b/src/test/run-pass/nested-pattern.rs @@ -16,8 +16,8 @@ enum t { foo(int, uint), bar(int, Option), } fn nested(o: t) { match o { - bar(i, Some::(_)) => { error!("wrong pattern matched"); fail!(); } - _ => { error!("succeeded"); } + bar(_i, Some::(_)) => { error!("wrong pattern matched"); fail!(); } + _ => { error!("succeeded"); } } } diff --git a/src/test/run-pass/nested-patterns.rs b/src/test/run-pass/nested-patterns.rs index bd9e4bdfd8724..d901a625e1d1e 100644 --- a/src/test/run-pass/nested-patterns.rs +++ b/src/test/run-pass/nested-patterns.rs @@ -16,7 +16,7 @@ struct C { c: int } pub fn main() { match A {a: 10, b: @20} { x@A {a, b: @20} => { assert!(x.a == 10); assert!(a == 10); } - A {b, _} => { fail!(); } + A {b: _b, _} => { fail!(); } } let mut x@B {b, _} = B {a: 10, b: C {c: 20}}; x.b.c = 30; diff --git a/src/test/run-pass/new-vstore-mut-box-syntax.rs b/src/test/run-pass/new-vstore-mut-box-syntax.rs index 63569c7198260..4792caf10c98c 100644 --- a/src/test/run-pass/new-vstore-mut-box-syntax.rs +++ b/src/test/run-pass/new-vstore-mut-box-syntax.rs @@ -9,6 +9,6 @@ // except according to those terms. pub fn main() { - let x: @mut [int] = @mut [ 1, 2, 3 ]; + let _x: @mut [int] = @mut [ 1, 2, 3 ]; } diff --git a/src/test/run-pass/newlambdas.rs b/src/test/run-pass/newlambdas.rs index c6536c68a8336..9c2a223174ca1 100644 --- a/src/test/run-pass/newlambdas.rs +++ b/src/test/run-pass/newlambdas.rs @@ -12,7 +12,7 @@ fn f(i: int, f: &fn(int) -> int) -> int { f(i) } -fn g(g: &fn()) { } +fn g(_g: &fn()) { } fn ff() -> @fn(int) -> int { return |x| x + 1; diff --git a/src/test/run-pass/newtype-struct-drop-run.rs b/src/test/run-pass/newtype-struct-drop-run.rs index b7fdfabff9ab2..b917bf0810b2d 100644 --- a/src/test/run-pass/newtype-struct-drop-run.rs +++ b/src/test/run-pass/newtype-struct-drop-run.rs @@ -22,7 +22,7 @@ impl Drop for Foo { fn main() { let y = @mut 32; { - let x = Foo(y); + let _x = Foo(y); } assert_eq!(*y, 23); } diff --git a/src/test/run-pass/option-ext.rs b/src/test/run-pass/option-ext.rs index f37f40935abe7..343c4d77702fd 100644 --- a/src/test/run-pass/option-ext.rs +++ b/src/test/run-pass/option-ext.rs @@ -8,13 +8,11 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::str; - pub fn main() { let thing = ~"{{ f }}"; - let f = thing.find_str(~"{{"); + let f = thing.find_str("{{"); if f.is_none() { - println(~"None!"); + println("None!"); } } diff --git a/src/test/run-pass/option-unwrap.rs b/src/test/run-pass/option-unwrap.rs index 5c8cfd68240fb..a469e4b86ebcd 100644 --- a/src/test/run-pass/option-unwrap.rs +++ b/src/test/run-pass/option-unwrap.rs @@ -17,9 +17,7 @@ struct dtor { impl Drop for dtor { fn drop(&self) { // abuse access to shared mutable state to write this code - unsafe { - *self.x -= 1; - } + *self.x -= 1; } } @@ -35,7 +33,7 @@ pub fn main() { { let b = Some(dtor { x:x }); - let c = unwrap(b); + let _c = unwrap(b); } assert_eq!(*x, 0); diff --git a/src/test/run-pass/output-slot-variants.rs b/src/test/run-pass/output-slot-variants.rs index e45d2280bf073..6939a4ab7b783 100644 --- a/src/test/run-pass/output-slot-variants.rs +++ b/src/test/run-pass/output-slot-variants.rs @@ -8,6 +8,9 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#[allow(dead_assignment)]; +#[allow(unused_variable)]; + struct A { a: int, b: int } struct Abox { a: @int, b: @int } diff --git a/src/test/run-pass/parse-fail.rs b/src/test/run-pass/parse-fail.rs index 4a2ff74d064de..cd5d089c36121 100644 --- a/src/test/run-pass/parse-fail.rs +++ b/src/test/run-pass/parse-fail.rs @@ -8,8 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. - - +#[allow(unreachable_code)]; // -*- rust -*- fn dont_call_me() { fail!(); info!(1); } diff --git a/src/test/run-pass/path.rs b/src/test/run-pass/path.rs index ee90cdc253a71..44953c44da327 100644 --- a/src/test/run-pass/path.rs +++ b/src/test/run-pass/path.rs @@ -11,7 +11,7 @@ mod foo { - pub fn bar(offset: uint) { } + pub fn bar(_offset: uint) { } } pub fn main() { foo::bar(0u); } diff --git a/src/test/run-pass/pattern-bound-var-in-for-each.rs b/src/test/run-pass/pattern-bound-var-in-for-each.rs index d3ae339acf279..fde1999e72d6a 100644 --- a/src/test/run-pass/pattern-bound-var-in-for-each.rs +++ b/src/test/run-pass/pattern-bound-var-in-for-each.rs @@ -16,7 +16,7 @@ fn foo(src: uint) { match Some(src) { Some(src_id) => { - for i in range(0u, 10u) { + for _i in range(0u, 10u) { let yyy = src_id; assert_eq!(yyy, 0u); } diff --git a/src/test/run-pass/pattern-in-closure.rs b/src/test/run-pass/pattern-in-closure.rs index bee3583c6a496..b6cb7f48c6d9e 100644 --- a/src/test/run-pass/pattern-in-closure.rs +++ b/src/test/run-pass/pattern-in-closure.rs @@ -15,7 +15,7 @@ struct Foo { pub fn main() { let f = |(x, _): (int, int)| println((x + 1).to_str()); - let g = |Foo { x: x, y: y }: Foo| println((x + 1).to_str()); + let g = |Foo { x: x, y: _y }: Foo| println((x + 1).to_str()); f((2, 3)); g(Foo { x: 1, y: 2 }); } diff --git a/src/test/run-pass/pred-not-bool.rs b/src/test/run-pass/pred-not-bool.rs index 127b845ad4ce4..15bf05fc0cbec 100644 --- a/src/test/run-pass/pred-not-bool.rs +++ b/src/test/run-pass/pred-not-bool.rs @@ -11,6 +11,6 @@ // this checks that a pred with a non-bool return // type is rejected, even if the pred is never used -fn bad(a: int) -> int { return 37; } //~ ERROR Non-boolean return type +fn bad(_a: int) -> int { return 37; } //~ ERROR Non-boolean return type pub fn main() { } diff --git a/src/test/run-pass/pub-use-xcrate.rs b/src/test/run-pass/pub-use-xcrate.rs index 74ae81e63e239..ca1290d7f7522 100644 --- a/src/test/run-pass/pub-use-xcrate.rs +++ b/src/test/run-pass/pub-use-xcrate.rs @@ -17,7 +17,7 @@ extern mod pub_use_xcrate2; use pub_use_xcrate2::Foo; pub fn main() { - let foo: Foo = Foo { + let _foo: Foo = Foo { name: 0 }; } diff --git a/src/test/run-pass/pub_use_mods_xcrate_exe.rs b/src/test/run-pass/pub_use_mods_xcrate_exe.rs index 953a99e1fd5be..ada6cac2eb664 100644 --- a/src/test/run-pass/pub_use_mods_xcrate_exe.rs +++ b/src/test/run-pass/pub_use_mods_xcrate_exe.rs @@ -11,6 +11,8 @@ // xfail-fast // aux-build:pub_use_mods_xcrate.rs +#[allow(unused_imports)]; + extern mod pub_use_mods_xcrate; use pub_use_mods_xcrate::a::c; diff --git a/src/test/run-pass/rcvr-borrowed-to-slice.rs b/src/test/run-pass/rcvr-borrowed-to-slice.rs index 5ea94020a22f0..63fe744f25312 100644 --- a/src/test/run-pass/rcvr-borrowed-to-slice.rs +++ b/src/test/run-pass/rcvr-borrowed-to-slice.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::vec; - trait sum { fn sum_(self) -> int; } @@ -29,7 +27,7 @@ pub fn main() { info!("y==%d", y); assert_eq!(y, 6); - let mut x = ~[1, 2, 3]; + let x = ~[1, 2, 3]; let y = x.sum_(); info!("y==%d", y); assert_eq!(y, 6); diff --git a/src/test/run-pass/region-dependent-addr-of.rs b/src/test/run-pass/region-dependent-addr-of.rs index f5eb04dd83bfe..d8076f543ecc1 100644 --- a/src/test/run-pass/region-dependent-addr-of.rs +++ b/src/test/run-pass/region-dependent-addr-of.rs @@ -44,38 +44,38 @@ fn get_v3<'v>(a: &'v A, i: uint) -> &'v int { &foo.v3[i] } -fn get_v4<'v>(a: &'v A, i: uint) -> &'v int { +fn get_v4<'v>(a: &'v A, _i: uint) -> &'v int { let foo = &a.value; &foo.v4.f } -fn get_v5<'v>(a: &'v A, i: uint) -> &'v int { +fn get_v5<'v>(a: &'v A, _i: uint) -> &'v int { let foo = &a.value; &foo.v5.f } -fn get_v6_a<'v>(a: &'v A, i: uint) -> &'v int { +fn get_v6_a<'v>(a: &'v A, _i: uint) -> &'v int { match a.value.v6 { Some(ref v) => &v.f, None => fail!() } } -fn get_v6_b<'v>(a: &'v A, i: uint) -> &'v int { +fn get_v6_b<'v>(a: &'v A, _i: uint) -> &'v int { match *a { A { value: B { v6: Some(ref v), _ } } => &v.f, _ => fail!() } } -fn get_v6_c<'v>(a: &'v A, i: uint) -> &'v int { +fn get_v6_c<'v>(a: &'v A, _i: uint) -> &'v int { match a { &A { value: B { v6: Some(ref v), _ } } => &v.f, _ => fail!() } } -fn get_v5_ref<'v>(a: &'v A, i: uint) -> &'v int { +fn get_v5_ref<'v>(a: &'v A, _i: uint) -> &'v int { match &a.value { &B {v5: ~C {f: ref v}, _} => v } diff --git a/src/test/run-pass/regions-appearance-constraint.rs b/src/test/run-pass/regions-appearance-constraint.rs index e587fa15f5ccd..2297277fdc067 100644 --- a/src/test/run-pass/regions-appearance-constraint.rs +++ b/src/test/run-pass/regions-appearance-constraint.rs @@ -26,6 +26,8 @@ fn testfn(cond: bool) { x = @5; y = @6; assert_eq!(*a, exp); + assert_eq!(x, @5); + assert_eq!(y, @6); } pub fn main() { diff --git a/src/test/run-pass/regions-bot.rs b/src/test/run-pass/regions-bot.rs index 96ae71f0ff3ee..dbc5bf6626af1 100644 --- a/src/test/run-pass/regions-bot.rs +++ b/src/test/run-pass/regions-bot.rs @@ -12,7 +12,7 @@ fn produce_static() -> &'static T { fail!(); } -fn foo(x: &T) -> &uint { produce_static() } +fn foo(_x: &T) -> &uint { produce_static() } pub fn main() { } diff --git a/src/test/run-pass/regions-creating-enums5.rs b/src/test/run-pass/regions-creating-enums5.rs index 1c8ed8a3dcd5b..380e680029913 100644 --- a/src/test/run-pass/regions-creating-enums5.rs +++ b/src/test/run-pass/regions-creating-enums5.rs @@ -13,7 +13,7 @@ enum ast<'self> { add(&'self ast<'self>, &'self ast<'self>) } -fn mk_add_ok<'a>(x: &'a ast<'a>, y: &'a ast<'a>, z: &ast) -> ast<'a> { +fn mk_add_ok<'a>(x: &'a ast<'a>, y: &'a ast<'a>, _z: &ast) -> ast<'a> { add(x, y) } diff --git a/src/test/run-pass/regions-fn-subtyping.rs b/src/test/run-pass/regions-fn-subtyping.rs index 652a7a3339617..a6b43df1f88a7 100644 --- a/src/test/run-pass/regions-fn-subtyping.rs +++ b/src/test/run-pass/regions-fn-subtyping.rs @@ -10,6 +10,9 @@ // Issue #2263. +#[allow(dead_assignment)]; +#[allow(unused_variable)]; + // Should pass region checking. fn ok(f: @fn(x: &uint)) { // Here, g is a function that can accept a uint pointer with diff --git a/src/test/run-pass/resource-assign-is-not-copy.rs b/src/test/run-pass/resource-assign-is-not-copy.rs index a9c4a114054fd..0f6aaeb3861d4 100644 --- a/src/test/run-pass/resource-assign-is-not-copy.rs +++ b/src/test/run-pass/resource-assign-is-not-copy.rs @@ -15,9 +15,7 @@ struct r { #[unsafe_destructor] impl Drop for r { fn drop(&self) { - unsafe { - *(self.i) += 1; - } + *(self.i) += 1; } } diff --git a/src/test/run-pass/resource-cycle2.rs b/src/test/run-pass/resource-cycle2.rs index 1a82e321bd7cf..0cfd3a93e5350 100644 --- a/src/test/run-pass/resource-cycle2.rs +++ b/src/test/run-pass/resource-cycle2.rs @@ -25,7 +25,7 @@ struct r { impl Drop for r { fn drop(&self) { unsafe { - let v2: ~int = cast::transmute(self.v.c); + let _v2: ~int = cast::transmute(self.v.c); } } } diff --git a/src/test/run-pass/resource-destruct.rs b/src/test/run-pass/resource-destruct.rs index 7eac25535a8cf..08d56a930d262 100644 --- a/src/test/run-pass/resource-destruct.rs +++ b/src/test/run-pass/resource-destruct.rs @@ -15,9 +15,7 @@ struct shrinky_pointer { #[unsafe_destructor] impl Drop for shrinky_pointer { fn drop(&self) { - unsafe { - error!(~"Hello!"); **(self.i) -= 1; - } + error!(~"Hello!"); **(self.i) -= 1; } } diff --git a/src/test/run-pass/resource-in-struct.rs b/src/test/run-pass/resource-in-struct.rs index 836b49f9a1520..5fdda9dc07909 100644 --- a/src/test/run-pass/resource-in-struct.rs +++ b/src/test/run-pass/resource-in-struct.rs @@ -21,9 +21,7 @@ struct close_res { #[unsafe_destructor] impl Drop for close_res { fn drop(&self) { - unsafe { - *(self.i) = false; - } + *(self.i) = false; } } @@ -35,7 +33,7 @@ fn close_res(i: closable) -> close_res { enum option { none, some(T), } -fn sink(res: option) { } +fn sink(_res: option) { } pub fn main() { let c = @mut true; diff --git a/src/test/run-pass/return-nil.rs b/src/test/run-pass/return-nil.rs index c86c63942284c..b5a81268a2dcf 100644 --- a/src/test/run-pass/return-nil.rs +++ b/src/test/run-pass/return-nil.rs @@ -12,4 +12,4 @@ fn f() { let x: () = (); return x; } -pub fn main() { let x = f(); } +pub fn main() { let _x = f(); } diff --git a/src/test/run-pass/send-resource.rs b/src/test/run-pass/send-resource.rs index e450e1f48c018..e3435fd547b18 100644 --- a/src/test/run-pass/send-resource.rs +++ b/src/test/run-pass/send-resource.rs @@ -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; struct test { diff --git a/src/test/run-pass/send-type-inference.rs b/src/test/run-pass/send-type-inference.rs index 4fcbc789f57b2..79b05915b016c 100644 --- a/src/test/run-pass/send-type-inference.rs +++ b/src/test/run-pass/send-type-inference.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::comm::*; - // tests that ctrl's type gets inferred properly struct Command { key: K, @@ -17,7 +15,7 @@ struct Command { } fn cache_server(c: Chan>>) { - let (ctrl_port, ctrl_chan) = stream(); + let (_ctrl_port, ctrl_chan) = stream(); c.send(ctrl_chan); } pub fn main() { } diff --git a/src/test/run-pass/shadow.rs b/src/test/run-pass/shadow.rs index 5109f3c92f1f2..2d3b505dfa60a 100644 --- a/src/test/run-pass/shadow.rs +++ b/src/test/run-pass/shadow.rs @@ -16,7 +16,7 @@ fn foo(c: ~[int]) { match none:: { some::(_) => { - for i in c.iter() { + for _i in c.iter() { info!(a); let a = 17; b.push(a); diff --git a/src/test/run-pass/size-and-align.rs b/src/test/run-pass/size-and-align.rs index 973c38438948a..7c9fef93943be 100644 --- a/src/test/run-pass/size-and-align.rs +++ b/src/test/run-pass/size-and-align.rs @@ -16,7 +16,7 @@ enum clam { a(T, int), b, } fn uhoh(v: ~[clam]) { match v[1] { - a::(ref t, ref u) => { info!("incorrect"); info!(u); fail!(); } + a::(ref _t, ref u) => { info!("incorrect"); info!(u); fail!(); } b:: => { info!("correct"); } } } diff --git a/src/test/run-pass/spawn-types.rs b/src/test/run-pass/spawn-types.rs index f448d74c4bd5b..111e0df1d6d5c 100644 --- a/src/test/run-pass/spawn-types.rs +++ b/src/test/run-pass/spawn-types.rs @@ -14,16 +14,15 @@ Arnold. */ -use std::comm::*; use std::task; type ctx = Chan; -fn iotask(cx: &ctx, ip: ~str) { +fn iotask(_cx: &ctx, ip: ~str) { assert_eq!(ip, ~"localhost"); } pub fn main() { - let (p, ch) = stream::(); + let (_p, ch) = stream::(); task::spawn(|| iotask(&ch, ~"localhost") ); } diff --git a/src/test/run-pass/stat.rs b/src/test/run-pass/stat.rs index 057bc57269d19..d0dde4ad3c479 100644 --- a/src/test/run-pass/stat.rs +++ b/src/test/run-pass/stat.rs @@ -16,7 +16,6 @@ use extra::tempfile; use std::io::WriterUtil; use std::io; use std::os; -use std::uint; pub fn main() { let dir = tempfile::mkdtemp(&Path("."), "").unwrap(); diff --git a/src/test/run-pass/static-impl.rs b/src/test/run-pass/static-impl.rs index 457c5a3352d12..e2bf525df1a12 100644 --- a/src/test/run-pass/static-impl.rs +++ b/src/test/run-pass/static-impl.rs @@ -11,7 +11,6 @@ // xfail-fast use std::uint; -use std::vec; pub trait plus { fn plus(&self) -> int; diff --git a/src/test/run-pass/str-append.rs b/src/test/run-pass/str-append.rs index 5ac3c0530af5a..331701107a8a2 100644 --- a/src/test/run-pass/str-append.rs +++ b/src/test/run-pass/str-append.rs @@ -24,8 +24,8 @@ fn test2() { // This tests for issue #163 let ff: ~str = ~"abc"; - let a: ~str = ff + ~"ABC" + ff; - let b: ~str = ~"ABC" + ff + ~"ABC"; + let a: ~str = ff + "ABC" + ff; + let b: ~str = ~"ABC" + ff + "ABC"; info!(a.clone()); info!(b.clone()); assert_eq!(a, ~"abcABCabc"); diff --git a/src/test/run-pass/string-self-append.rs b/src/test/run-pass/string-self-append.rs index e01b2a42f6139..b1b90468e94f0 100644 --- a/src/test/run-pass/string-self-append.rs +++ b/src/test/run-pass/string-self-append.rs @@ -10,8 +10,6 @@ extern mod extra; -use std::str; - pub fn main() { // Make sure we properly handle repeated self-appends. let mut a: ~str = ~"A"; diff --git a/src/test/run-pass/struct-like-variant-construct.rs b/src/test/run-pass/struct-like-variant-construct.rs index bc2dce680c956..4e16b5cb4cc11 100644 --- a/src/test/run-pass/struct-like-variant-construct.rs +++ b/src/test/run-pass/struct-like-variant-construct.rs @@ -20,5 +20,5 @@ enum Foo { } pub fn main() { - let x = Bar { a: 2, b: 3 }; + let _x = Bar { a: 2, b: 3 }; } diff --git a/src/test/run-pass/struct-order-of-eval-1.rs b/src/test/run-pass/struct-order-of-eval-1.rs index 42908a339d200..1b7089427580e 100644 --- a/src/test/run-pass/struct-order-of-eval-1.rs +++ b/src/test/run-pass/struct-order-of-eval-1.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::str; - struct S { f0: ~str, f1: int } pub fn main() { diff --git a/src/test/run-pass/struct-order-of-eval-2.rs b/src/test/run-pass/struct-order-of-eval-2.rs index b6851a728882a..a576e29578412 100644 --- a/src/test/run-pass/struct-order-of-eval-2.rs +++ b/src/test/run-pass/struct-order-of-eval-2.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::str; - struct S { f0: ~str, f1: ~str } pub fn main() { diff --git a/src/test/run-pass/swap-overlapping.rs b/src/test/run-pass/swap-overlapping.rs index 927ec69972738..5349d0554b1b7 100644 --- a/src/test/run-pass/swap-overlapping.rs +++ b/src/test/run-pass/swap-overlapping.rs @@ -11,7 +11,6 @@ // Issue #5041 - avoid overlapping memcpy when src and dest of a swap are the same use std::ptr; -use std::util; pub fn main() { let mut test = TestDescAndFn { diff --git a/src/test/run-pass/syntax-extension-fmt.rs b/src/test/run-pass/syntax-extension-fmt.rs index 7c90b38bae1c9..8e5892b6db194 100644 --- a/src/test/run-pass/syntax-extension-fmt.rs +++ b/src/test/run-pass/syntax-extension-fmt.rs @@ -17,7 +17,7 @@ fn test(actual: ~str, expected: ~str) { } pub fn main() { - test(fmt!("hello %d friends and %s things", 10, ~"formatted"), + test(fmt!("hello %d friends and %s things", 10, "formatted"), ~"hello 10 friends and formatted things"); test(fmt!("test"), ~"test"); @@ -42,7 +42,7 @@ fn part1() { test(fmt!("%i", 2), ~"2"); test(fmt!("%i", -1), ~"-1"); test(fmt!("%u", 10u), ~"10"); - test(fmt!("%s", ~"test"), ~"test"); + test(fmt!("%s", "test"), ~"test"); test(fmt!("%b", true), ~"true"); test(fmt!("%b", false), ~"false"); test(fmt!("%c", 'A'), ~"A"); @@ -70,7 +70,7 @@ fn part2() { test(fmt!("%10d", 500), ~" 500"); test(fmt!("%10d", -500), ~" -500"); test(fmt!("%10u", 500u), ~" 500"); - test(fmt!("%10s", ~"test"), ~" test"); + test(fmt!("%10s", "test"), ~" test"); test(fmt!("%10b", true), ~" true"); test(fmt!("%10x", 0xff_u), ~" ff"); test(fmt!("%10X", 0xff_u), ~" FF"); @@ -83,7 +83,7 @@ fn part2() { test(fmt!("%-10d", 500), ~"500 "); test(fmt!("%-10d", -500), ~"-500 "); test(fmt!("%-10u", 500u), ~"500 "); - test(fmt!("%-10s", ~"test"), ~"test "); + test(fmt!("%-10s", "test"), ~"test "); test(fmt!("%-10b", true), ~"true "); test(fmt!("%-10x", 0xff_u), ~"ff "); test(fmt!("%-10X", 0xff_u), ~"FF "); @@ -103,7 +103,7 @@ fn part3() { test(fmt!("%.d", 10), ~"10"); test(fmt!("%.d", -10), ~"-10"); test(fmt!("%.u", 10u), ~"10"); - test(fmt!("%.s", ~"test"), ~""); + test(fmt!("%.s", "test"), ~""); test(fmt!("%.x", 127u), ~"7f"); test(fmt!("%.o", 10u), ~"12"); test(fmt!("%.t", 3u), ~"11"); @@ -116,7 +116,7 @@ fn part3() { test(fmt!("%.0d", 10), ~"10"); test(fmt!("%.0d", -10), ~"-10"); test(fmt!("%.0u", 10u), ~"10"); - test(fmt!("%.0s", ~"test"), ~""); + test(fmt!("%.0s", "test"), ~""); test(fmt!("%.0x", 127u), ~"7f"); test(fmt!("%.0o", 10u), ~"12"); test(fmt!("%.0t", 3u), ~"11"); @@ -129,7 +129,7 @@ fn part3() { test(fmt!("%.1d", 10), ~"10"); test(fmt!("%.1d", -10), ~"-10"); test(fmt!("%.1u", 10u), ~"10"); - test(fmt!("%.1s", ~"test"), ~"t"); + test(fmt!("%.1s", "test"), ~"t"); test(fmt!("%.1x", 127u), ~"7f"); test(fmt!("%.1o", 10u), ~"12"); test(fmt!("%.1t", 3u), ~"11"); @@ -144,7 +144,7 @@ fn part4() { test(fmt!("%.5d", 10), ~"00010"); test(fmt!("%.5d", -10), ~"-00010"); test(fmt!("%.5u", 10u), ~"00010"); - test(fmt!("%.5s", ~"test"), ~"test"); + test(fmt!("%.5s", "test"), ~"test"); test(fmt!("%.5x", 127u), ~"0007f"); test(fmt!("%.5o", 10u), ~"00012"); test(fmt!("%.5t", 3u), ~"00011"); @@ -195,7 +195,7 @@ fn part5() { test(fmt!("%05f", 5.82), ~"05.82"); // 0-padding a string is undefined but glibc does this: - test(fmt!("%05s", ~"test"), ~" test"); + test(fmt!("%05s", "test"), ~" test"); test(fmt!("%05c", 'A'), ~" A"); test(fmt!("%05b", true), ~" true"); // Left-justify overrides 0-padding @@ -208,7 +208,7 @@ fn part5() { test(fmt!("%-05X", 127u), ~"7F "); test(fmt!("%-05o", 10u), ~"12 "); test(fmt!("%-05t", 3u), ~"11 "); - test(fmt!("%-05s", ~"test"), ~"test "); + test(fmt!("%-05s", "test"), ~"test "); test(fmt!("%-05c", 'A'), ~"A "); test(fmt!("%-05b", true), ~"true "); test(fmt!("%-05f", 5.82), ~"5.82 "); @@ -223,7 +223,7 @@ fn part6() { test(fmt!("%06.5d", 10), ~" 00010"); test(fmt!("%06.5d", -10), ~"-00010"); test(fmt!("%06.5u", 10u), ~" 00010"); - test(fmt!("%06.5s", ~"test"), ~" test"); + test(fmt!("%06.5s", "test"), ~" test"); test(fmt!("%06.5c", 'A'), ~" A"); test(fmt!("%06.5x", 127u), ~" 0007f"); test(fmt!("%06.5X", 127u), ~" 0007F"); diff --git a/src/test/run-pass/syntax-extension-minor.rs b/src/test/run-pass/syntax-extension-minor.rs index 497a55b7c78e2..819bcbf53f588 100644 --- a/src/test/run-pass/syntax-extension-minor.rs +++ b/src/test/run-pass/syntax-extension-minor.rs @@ -14,5 +14,5 @@ pub fn main() { assert_eq!(concat_idents!(asd, f_f, dsa), ~"<.<"); assert!(stringify!(use_mention_distinction) == - ~"use_mention_distinction"); + "use_mention_distinction"); } diff --git a/src/test/run-pass/syntax-extension-source-utils.rs b/src/test/run-pass/syntax-extension-source-utils.rs index eceba6cf7b18e..91d10adfbfbae 100644 --- a/src/test/run-pass/syntax-extension-source-utils.rs +++ b/src/test/run-pass/syntax-extension-source-utils.rs @@ -23,17 +23,17 @@ pub fn main() { assert_eq!(line!(), 23); //assert!((col!() == 11)); assert_eq!(indirect_line!(), 25); - assert!((file!().to_owned().ends_with(~"syntax-extension-source-utils.rs"))); + assert!((file!().to_owned().ends_with("syntax-extension-source-utils.rs"))); assert_eq!(stringify!((2*3) + 5).to_owned(), ~"( 2 * 3 ) + 5"); assert!(include!("syntax-extension-source-utils-files/includeme.fragment").to_owned() == ~"victory robot 6"); assert!( include_str!("syntax-extension-source-utils-files/includeme.fragment").to_owned() - .starts_with(~"/* this is for ")); + .starts_with("/* this is for ")); assert!( include_bin!("syntax-extension-source-utils-files/includeme.fragment") [1] == (42 as u8)); // '*' // The Windows tests are wrapped in an extra module for some reason - assert!((m1::m2::where_am_i().ends_with(~"m1::m2"))); + assert!((m1::m2::where_am_i().ends_with("m1::m2"))); } diff --git a/src/test/run-pass/tag-in-block.rs b/src/test/run-pass/tag-in-block.rs index b3f1d128843f1..99eacb54d17e4 100644 --- a/src/test/run-pass/tag-in-block.rs +++ b/src/test/run-pass/tag-in-block.rs @@ -11,7 +11,7 @@ fn foo() { - fn zed(z: bar) { } + fn zed(_z: bar) { } enum bar { nil, } fn baz() { zed(nil); } } diff --git a/src/test/run-pass/task-comm-0.rs b/src/test/run-pass/task-comm-0.rs index 686cafb011908..7eb879782d1d7 100644 --- a/src/test/run-pass/task-comm-0.rs +++ b/src/test/run-pass/task-comm-0.rs @@ -13,7 +13,6 @@ extern mod extra; use std::comm::Chan; -use std::comm::Port; use std::comm; use std::task; diff --git a/src/test/run-pass/task-comm-10.rs b/src/test/run-pass/task-comm-10.rs index 15fbf8c07b80c..749f4904ed1b5 100644 --- a/src/test/run-pass/task-comm-10.rs +++ b/src/test/run-pass/task-comm-10.rs @@ -31,7 +31,7 @@ fn start(c: &comm::Chan>) { pub fn main() { let (p, ch) = comm::stream(); - let child = task::spawn(|| start(&ch) ); + let _child = task::spawn(|| start(&ch) ); let c = p.recv(); c.send(~"A"); diff --git a/src/test/run-pass/task-comm-11.rs b/src/test/run-pass/task-comm-11.rs index 8931531d5445e..5d1a68e6cc74b 100644 --- a/src/test/run-pass/task-comm-11.rs +++ b/src/test/run-pass/task-comm-11.rs @@ -16,12 +16,12 @@ use std::comm; use std::task; fn start(c: &comm::Chan>) { - let (p, ch) = comm::stream(); + let (_p, ch) = comm::stream(); c.send(ch); } pub fn main() { let (p, ch) = comm::stream(); - let child = task::spawn(|| start(&ch) ); - let c = p.recv(); + let _child = task::spawn(|| start(&ch) ); + let _c = p.recv(); } diff --git a/src/test/run-pass/task-comm-12.rs b/src/test/run-pass/task-comm-12.rs index fd2e81d062e8e..66820bd2bc792 100644 --- a/src/test/run-pass/task-comm-12.rs +++ b/src/test/run-pass/task-comm-12.rs @@ -14,7 +14,7 @@ use std::task; pub fn main() { test00(); } -fn start(task_number: int) { info!("Started / Finished task."); } +fn start(_task_number: int) { info!("Started / Finished task."); } fn test00() { let i: int = 0; diff --git a/src/test/run-pass/task-comm-13.rs b/src/test/run-pass/task-comm-13.rs index 3caf346456398..b039f01bf0cd9 100644 --- a/src/test/run-pass/task-comm-13.rs +++ b/src/test/run-pass/task-comm-13.rs @@ -22,7 +22,7 @@ fn start(c: &comm::Chan, start: int, number_of_messages: int) { pub fn main() { info!("Check that we don't deadlock."); - let (p, ch) = comm::stream(); + let (_p, ch) = comm::stream(); task::try(|| start(&ch, 0, 10) ); info!("Joined task"); } diff --git a/src/test/run-pass/task-comm-3.rs b/src/test/run-pass/task-comm-3.rs index b9083f289725d..ae6eb6acee417 100644 --- a/src/test/run-pass/task-comm-3.rs +++ b/src/test/run-pass/task-comm-3.rs @@ -55,7 +55,7 @@ fn test00() { // Read from spawned tasks... let mut sum = 0; - for r in results.iter() { + for _r in results.iter() { i = 0; while i < number_of_messages { let value = po.recv(); diff --git a/src/test/run-pass/task-comm-4.rs b/src/test/run-pass/task-comm-4.rs index 5b0ebb0fa2508..ecc344e7ba6ac 100644 --- a/src/test/run-pass/task-comm-4.rs +++ b/src/test/run-pass/task-comm-4.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#[allow(dead_assignment)]; + use std::comm; pub fn main() { test00(); } diff --git a/src/test/run-pass/task-comm-5.rs b/src/test/run-pass/task-comm-5.rs index 472a7d7e3da7d..40cc7ef49e9d2 100644 --- a/src/test/run-pass/task-comm-5.rs +++ b/src/test/run-pass/task-comm-5.rs @@ -15,7 +15,7 @@ use std::comm; pub fn main() { test00(); } fn test00() { - let r: int = 0; + let _r: int = 0; let mut sum: int = 0; let (p, c) = comm::stream(); let number_of_messages: int = 1000; diff --git a/src/test/run-pass/task-comm-6.rs b/src/test/run-pass/task-comm-6.rs index 0da0d5877229d..b398ab41ed631 100644 --- a/src/test/run-pass/task-comm-6.rs +++ b/src/test/run-pass/task-comm-6.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#[allow(dead_assignment)]; + use std::comm::SharedChan; use std::comm; diff --git a/src/test/run-pass/task-comm-7.rs b/src/test/run-pass/task-comm-7.rs index 33d721f5f3806..c7c16af597cff 100644 --- a/src/test/run-pass/task-comm-7.rs +++ b/src/test/run-pass/task-comm-7.rs @@ -10,6 +10,8 @@ // xfail-fast +#[allow(dead_assignment)]; + extern mod extra; use std::comm; diff --git a/src/test/run-pass/task-life-0.rs b/src/test/run-pass/task-life-0.rs index 370971bd7b901..b58fe2aad5805 100644 --- a/src/test/run-pass/task-life-0.rs +++ b/src/test/run-pass/task-life-0.rs @@ -16,6 +16,6 @@ pub fn main() { task::spawn(|| child(~"Hello") ); } -fn child(s: ~str) { +fn child(_s: ~str) { } diff --git a/src/test/run-pass/task-spawn-move-and-copy.rs b/src/test/run-pass/task-spawn-move-and-copy.rs index f3a105e08527e..92697054be33b 100644 --- a/src/test/run-pass/task-spawn-move-and-copy.rs +++ b/src/test/run-pass/task-spawn-move-and-copy.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::comm::*; use std::ptr; use std::task; diff --git a/src/test/run-pass/terminate-in-initializer.rs b/src/test/run-pass/terminate-in-initializer.rs index 6d34f7a970198..62543971cce74 100644 --- a/src/test/run-pass/terminate-in-initializer.rs +++ b/src/test/run-pass/terminate-in-initializer.rs @@ -16,20 +16,20 @@ extern mod extra; use std::task; -fn test_break() { loop { let x: @int = break; } } +fn test_break() { loop { let _x: @int = break; } } -fn test_cont() { let mut i = 0; while i < 1 { i += 1; let x: @int = loop; } } +fn test_cont() { let mut i = 0; while i < 1 { i += 1; let _x: @int = loop; } } -fn test_ret() { let x: @int = return; } +fn test_ret() { let _x: @int = return; } fn test_fail() { - fn f() { let x: @int = fail!(); } + fn f() { let _x: @int = fail!(); } task::try(|| f() ); } fn test_fail_indirect() { fn f() -> ! { fail!(); } - fn g() { let x: @int = f(); } + fn g() { let _x: @int = f(); } task::try(|| g() ); } diff --git a/src/test/run-pass/trait-default-method-xc.rs b/src/test/run-pass/trait-default-method-xc.rs index 38b386838a1b4..0c334909b259c 100644 --- a/src/test/run-pass/trait-default-method-xc.rs +++ b/src/test/run-pass/trait-default-method-xc.rs @@ -10,7 +10,7 @@ fn f(i: T) { assert_eq!(i.g(), 10); } -fn welp(i: int, x: &T) -> int { +fn welp(i: int, _x: &T) -> int { i.g() } diff --git a/src/test/run-pass/trait-inheritance-num5.rs b/src/test/run-pass/trait-inheritance-num5.rs index f56eca693ea53..aee954df4616b 100644 --- a/src/test/run-pass/trait-inheritance-num5.rs +++ b/src/test/run-pass/trait-inheritance-num5.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::cmp::{Eq, Ord}; +use std::cmp::Eq; use std::num::NumCast; pub trait NumExt: Eq + Num + NumCast {} diff --git a/src/test/run-pass/trait-static-method-overwriting.rs b/src/test/run-pass/trait-static-method-overwriting.rs index 1f5c33e2bc097..e95b80447e481 100644 --- a/src/test/run-pass/trait-static-method-overwriting.rs +++ b/src/test/run-pass/trait-static-method-overwriting.rs @@ -23,7 +23,7 @@ mod base { impl ::base::HasNew for Foo { fn new() -> Foo { - unsafe { println("Foo"); } + println("Foo"); Foo { dummy: () } } } @@ -34,13 +34,13 @@ mod base { impl ::base::HasNew for Bar { fn new() -> Bar { - unsafe { io::println("Bar"); } + io::println("Bar"); Bar { dummy: () } } } } pub fn main() { - let f: base::Foo = base::HasNew::new::(); - let b: base::Bar = base::HasNew::new::(); + let _f: base::Foo = base::HasNew::new::(); + let _b: base::Bar = base::HasNew::new::(); } diff --git a/src/test/run-pass/trait-to-str.rs b/src/test/run-pass/trait-to-str.rs index 493b810c10488..8982b35ff33a6 100644 --- a/src/test/run-pass/trait-to-str.rs +++ b/src/test/run-pass/trait-to-str.rs @@ -38,7 +38,7 @@ pub fn main() { assert!((~[2, 3, 4]).to_str() == ~"[2, 3, 4]"); fn indirect(x: T) -> ~str { - x.to_str() + ~"!" + x.to_str() + "!" } assert!(indirect(~[10, 20]) == ~"[10, 20]!"); diff --git a/src/test/run-pass/traits-default-method-mut.rs b/src/test/run-pass/traits-default-method-mut.rs index fee766464582c..0c5be72432c30 100644 --- a/src/test/run-pass/traits-default-method-mut.rs +++ b/src/test/run-pass/traits-default-method-mut.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#[allow(dead_assignment)]; +#[allow(unused_variable)]; trait Foo { fn foo(&self, mut v: int) { v = 1; } diff --git a/src/test/run-pass/type-in-nested-module.rs b/src/test/run-pass/type-in-nested-module.rs index e2ccee013c24f..f0b7ee072ea5e 100644 --- a/src/test/run-pass/type-in-nested-module.rs +++ b/src/test/run-pass/type-in-nested-module.rs @@ -14,7 +14,7 @@ mod a { pub mod b { pub type t = int; - pub fn foo() { let x: t = 10; } + pub fn foo() { let _x: t = 10; } } } diff --git a/src/test/run-pass/type-param-constraints.rs b/src/test/run-pass/type-param-constraints.rs index 8968fe49bc1d4..4d6efc9772ce0 100644 --- a/src/test/run-pass/type-param-constraints.rs +++ b/src/test/run-pass/type-param-constraints.rs @@ -10,9 +10,9 @@ // xfail-fast -fn p_foo(pinned: T) { } -fn s_foo(shared: T) { } -fn u_foo(unique: T) { } +fn p_foo(_pinned: T) { } +fn s_foo(_shared: T) { } +fn u_foo(_unique: T) { } struct r { i: int, diff --git a/src/test/run-pass/type-params-in-for-each.rs b/src/test/run-pass/type-params-in-for-each.rs index a0cecb3142775..a5a9075af7b24 100644 --- a/src/test/run-pass/type-params-in-for-each.rs +++ b/src/test/run-pass/type-params-in-for-each.rs @@ -18,8 +18,10 @@ fn range_(lo: uint, hi: uint, it: &fn(uint)) { while lo_ < hi { it(lo_); lo_ += 1u; } } -fn create_index(index: ~[S], hash_fn: extern fn(T) -> uint) { - range_(0u, 256u, |_i| { let bucket: ~[T] = ~[]; } ) +fn create_index(_index: ~[S], _hash_fn: extern fn(T) -> uint) { + do range_(0u, 256u) |_i| { + let _bucket: ~[T] = ~[]; + } } pub fn main() { } diff --git a/src/test/run-pass/typestate-cfg-nesting.rs b/src/test/run-pass/typestate-cfg-nesting.rs index 997464ba50a78..6a2757c6b3002 100644 --- a/src/test/run-pass/typestate-cfg-nesting.rs +++ b/src/test/run-pass/typestate-cfg-nesting.rs @@ -8,7 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. - +#[allow(dead_assignment)]; +#[allow(unused_variable)]; fn f() { let x = 10; let mut y = 11; diff --git a/src/test/run-pass/uint.rs b/src/test/run-pass/uint.rs index b865b302668bd..9b645efb936cf 100644 --- a/src/test/run-pass/uint.rs +++ b/src/test/run-pass/uint.rs @@ -12,4 +12,4 @@ // -*- rust -*- -pub fn main() { let x: uint = 10 as uint; } +pub fn main() { let _x: uint = 10 as uint; } diff --git a/src/test/run-pass/unary-minus-suffix-inference.rs b/src/test/run-pass/unary-minus-suffix-inference.rs index 3277b878a414c..7300ca989a31c 100644 --- a/src/test/run-pass/unary-minus-suffix-inference.rs +++ b/src/test/run-pass/unary-minus-suffix-inference.rs @@ -19,15 +19,15 @@ pub fn main() { let c = 1; let c_neg: i32 = -c; - error!(b_neg); + error!(c_neg); let d = 1; let d_neg: i64 = -d; - error!(b_neg); + error!(d_neg); let e = 1; let e_neg: int = -e; - error!(b_neg); + error!(e_neg); // intentional overflows diff --git a/src/test/run-pass/unique-assign-drop.rs b/src/test/run-pass/unique-assign-drop.rs index 2205eaeb97cc9..9144ecc74f98a 100644 --- a/src/test/run-pass/unique-assign-drop.rs +++ b/src/test/run-pass/unique-assign-drop.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#[allow(dead_assignment)]; + pub fn main() { let i = ~1; let mut j = ~2; diff --git a/src/test/run-pass/unique-containing-tag.rs b/src/test/run-pass/unique-containing-tag.rs index ba5627fee5229..1ebd584aa5fa7 100644 --- a/src/test/run-pass/unique-containing-tag.rs +++ b/src/test/run-pass/unique-containing-tag.rs @@ -11,7 +11,7 @@ pub fn main() { enum t { t1(int), t2(int), } - let x = ~t1(10); + let _x = ~t1(10); /*alt *x { t1(a) { diff --git a/src/test/run-pass/unique-copy-box.rs b/src/test/run-pass/unique-copy-box.rs index 3b3074b4a7d05..16fb4eba5ba08 100644 --- a/src/test/run-pass/unique-copy-box.rs +++ b/src/test/run-pass/unique-copy-box.rs @@ -8,16 +8,16 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#[allow(unused_variable)]; + use std::sys; pub fn main() { - unsafe { - let i = ~@1; - let j = ~@2; - let rc1 = sys::refcount(*i); - let j = i.clone(); - let rc2 = sys::refcount(*i); - error!("rc1: %u rc2: %u", rc1, rc2); - assert_eq!(rc1 + 1u, rc2); - } + let i = ~@1; + let j = ~@2; + let rc1 = sys::refcount(*i); + let j = i.clone(); + let rc2 = sys::refcount(*i); + error!("rc1: %u rc2: %u", rc1, rc2); + assert_eq!(rc1 + 1u, rc2); } diff --git a/src/test/run-pass/unique-decl.rs b/src/test/run-pass/unique-decl.rs index 31c1936b05a4c..74b73d7736998 100644 --- a/src/test/run-pass/unique-decl.rs +++ b/src/test/run-pass/unique-decl.rs @@ -12,6 +12,6 @@ pub fn main() { let _: ~int; } -fn f(i: ~int) -> ~int { +fn f(_i: ~int) -> ~int { fail!(); } diff --git a/src/test/run-pass/unique-drop-complex.rs b/src/test/run-pass/unique-drop-complex.rs index aabf6c7878efe..2090352f9ce08 100644 --- a/src/test/run-pass/unique-drop-complex.rs +++ b/src/test/run-pass/unique-drop-complex.rs @@ -9,5 +9,5 @@ // except according to those terms. pub fn main() { - let x = ~~[0,0,0,0,0]; + let _x = ~~[0,0,0,0,0]; } diff --git a/src/test/run-pass/unique-init.rs b/src/test/run-pass/unique-init.rs index 5514525584000..6a87dd30f7a78 100644 --- a/src/test/run-pass/unique-init.rs +++ b/src/test/run-pass/unique-init.rs @@ -9,5 +9,5 @@ // except according to those terms. pub fn main() { - let i = ~100; + let _i = ~100; } diff --git a/src/test/run-pass/unique-move-drop.rs b/src/test/run-pass/unique-move-drop.rs index 29267956a59f4..cbef0044f8cf8 100644 --- a/src/test/run-pass/unique-move-drop.rs +++ b/src/test/run-pass/unique-move-drop.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#[allow(unused_variable)]; + pub fn main() { let i = ~100; let j = ~200; diff --git a/src/test/run-pass/unique-object-move.rs b/src/test/run-pass/unique-object-move.rs index 540de1652138b..f6a4674136671 100644 --- a/src/test/run-pass/unique-object-move.rs +++ b/src/test/run-pass/unique-object-move.rs @@ -20,5 +20,5 @@ impl EventLoop for UvEventLoop { } pub fn main() { let loop_: ~EventLoop = ~UvEventLoop { uvio: 0 } as ~EventLoop; - let loop2_ = loop_; -} \ No newline at end of file + let _loop2_ = loop_; +} diff --git a/src/test/run-pass/unique-pinned-nocopy-2.rs b/src/test/run-pass/unique-pinned-nocopy-2.rs index b0ad7f50420a1..7b604bb7857c9 100644 --- a/src/test/run-pass/unique-pinned-nocopy-2.rs +++ b/src/test/run-pass/unique-pinned-nocopy-2.rs @@ -15,9 +15,7 @@ struct r { #[unsafe_destructor] impl Drop for r { fn drop(&self) { - unsafe { - *(self.i) = *(self.i) + 1; - } + *(self.i) = *(self.i) + 1; } } @@ -30,7 +28,7 @@ fn r(i: @mut int) -> r { pub fn main() { let i = @mut 0; { - let j = ~r(i); + let _j = ~r(i); } assert_eq!(*i, 1); } diff --git a/src/test/run-pass/unique-send.rs b/src/test/run-pass/unique-send.rs index 05012f789c38f..a7d2f6a16a176 100644 --- a/src/test/run-pass/unique-send.rs +++ b/src/test/run-pass/unique-send.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::comm::*; - pub fn main() { let (p, c) = stream(); c.send(~100); diff --git a/src/test/run-pass/unit.rs b/src/test/run-pass/unit.rs index 78510a5745975..a74bfc365e864 100644 --- a/src/test/run-pass/unit.rs +++ b/src/test/run-pass/unit.rs @@ -8,8 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. - - +#[allow(unused_variable)]; +#[allow(dead_assignment)]; // -*- rust -*- fn f(u: ()) { return u; } diff --git a/src/test/run-pass/unnamed_argument_mode.rs b/src/test/run-pass/unnamed_argument_mode.rs index 649f424ec36be..c52658542f05b 100644 --- a/src/test/run-pass/unnamed_argument_mode.rs +++ b/src/test/run-pass/unnamed_argument_mode.rs @@ -1,11 +1,11 @@ -fn good(a: &int) { +fn good(_a: &int) { } // unnamed argument &int is now parse x: &int -fn called(f: &fn(&int)) { +fn called(_f: &fn(&int)) { } pub fn main() { -called(good); + called(good); } diff --git a/src/test/run-pass/unreachable-code-1.rs b/src/test/run-pass/unreachable-code-1.rs index 9c658fdc25276..d1896a258c634 100644 --- a/src/test/run-pass/unreachable-code-1.rs +++ b/src/test/run-pass/unreachable-code-1.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#[allow(unreachable_code)]; +#[allow(unused_variable)]; fn id(x: bool) -> bool { x } diff --git a/src/test/run-pass/unreachable-code.rs b/src/test/run-pass/unreachable-code.rs index 153df44e2ef31..2c65e2283e8ed 100644 --- a/src/test/run-pass/unreachable-code.rs +++ b/src/test/run-pass/unreachable-code.rs @@ -8,6 +8,9 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#[allow(path_statement)]; +#[allow(unreachable_code)]; +#[allow(unused_variable)]; fn id(x: bool) -> bool { x } diff --git a/src/test/run-pass/unused-move-capture.rs b/src/test/run-pass/unused-move-capture.rs index 62023fdae53b5..dd70b7daa7005 100644 --- a/src/test/run-pass/unused-move-capture.rs +++ b/src/test/run-pass/unused-move-capture.rs @@ -9,7 +9,7 @@ // except according to those terms. pub fn main() { - let x = ~1; + let _x = ~1; let lam_move: @fn() = || {}; lam_move(); } diff --git a/src/test/run-pass/unused-move.rs b/src/test/run-pass/unused-move.rs index 69ce791c1a35a..375e8664781d9 100644 --- a/src/test/run-pass/unused-move.rs +++ b/src/test/run-pass/unused-move.rs @@ -12,6 +12,8 @@ // Issue Name: Unused move causes a crash // Abstract: zero-fill to block after drop +#[allow(path_statement)]; + pub fn main() { let y = ~1; diff --git a/src/test/run-pass/unwind-box.rs b/src/test/run-pass/unwind-box.rs index 2d0967a6fa360..2d21f7e8f98ee 100644 --- a/src/test/run-pass/unwind-box.rs +++ b/src/test/run-pass/unwind-box.rs @@ -14,7 +14,7 @@ extern mod extra; use std::task; fn f() { - let a = @0; + let _a = @0; fail!(); } diff --git a/src/test/run-pass/unwind-resource2.rs b/src/test/run-pass/unwind-resource2.rs index 841fb37d29d50..e2023bc5f2170 100644 --- a/src/test/run-pass/unwind-resource2.rs +++ b/src/test/run-pass/unwind-resource2.rs @@ -29,7 +29,7 @@ fn complainer(c: @int) -> complainer { } fn f() { - let c = complainer(@0); + let _c = complainer(@0); fail!(); } diff --git a/src/test/run-pass/unwind-unique.rs b/src/test/run-pass/unwind-unique.rs index ba75676298b4e..85b4c0b9b47ed 100644 --- a/src/test/run-pass/unwind-unique.rs +++ b/src/test/run-pass/unwind-unique.rs @@ -14,7 +14,7 @@ extern mod extra; use std::task; fn f() { - let a = ~0; + let _a = ~0; fail!(); } diff --git a/src/test/run-pass/use-uninit-match.rs b/src/test/run-pass/use-uninit-match.rs index 3bfe7d76ce8b0..4e0e5347d4d22 100644 --- a/src/test/run-pass/use-uninit-match.rs +++ b/src/test/run-pass/use-uninit-match.rs @@ -12,7 +12,10 @@ fn foo(o: myoption) -> int { let mut x: int = 5; - match o { none:: => { } some::(t) => { x += 1; } } + match o { + none:: => { } + some::(_t) => { x += 1; } + } return x; } diff --git a/src/test/run-pass/use-uninit-match2.rs b/src/test/run-pass/use-uninit-match2.rs index ea627a7c7602b..46d3bef86b5c1 100644 --- a/src/test/run-pass/use-uninit-match2.rs +++ b/src/test/run-pass/use-uninit-match2.rs @@ -12,7 +12,10 @@ fn foo(o: myoption) -> int { let mut x: int; - match o { none:: => { fail!(); } some::(t) => { x = 5; } } + match o { + none:: => { fail!(); } + some::(_t) => { x = 5; } + } return x; } diff --git a/src/test/run-pass/use.rs b/src/test/run-pass/use.rs index e23fccb28f151..e84ed47333b73 100644 --- a/src/test/run-pass/use.rs +++ b/src/test/run-pass/use.rs @@ -10,6 +10,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#[allow(unused_imports)]; + #[no_std]; extern mod std; extern mod zed(name = "std"); diff --git a/src/test/run-pass/utf8_chars.rs b/src/test/run-pass/utf8_chars.rs index 556d7dd521c96..881606d673cbf 100644 --- a/src/test/run-pass/utf8_chars.rs +++ b/src/test/run-pass/utf8_chars.rs @@ -11,7 +11,6 @@ extern mod extra; use std::str; -use std::vec; pub fn main() { // Chars of 1, 2, 3, and 4 bytes @@ -28,19 +27,19 @@ pub fn main() { assert!((str::is_utf8(s.as_bytes()))); // invalid prefix - assert!((!str::is_utf8(~[0x80_u8]))); + assert!((!str::is_utf8([0x80_u8]))); // invalid 2 byte prefix - assert!((!str::is_utf8(~[0xc0_u8]))); - assert!((!str::is_utf8(~[0xc0_u8, 0x10_u8]))); + assert!((!str::is_utf8([0xc0_u8]))); + assert!((!str::is_utf8([0xc0_u8, 0x10_u8]))); // invalid 3 byte prefix - assert!((!str::is_utf8(~[0xe0_u8]))); - assert!((!str::is_utf8(~[0xe0_u8, 0x10_u8]))); - assert!((!str::is_utf8(~[0xe0_u8, 0xff_u8, 0x10_u8]))); + assert!((!str::is_utf8([0xe0_u8]))); + assert!((!str::is_utf8([0xe0_u8, 0x10_u8]))); + assert!((!str::is_utf8([0xe0_u8, 0xff_u8, 0x10_u8]))); // invalid 4 byte prefix - assert!((!str::is_utf8(~[0xf0_u8]))); - assert!((!str::is_utf8(~[0xf0_u8, 0x10_u8]))); - assert!((!str::is_utf8(~[0xf0_u8, 0xff_u8, 0x10_u8]))); - assert!((!str::is_utf8(~[0xf0_u8, 0xff_u8, 0xff_u8, 0x10_u8]))); + assert!((!str::is_utf8([0xf0_u8]))); + assert!((!str::is_utf8([0xf0_u8, 0x10_u8]))); + assert!((!str::is_utf8([0xf0_u8, 0xff_u8, 0x10_u8]))); + assert!((!str::is_utf8([0xf0_u8, 0xff_u8, 0xff_u8, 0x10_u8]))); let mut stack = ~"a×c€"; assert_eq!(stack.pop_char(), '€'); diff --git a/src/test/run-pass/vec-drop.rs b/src/test/run-pass/vec-drop.rs index 16cca5cd6cf4d..d387d7820a437 100644 --- a/src/test/run-pass/vec-drop.rs +++ b/src/test/run-pass/vec-drop.rs @@ -15,6 +15,6 @@ struct Pair { x: int, y: int } pub fn main() { // This just tests whether the vec leaks its members. - let pvec: ~[@Pair] = + let _pvec: ~[@Pair] = ~[@Pair{x: 1, y: 2}, @Pair{x: 3, y: 4}, @Pair{x: 5, y: 6}]; } diff --git a/src/test/run-pass/vec-ivec-deadlock.rs b/src/test/run-pass/vec-ivec-deadlock.rs index 8b6e037e84013..ccc7768469dd1 100644 --- a/src/test/run-pass/vec-ivec-deadlock.rs +++ b/src/test/run-pass/vec-ivec-deadlock.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#[allow(dead_assignment)]; + pub fn main() { let a = ~[1, 2, 3, 4, 5]; let mut b = ~[a.clone(), a.clone()]; diff --git a/src/test/run-pass/vec-matching-autoslice.rs b/src/test/run-pass/vec-matching-autoslice.rs index 13a8e324d4306..2ad21aba6cdd8 100644 --- a/src/test/run-pass/vec-matching-autoslice.rs +++ b/src/test/run-pass/vec-matching-autoslice.rs @@ -17,6 +17,6 @@ pub fn main() { assert_eq!(b, 2); assert!(tail.is_empty()); } - ([..tail], _) => fail!() + ([.._tail], _) => fail!() } } diff --git a/src/test/run-pass/vec-slice-drop.rs b/src/test/run-pass/vec-slice-drop.rs index 54626e52d23e0..85293405695e6 100644 --- a/src/test/run-pass/vec-slice-drop.rs +++ b/src/test/run-pass/vec-slice-drop.rs @@ -16,9 +16,7 @@ struct foo { #[unsafe_destructor] impl Drop for foo { fn drop(&self) { - unsafe { - *self.x += 1; - } + *self.x += 1; } } diff --git a/src/test/run-pass/vec-tail-matching.rs b/src/test/run-pass/vec-tail-matching.rs index 6a60308f2e70f..2785270569f3d 100644 --- a/src/test/run-pass/vec-tail-matching.rs +++ b/src/test/run-pass/vec-tail-matching.rs @@ -16,7 +16,7 @@ pub fn main() { assert!(tail[1].string == ~"baz"); match tail { - [Foo { _ }, _, Foo { _ }, ..tail] => { + [Foo { _ }, _, Foo { _ }, .. _tail] => { ::std::util::unreachable(); } [Foo { string: ref a }, Foo { string: ref b }] => { diff --git a/src/test/run-pass/vector-no-ann-2.rs b/src/test/run-pass/vector-no-ann-2.rs index f73b75b2f4ca6..60124a79fcb4b 100644 --- a/src/test/run-pass/vector-no-ann-2.rs +++ b/src/test/run-pass/vector-no-ann-2.rs @@ -8,4 +8,4 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -pub fn main() { let quux: @~[uint] = @~[]; } +pub fn main() { let _quux: @~[uint] = @~[]; } diff --git a/src/test/run-pass/weird-exprs.rs b/src/test/run-pass/weird-exprs.rs index 565188829d6b9..7c20f9823d9f0 100644 --- a/src/test/run-pass/weird-exprs.rs +++ b/src/test/run-pass/weird-exprs.rs @@ -71,7 +71,7 @@ fn angrydome() { break; } } -fn evil_lincoln() { let evil = info!("lincoln"); } +fn evil_lincoln() { let _evil = info!("lincoln"); } pub fn main() { strange(); diff --git a/src/test/run-pass/while-flow-graph.rs b/src/test/run-pass/while-flow-graph.rs index 2e9fb981be4bc..36d902dc2e020 100644 --- a/src/test/run-pass/while-flow-graph.rs +++ b/src/test/run-pass/while-flow-graph.rs @@ -10,4 +10,4 @@ -pub fn main() { let x: int = 10; while x == 10 && x == 11 { let y = 0xf00; } } +pub fn main() { let x: int = 10; while x == 10 && x == 11 { let _y = 0xf00; } } diff --git a/src/test/run-pass/while-loop-constraints-2.rs b/src/test/run-pass/while-loop-constraints-2.rs index de87a40a61f7e..fb629a8deae2b 100644 --- a/src/test/run-pass/while-loop-constraints-2.rs +++ b/src/test/run-pass/while-loop-constraints-2.rs @@ -8,8 +8,10 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -pub fn main() { +#[allow(dead_assignment)]; +#[allow(unused_variable)]; +pub fn main() { let mut y: int = 42; let mut z: int = 42; let mut x: int; diff --git a/src/test/run-pass/while-with-break.rs b/src/test/run-pass/while-with-break.rs index a7ab011f8e143..185b686c24ebd 100644 --- a/src/test/run-pass/while-with-break.rs +++ b/src/test/run-pass/while-with-break.rs @@ -8,7 +8,7 @@ pub fn main() { info!(i); i = i + 1; if i == 95 { - let v: ~[int] = + let _v: ~[int] = ~[1, 2, 3, 4, 5]; // we check that it is freed by break info!("breaking"); diff --git a/src/test/run-pass/x86stdcall2.rs b/src/test/run-pass/x86stdcall2.rs index a0159e7413edc..395aca5f8edb8 100644 --- a/src/test/run-pass/x86stdcall2.rs +++ b/src/test/run-pass/x86stdcall2.rs @@ -14,10 +14,10 @@ pub type SIZE_T = u32; pub type LPVOID = uint; pub type BOOL = u8; +#[cfg(target_os = "win32")] mod kernel32 { use super::{HANDLE, DWORD, SIZE_T, LPVOID, BOOL}; - #[cfg(target_os = "win32")] #[abi = "stdcall"] extern "stdcall" { pub fn GetProcessHeap() -> HANDLE; diff --git a/src/test/run-pass/xcrate-unit-struct.rs b/src/test/run-pass/xcrate-unit-struct.rs index d6522231f65fa..79740c7b5a5b2 100644 --- a/src/test/run-pass/xcrate-unit-struct.rs +++ b/src/test/run-pass/xcrate-unit-struct.rs @@ -12,8 +12,6 @@ // xfail-fast extern mod xcrate_unit_struct; -use std::util; - static s1: xcrate_unit_struct::Struct = xcrate_unit_struct::Struct; static s2: xcrate_unit_struct::Unit = xcrate_unit_struct::Unit; static s3: xcrate_unit_struct::Unit = From cc567085c0121c226d7385027759df6160436bc0 Mon Sep 17 00:00:00 2001 From: Erick Tryzelaar Date: Sat, 17 Aug 2013 08:37:12 -0700 Subject: [PATCH 4/4] Deny warnings in stage1+ libsyntax/librustc/librustdoc/librusti/librust --- mk/target.mk | 4 ++-- mk/tools.mk | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/mk/target.mk b/mk/target.mk index fce6e8a9e2fcc..0d798f4cc1b4c 100644 --- a/mk/target.mk +++ b/mk/target.mk @@ -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 @@ -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)): \ diff --git a/mk/tools.mk b/mk/tools.mk index 32c034d878cb9..09c3de014782d 100644 --- a/mk/tools.mk +++ b/mk/tools.mk @@ -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)): \ @@ -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)): \ @@ -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)): \