From 4445b38df27777b043cad9ecc2452daad3469949 Mon Sep 17 00:00:00 2001 From: Nick Desaulniers Date: Mon, 11 Feb 2013 19:26:38 -0800 Subject: [PATCH] Remove die!, raplace invocations with fail! Issue #4524 pt 3 --- src/compiletest/compiletest.rc | 6 +- src/compiletest/header.rs | 2 +- src/compiletest/procsrv.rs | 4 +- src/compiletest/runtest.rs | 8 +- src/libcargo/cargo.rc | 30 +++--- src/libcargo/pgp.rs | 4 +- src/libcore/char.rs | 4 +- src/libcore/condition.rs | 2 +- src/libcore/dlist.rs | 28 +++--- src/libcore/dvec.rs | 8 +- src/libcore/either.rs | 6 +- src/libcore/extfmt.rs | 2 +- src/libcore/hash.rs | 2 +- src/libcore/hashmap.rs | 6 +- src/libcore/io.rs | 14 +-- src/libcore/iter-trait/dlist.rs | 4 +- src/libcore/iter.rs | 4 +- src/libcore/mutable.rs | 4 +- src/libcore/num/f32.rs | 2 +- src/libcore/num/f64.rs | 2 +- src/libcore/num/float.rs | 14 +-- src/libcore/num/int-template.rs | 10 +- src/libcore/num/num.rs | 14 +-- src/libcore/num/uint-template.rs | 10 +- src/libcore/option.rs | 10 +- src/libcore/os.rs | 2 +- src/libcore/pipes.rs | 26 ++--- src/libcore/private.rs | 7 +- src/libcore/private/finally.rs | 2 +- src/libcore/private/global.rs | 6 +- src/libcore/private/weak_task.rs | 4 +- src/libcore/repr.rs | 8 +- src/libcore/result.rs | 10 +- src/libcore/run.rs | 10 +- src/libcore/str.rs | 10 +- src/libcore/task/local_data.rs | 10 +- src/libcore/task/mod.rs | 44 ++++----- src/libcore/task/spawn.rs | 10 +- src/libcore/util.rs | 2 +- src/libcore/vec.rs | 82 ++++++++-------- src/libfuzzer/fuzzer.rc | 2 +- src/libfuzzer/rand_util.rs | 2 +- src/librustc/back/link.rs | 2 +- src/librustc/back/rpath.rs | 2 +- src/librustc/driver/driver.rs | 8 +- src/librustc/lib/llvm.rs | 2 +- src/librustc/metadata/decoder.rs | 22 ++--- src/librustc/metadata/encoder.rs | 8 +- src/librustc/metadata/filesearch.rs | 4 +- src/librustc/metadata/loader.rs | 4 +- src/librustc/metadata/tydecode.rs | 26 ++--- src/librustc/metadata/tyencode.rs | 2 +- src/librustc/middle/astencode.rs | 6 +- src/librustc/middle/check_const.rs | 2 +- src/librustc/middle/check_match.rs | 20 ++-- src/librustc/middle/const_eval.rs | 4 +- src/librustc/middle/freevars.rs | 4 +- src/librustc/middle/kind.rs | 2 +- src/librustc/middle/lint.rs | 8 +- src/librustc/middle/resolve.rs | 34 +++---- src/librustc/middle/trans/_match.rs | 4 +- src/librustc/middle/trans/base.rs | 14 +-- src/librustc/middle/trans/build.rs | 2 +- src/librustc/middle/trans/cabi_x86_64.rs | 8 +- src/librustc/middle/trans/callee.rs | 2 +- src/librustc/middle/trans/debuginfo.rs | 6 +- src/librustc/middle/trans/foreign.rs | 4 +- src/librustc/middle/trans/meth.rs | 28 +++--- src/librustc/middle/trans/reachable.rs | 2 +- src/librustc/middle/trans/type_use.rs | 2 +- src/librustc/middle/ty.rs | 25 ++--- src/librustc/middle/typeck/check/method.rs | 2 +- src/librustc/middle/typeck/check/mod.rs | 4 +- src/librustc/middle/typeck/check/vtable.rs | 2 +- src/librustc/middle/typeck/coherence.rs | 2 +- src/librustc/middle/typeck/collect.rs | 4 +- src/librustc/middle/typeck/infer/test.rs | 14 +-- src/librustc/rustc.rc | 2 +- src/librustdoc/attr_pass.rs | 6 +- src/librustdoc/demo.rs | 4 +- src/librustdoc/extract.rs | 2 +- src/librustdoc/markdown_pass.rs | 2 +- src/librustdoc/markdown_writer.rs | 4 +- src/librustdoc/tystr_pass.rs | 22 ++--- src/librusti/rusti.rc | 6 +- src/libstd/arc.rs | 8 +- src/libstd/arena.rs | 2 +- src/libstd/base64.rs | 8 +- src/libstd/bigint.rs | 18 ++-- src/libstd/bitv.rs | 6 +- src/libstd/cell.rs | 4 +- src/libstd/deque.rs | 2 +- src/libstd/ebml.rs | 38 ++++---- src/libstd/flatpipes.rs | 6 +- src/libstd/future.rs | 6 +- src/libstd/getopts.rs | 96 +++++++++---------- src/libstd/json.rs | 40 ++++---- src/libstd/list.rs | 4 +- src/libstd/net_ip.rs | 14 +-- src/libstd/net_tcp.rs | 20 ++-- src/libstd/oldmap.rs | 2 +- src/libstd/oldsmallintmap.rs | 2 +- src/libstd/rope.rs | 12 +-- src/libstd/serialize.rs | 2 +- src/libstd/sha1.rs | 2 +- src/libstd/sort.rs | 14 +-- src/libstd/sync.rs | 16 ++-- src/libstd/test.rs | 14 +-- src/libstd/time.rs | 4 +- src/libstd/timer.rs | 6 +- src/libstd/uv_global_loop.rs | 4 +- src/libstd/workcache.rs | 2 +- src/libsyntax/ast.rs | 4 +- src/libsyntax/ast_map.rs | 4 +- src/libsyntax/ast_util.rs | 6 +- src/libsyntax/attr.rs | 2 +- src/libsyntax/codemap.rs | 4 +- src/libsyntax/diagnostic.rs | 4 +- src/libsyntax/ext/auto_encode.rs | 10 +- src/libsyntax/ext/expand.rs | 6 +- src/libsyntax/ext/pipes/parse_proto.rs | 4 +- src/libsyntax/ext/quote.rs | 8 +- src/libsyntax/ext/tt/macro_parser.rs | 6 +- src/libsyntax/parse/comments.rs | 4 +- src/libsyntax/parse/lexer.rs | 2 +- src/libsyntax/parse/parser.rs | 4 +- src/libsyntax/parse/token.rs | 4 +- src/libsyntax/print/pp.rs | 2 +- src/libsyntax/print/pprust.rs | 16 ++-- src/libsyntax/util/testing.rs | 4 +- src/test/auxiliary/cci_nested_lib.rs | 2 +- src/test/auxiliary/issue2378a.rs | 2 +- src/test/auxiliary/issue_2723_a.rs | 2 +- src/test/auxiliary/static-methods-crate.rs | 2 +- src/test/bench/graph500-bfs.rs | 4 +- src/test/bench/pingpong.rs | 4 +- src/test/bench/shootout-chameneos-redux.rs | 2 +- src/test/bench/shootout-pfib.rs | 2 +- src/test/bench/sudoku.rs | 2 +- src/test/bench/task-perf-alloc-unwind.rs | 2 +- .../bench/task-perf-jargon-metal-smoke.rs | 2 +- src/test/bench/task-perf-linked-failure.rs | 2 +- src/test/compile-fail/alt-join.rs | 2 +- src/test/compile-fail/bad-bang-ann.rs | 2 +- ...her-can-live-while-the-other-survives-1.rs | 2 +- ...her-can-live-while-the-other-survives-2.rs | 2 +- ...her-can-live-while-the-other-survives-3.rs | 2 +- ...her-can-live-while-the-other-survives-4.rs | 2 +- .../compile-fail/bind-by-move-no-guards.rs | 4 +- .../compile-fail/bind-by-move-no-lvalues-1.rs | 2 +- .../compile-fail/bind-by-move-no-lvalues-2.rs | 2 +- .../bind-by-move-no-sub-bindings.rs | 2 +- .../compile-fail/borrowck-autoref-3261.rs | 2 +- ...borrowck-loan-local-as-both-mut-and-imm.rs | 2 +- .../compile-fail/borrowck-ref-into-rvalue.rs | 2 +- .../borrowck-vec-pattern-element-loan.rs | 2 +- .../borrowck-vec-pattern-nesting.rs | 2 +- .../borrowck-vec-pattern-tail-element-loan.rs | 2 +- src/test/compile-fail/closure-that-fails.rs | 2 +- src/test/compile-fail/deref-non-pointer.rs | 2 +- src/test/compile-fail/die-not-unique.rs | 2 +- src/test/compile-fail/fail-expr.rs | 2 +- src/test/compile-fail/fail-simple.rs | 2 +- src/test/compile-fail/fail-type-err.rs | 2 +- src/test/compile-fail/issue-2149.rs | 2 +- src/test/compile-fail/issue-2150.rs | 2 +- src/test/compile-fail/issue-2151.rs | 2 +- src/test/compile-fail/issue-2330.rs | 2 +- src/test/compile-fail/issue-2354.rs | 4 +- src/test/compile-fail/issue-2611-3.rs | 2 +- src/test/compile-fail/issue-2611-4.rs | 2 +- src/test/compile-fail/issue-2611-5.rs | 2 +- src/test/compile-fail/issue-2817.rs | 8 +- src/test/compile-fail/issue-3021.rs | 2 +- src/test/compile-fail/issue-3601.rs | 2 +- src/test/compile-fail/issue-3668.rs | 2 +- src/test/compile-fail/issue-897-2.rs | 2 +- src/test/compile-fail/issue-897.rs | 2 +- .../compile-fail/liveness-use-after-send.rs | 4 +- .../compile-fail/moves-based-on-type-exprs.rs | 2 +- .../non-exhaustive-match-nested.rs | 4 +- .../compile-fail/noncopyable-match-pattern.rs | 2 +- src/test/compile-fail/not-enough-arguments.rs | 2 +- src/test/compile-fail/pattern-tyvar-2.rs | 2 +- src/test/compile-fail/pattern-tyvar.rs | 2 +- src/test/compile-fail/qquote-1.rs | 2 +- src/test/compile-fail/qquote-2.rs | 2 +- src/test/compile-fail/regions-fn-bound.rs | 4 +- src/test/compile-fail/regions-fn-subtyping.rs | 4 +- .../tag-that-dare-not-speak-its-name.rs | 2 +- src/test/compile-fail/tag-type-args.rs | 2 +- .../compile-fail/warn-foreign-int-types.rs | 2 +- src/test/pretty/issue-929.rs | 2 +- src/test/run-fail/alt-bot-fail.rs | 2 +- src/test/run-fail/alt-disc-bot.rs | 2 +- src/test/run-fail/alt-wildcards.rs | 6 +- src/test/run-fail/args-fail.rs | 4 +- src/test/run-fail/binop-fail-2.rs | 2 +- src/test/run-fail/binop-fail.rs | 2 +- src/test/run-fail/bug-811.rs | 4 +- src/test/run-fail/die-macro-expr.rs | 2 +- src/test/run-fail/die-macro-pure.rs | 2 +- src/test/run-fail/die-macro.rs | 2 +- src/test/run-fail/doublefail.rs | 4 +- src/test/run-fail/explicit-fail-msg.rs | 2 +- src/test/run-fail/explicit-fail.rs | 2 +- src/test/run-fail/expr-alt-fail-fn.rs | 2 +- src/test/run-fail/expr-alt-fail.rs | 2 +- src/test/run-fail/expr-fn-fail.rs | 2 +- src/test/run-fail/expr-if-fail-fn.rs | 2 +- src/test/run-fail/expr-if-fail.rs | 2 +- src/test/run-fail/extern-fail.rs | 2 +- src/test/run-fail/fail-arg.rs | 2 +- src/test/run-fail/fail-main.rs | 2 +- src/test/run-fail/fail-parens.rs | 4 +- src/test/run-fail/fmt-fail.rs | 2 +- src/test/run-fail/for-each-loop-fail.rs | 2 +- src/test/run-fail/if-check-fail.rs | 2 +- src/test/run-fail/if-cond-bot.rs | 2 +- src/test/run-fail/issue-1459.rs | 2 +- src/test/run-fail/issue-2156.rs | 2 +- src/test/run-fail/issue-2272.rs | 2 +- src/test/run-fail/issue-2444.rs | 2 +- src/test/run-fail/issue-3029.rs | 2 +- src/test/run-fail/issue-948.rs | 2 +- src/test/run-fail/linked-failure2.rs | 2 +- src/test/run-fail/linked-failure3.rs | 2 +- src/test/run-fail/morestack1.rs | 2 +- src/test/run-fail/morestack2.rs | 2 +- src/test/run-fail/morestack3.rs | 2 +- src/test/run-fail/morestack4.rs | 2 +- src/test/run-fail/rhs-type.rs | 2 +- src/test/run-fail/rt-log-trunc.rs | 2 +- src/test/run-fail/rt-set-exit-status-fail.rs | 2 +- src/test/run-fail/rt-set-exit-status-fail2.rs | 2 +- src/test/run-fail/run-unexported-tests.rs | 2 +- src/test/run-fail/spawnfail.rs | 2 +- src/test/run-fail/task-comm-recv-block.rs | 4 +- src/test/run-fail/unique-fail.rs | 2 +- src/test/run-fail/unwind-alt.rs | 2 +- src/test/run-fail/unwind-box-fn-unique.rs | 2 +- src/test/run-fail/unwind-box-fn.rs | 2 +- src/test/run-fail/unwind-box-res.rs | 2 +- src/test/run-fail/unwind-box-str.rs | 2 +- src/test/run-fail/unwind-box-trait.rs | 2 +- src/test/run-fail/unwind-box-unique-unique.rs | 2 +- src/test/run-fail/unwind-box-unique.rs | 2 +- src/test/run-fail/unwind-box-vec.rs | 2 +- src/test/run-fail/unwind-box.rs | 2 +- src/test/run-fail/unwind-closure.rs | 2 +- src/test/run-fail/unwind-fail.rs | 2 +- .../run-fail/unwind-initializer-indirect.rs | 2 +- src/test/run-fail/unwind-initializer.rs | 2 +- src/test/run-fail/unwind-interleaved.rs | 2 +- src/test/run-fail/unwind-iter.rs | 2 +- src/test/run-fail/unwind-iter2.rs | 2 +- src/test/run-fail/unwind-lambda.rs | 2 +- src/test/run-fail/unwind-misc-1.rs | 2 +- src/test/run-fail/unwind-move.rs | 2 +- src/test/run-fail/unwind-nested.rs | 2 +- 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-resource-fail2.rs | 4 +- src/test/run-fail/unwind-resource-fail3.rs | 2 +- src/test/run-fail/unwind-stacked.rs | 2 +- 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/unwind-unique.rs | 2 +- src/test/run-fail/while-body-fails.rs | 2 +- src/test/run-fail/while-fail.rs | 2 +- src/test/run-fail/zip-different-lengths.rs | 2 +- src/test/run-pass/alt-bot-2.rs | 2 +- src/test/run-pass/alt-bot.rs | 2 +- src/test/run-pass/alt-pattern-drop.rs | 2 +- src/test/run-pass/alt-pattern-lit.rs | 2 +- src/test/run-pass/alt-range.rs | 16 ++-- .../run-pass/alt-ref-binding-in-guard-3256.rs | 2 +- src/test/run-pass/alt-str.rs | 12 +-- src/test/run-pass/attr-main-2.rs | 2 +- .../run-pass/binary-minus-without-space.rs | 2 +- src/test/run-pass/bind-by-move.rs | 2 +- src/test/run-pass/block-arg.rs | 4 +- .../run-pass/boxed-class-type-substitution.rs | 2 +- .../class-impl-very-parameterized-trait.rs | 2 +- src/test/run-pass/cleanup-copy-mode.rs | 2 +- src/test/run-pass/conditional-compile.rs | 4 +- src/test/run-pass/const-big-enum.rs | 6 +- src/test/run-pass/const-enum-byref-self.rs | 2 +- src/test/run-pass/const-enum-byref.rs | 2 +- src/test/run-pass/const-enum-ptr.rs | 2 +- src/test/run-pass/const-enum-vec-index.rs | 4 +- src/test/run-pass/const-enum-vec-ptr.rs | 4 +- src/test/run-pass/const-enum-vector.rs | 4 +- src/test/run-pass/const-nullary-enum.rs | 4 +- src/test/run-pass/die-macro.rs | 6 +- src/test/run-pass/expr-alt-box.rs | 4 +- src/test/run-pass/expr-alt-fail-all.rs | 2 +- src/test/run-pass/expr-alt-fail.rs | 4 +- src/test/run-pass/expr-alt-generic-box1.rs | 2 +- src/test/run-pass/expr-alt-generic-box2.rs | 2 +- src/test/run-pass/expr-alt-generic-unique1.rs | 2 +- src/test/run-pass/expr-alt-generic-unique2.rs | 2 +- src/test/run-pass/expr-alt-generic.rs | 2 +- src/test/run-pass/expr-alt-struct.rs | 2 +- src/test/run-pass/expr-alt-unique.rs | 2 +- src/test/run-pass/expr-if-fail-all.rs | 2 +- src/test/run-pass/expr-if-fail.rs | 6 +- src/test/run-pass/for-loop-fail.rs | 2 +- src/test/run-pass/getopts_ref.rs | 2 +- src/test/run-pass/if-bot.rs | 2 +- src/test/run-pass/if-check.rs | 2 +- src/test/run-pass/issue-1516.rs | 2 +- src/test/run-pass/issue-2311-2.rs | 2 +- src/test/run-pass/issue-2312.rs | 2 +- src/test/run-pass/issue-2718.rs | 16 ++-- src/test/run-pass/issue-2904.rs | 2 +- src/test/run-pass/issue-3168.rs | 2 +- src/test/run-pass/issue-3176.rs | 2 +- src/test/run-pass/issue-3895.rs | 2 +- src/test/run-pass/issue-4016.rs | 2 +- src/test/run-pass/iter-eachi.rs | 2 +- src/test/run-pass/last-use-in-block.rs | 2 +- src/test/run-pass/lots-a-fail.rs | 2 +- src/test/run-pass/macro-interpolation.rs | 2 +- src/test/run-pass/negative.rs | 2 +- src/test/run-pass/nested-alts.rs | 2 +- src/test/run-pass/nested-class.rs | 2 +- src/test/run-pass/nested-pattern.rs | 2 +- src/test/run-pass/nested-patterns.rs | 2 +- src/test/run-pass/option-unwrap.rs | 2 +- src/test/run-pass/parse-fail.rs | 2 +- src/test/run-pass/pipe-bank-proto.rs | 14 +-- src/test/run-pass/pipe-detect-term.rs | 4 +- .../run-pass/pipe-presentation-examples.rs | 4 +- src/test/run-pass/pipe-select.rs | 4 +- src/test/run-pass/region-dependent-addr-of.rs | 6 +- .../region-return-interior-of-option.rs | 2 +- src/test/run-pass/regions-bot.rs | 2 +- src/test/run-pass/ret-bang.rs | 2 +- src/test/run-pass/select-macro.rs | 4 +- src/test/run-pass/send-iloop.rs | 2 +- src/test/run-pass/size-and-align.rs | 2 +- src/test/run-pass/stat.rs | 2 +- src/test/run-pass/task-killjoin-rsrc.rs | 2 +- src/test/run-pass/task-killjoin.rs | 2 +- src/test/run-pass/terminate-in-initializer.rs | 4 +- src/test/run-pass/test-runner-hides-main.rs | 2 +- src/test/run-pass/unique-containing-tag.rs | 4 +- src/test/run-pass/unique-decl.rs | 2 +- src/test/run-pass/unique-pat.rs | 2 +- src/test/run-pass/unreachable-code-1.rs | 2 +- src/test/run-pass/unreachable-code.rs | 4 +- src/test/run-pass/unwind-box.rs | 2 +- src/test/run-pass/unwind-resource.rs | 2 +- src/test/run-pass/unwind-resource2.rs | 2 +- src/test/run-pass/unwind-unique.rs | 2 +- src/test/run-pass/use-uninit-alt2.rs | 2 +- src/test/run-pass/weird-exprs.rs | 2 +- 363 files changed, 910 insertions(+), 906 deletions(-) diff --git a/src/compiletest/compiletest.rc b/src/compiletest/compiletest.rc index ccd1b899ce3..5557b113176 100644 --- a/src/compiletest/compiletest.rc +++ b/src/compiletest/compiletest.rc @@ -70,7 +70,7 @@ pub fn parse_config(args: ~[~str]) -> config { let matches = &match getopts::getopts(args_, opts) { Ok(m) => m, - Err(f) => die!(getopts::fail_str(f)) + Err(f) => fail!(getopts::fail_str(f)) }; fn opt_path(m: &getopts::Matches, nm: ~str) -> Path { @@ -133,7 +133,7 @@ pub fn str_mode(s: ~str) -> mode { ~"run-pass" => mode_run_pass, ~"pretty" => mode_pretty, ~"debug-info" => mode_debug_info, - _ => die!(~"invalid mode") + _ => fail!(~"invalid mode") } } @@ -151,7 +151,7 @@ pub fn run_tests(config: config) { let opts = test_opts(config); let tests = make_tests(config); let res = test::run_tests_console(&opts, tests); - if !res { die!(~"Some tests failed"); } + if !res { fail!(~"Some tests failed"); } } pub fn test_opts(config: config) -> test::TestOpts { diff --git a/src/compiletest/header.rs b/src/compiletest/header.rs index 5c33c66209a..6db55853f9c 100644 --- a/src/compiletest/header.rs +++ b/src/compiletest/header.rs @@ -145,7 +145,7 @@ fn parse_exec_env(line: ~str) -> Option<(~str, ~str)> { match strs.len() { 1u => (strs[0], ~""), 2u => (strs[0], strs[1]), - n => die!(fmt!("Expected 1 or 2 strings, not %u", n)) + n => fail!(fmt!("Expected 1 or 2 strings, not %u", n)) } } } diff --git a/src/compiletest/procsrv.rs b/src/compiletest/procsrv.rs index a8e4d91d89a..304266f0f79 100644 --- a/src/compiletest/procsrv.rs +++ b/src/compiletest/procsrv.rs @@ -71,7 +71,7 @@ pub fn run(lib_path: ~str, os::close(pipe_in.out); os::close(pipe_out.in); os::close(pipe_err.in); - die!(); + fail!(); } @@ -99,7 +99,7 @@ pub fn run(lib_path: ~str, (2, s) => { errs = s; } - _ => { die!() } + _ => { fail!() } }; count -= 1; }; diff --git a/src/compiletest/runtest.rs b/src/compiletest/runtest.rs index 83ab56309c1..fe03ccbb3f8 100644 --- a/src/compiletest/runtest.rs +++ b/src/compiletest/runtest.rs @@ -202,7 +202,7 @@ actual:\n\ \n", expected, actual); io::stdout().write_str(msg); - die!(); + fail!(); } } @@ -518,7 +518,7 @@ fn compose_and_run_compiler( fn ensure_dir(path: &Path) { if os::path_is_dir(path) { return; } if !os::make_dir(path, 0x1c0i32) { - die!(fmt!("can't make dir %s", path.to_str())); + fail!(fmt!("can't make dir %s", path.to_str())); } } @@ -668,7 +668,7 @@ fn maybe_dump_to_stdout(config: config, out: ~str, err: ~str) { fn error(err: ~str) { io::stdout().write_line(fmt!("\nerror: %s", err)); } -fn fatal(err: ~str) -> ! { error(err); die!(); } +fn fatal(err: ~str) -> ! { error(err); fail!(); } fn fatal_ProcRes(err: ~str, ProcRes: ProcRes) -> ! { let msg = @@ -686,5 +686,5 @@ stderr:\n\ \n", err, ProcRes.cmdline, ProcRes.stdout, ProcRes.stderr); io::stdout().write_str(msg); - die!(); + fail!(); } diff --git a/src/libcargo/cargo.rc b/src/libcargo/cargo.rc index db976b580c7..782878e05c7 100644 --- a/src/libcargo/cargo.rc +++ b/src/libcargo/cargo.rc @@ -295,7 +295,7 @@ pub fn load_link(mis: ~[@ast::meta_item]) -> (Option<~str>, _ => { } } } - _ => die!(~"load_link: meta items must be name-values") + _ => fail!(~"load_link: meta items must be name-values") } } (name, vers, uuid) @@ -332,7 +332,7 @@ pub fn load_crate(filename: &Path) -> Option { } } _ => { - die!(~"crate attributes may not contain " + + fail!(~"crate attributes may not contain " + ~"meta_words"); } } @@ -435,7 +435,7 @@ pub fn rest(s: ~str, start: uint) -> ~str { pub fn need_dir(s: &Path) { if os::path_is_dir(s) { return; } if !os::make_dir(s, 493_i32 /* oct: 755 */) { - die!(fmt!("can't make_dir %s", s.to_str())); + fail!(fmt!("can't make_dir %s", s.to_str())); } } @@ -453,14 +453,14 @@ pub fn valid_pkg_name(s: &str) -> bool { pub fn parse_source(name: ~str, j: &json::Json) -> @Source { if !valid_pkg_name(name) { - die!(fmt!("'%s' is an invalid source name", name)); + fail!(fmt!("'%s' is an invalid source name", name)); } match *j { json::Object(ref j) => { let mut url = match j.find(&~"url") { Some(&json::String(u)) => copy u, - _ => die!(~"needed 'url' field in source") + _ => fail!(~"needed 'url' field in source") }; let method = match j.find(&~"method") { Some(&json::String(u)) => copy u, @@ -485,7 +485,7 @@ pub fn parse_source(name: ~str, j: &json::Json) -> @Source { mut keyfp: keyfp, packages: DVec() }; } - _ => die!(~"needed dict value in source") + _ => fail!(~"needed dict value in source") }; } @@ -500,8 +500,8 @@ pub fn try_parse_sources(filename: &Path, debug!("source: %s", *k); } } - Ok(_) => die!(~"malformed sources.json"), - Err(e) => die!(fmt!("%s:%s", filename.to_str(), e.to_str())) + Ok(_) => fail!(~"malformed sources.json"), + Err(e) => fail!(fmt!("%s:%s", filename.to_str(), e.to_str())) } } @@ -662,7 +662,7 @@ pub fn build_cargo_options(argv: ~[~str]) -> Options { let matches = &match getopts::getopts(argv, opts()) { result::Ok(m) => m, result::Err(f) => { - die!(fmt!("%s", getopts::fail_str(f))); + fail!(fmt!("%s", getopts::fail_str(f))); } }; @@ -675,10 +675,10 @@ pub fn build_cargo_options(argv: ~[~str]) -> Options { let is_install = len > 1u && matches.free[1] == ~"install"; let is_uninstall = len > 1u && matches.free[1] == ~"uninstall"; - if G && g { die!(~"-G and -g both provided"); } + if G && g { fail!(~"-G and -g both provided"); } if !is_install && !is_uninstall && (g || G) { - die!(~"-g and -G are only valid for `install` and `uninstall|rm`"); + fail!(~"-g and -G are only valid for `install` and `uninstall|rm`"); } let mode = @@ -845,7 +845,7 @@ pub fn install_source(c: &mut Cargo, path: &Path) { } if vec::is_empty(cratefiles) { - die!(~"this doesn't look like a rust package (no .rc files)"); + fail!(~"this doesn't look like a rust package (no .rc files)"); } for cratefiles.each |cf| { @@ -889,7 +889,7 @@ pub fn install_curl(c: &mut Cargo, wd: &Path, url: ~str) { let p = run::program_output(~"curl", ~[~"-f", ~"-s", ~"-o", tarpath.to_str(), url]); if p.status != 0 { - die!(fmt!("fetch of %s failed: %s", url, p.err)); + fail!(fmt!("fetch of %s failed: %s", url, p.err)); } run::run_program(~"tar", ~[~"-x", ~"--strip-components=1", ~"-C", wd.to_str(), @@ -1123,7 +1123,7 @@ pub fn install_query(c: &mut Cargo, wd: &Path, target: ~str) { pub fn get_temp_workdir(c: &Cargo) -> Path { match tempfile::mkdtemp(&c.workdir, "cargo") { Some(wd) => wd, - None => die!(fmt!("needed temp dir: %s", + None => fail!(fmt!("needed temp dir: %s", c.workdir.to_str())) } } @@ -1138,7 +1138,7 @@ pub fn cmd_install(c: &mut Cargo) { wd.to_str()]); if status != 0 { - die!(fmt!("could not copy directory: %s", cwd.to_str())); + fail!(fmt!("could not copy directory: %s", cwd.to_str())); } install_source(c, &wd); diff --git a/src/libcargo/pgp.rs b/src/libcargo/pgp.rs index fe7808bad5d..364effcd32f 100644 --- a/src/libcargo/pgp.rs +++ b/src/libcargo/pgp.rs @@ -87,7 +87,7 @@ pub fn init(root: &Path) { p.input().write_str(signing_key()); let s = p.finish(); if s != 0 { - die!(~"pgp init failed"); + fail!(~"pgp init failed"); } } } @@ -98,7 +98,7 @@ pub fn add(root: &Path, key: &Path) { run::program_output(~"gpg", ~[~"--homedir", path.to_str(), ~"--import", key.to_str()]); if p.status != 0 { - die!(~"pgp add failed: " + p.out); + fail!(~"pgp add failed: " + p.out); } } diff --git a/src/libcore/char.rs b/src/libcore/char.rs index f7a369489d1..13e4595a77a 100644 --- a/src/libcore/char.rs +++ b/src/libcore/char.rs @@ -150,7 +150,7 @@ pub pure fn is_digit_radix(c: char, radix: uint) -> bool { #[inline] pub pure fn to_digit(c: char, radix: uint) -> Option { if radix > 36 { - die!(fmt!("to_digit: radix %? is to high (maximum 36)", radix)); + fail!(fmt!("to_digit: radix %? is to high (maximum 36)", radix)); } let val = match c { '0' .. '9' => c as uint - ('0' as uint), @@ -173,7 +173,7 @@ pub pure fn to_digit(c: char, radix: uint) -> Option { #[inline] pub pure fn from_digit(num: uint, radix: uint) -> Option { if radix > 36 { - die!(fmt!("from_digit: radix %? is to high (maximum 36)", num)); + fail!(fmt!("from_digit: radix %? is to high (maximum 36)", num)); } if num < radix { if num < 10 { diff --git a/src/libcore/condition.rs b/src/libcore/condition.rs index 8ad4ad7cd8c..fb44ff4514d 100644 --- a/src/libcore/condition.rs +++ b/src/libcore/condition.rs @@ -37,7 +37,7 @@ impl Condition { fn raise(t: T) -> U { let msg = fmt!("Unhandled condition: %s: %?", self.name, t); - self.raise_default(t, || die!(copy msg)) + self.raise_default(t, || fail!(copy msg)) } fn raise_default(t: T, default: &fn() -> U) -> U { diff --git a/src/libcore/dlist.rs b/src/libcore/dlist.rs index 5f295bdcb83..0af0ecb16aa 100644 --- a/src/libcore/dlist.rs +++ b/src/libcore/dlist.rs @@ -44,18 +44,18 @@ priv impl DListNode { match self.next { Some(neighbour) => match neighbour.prev { Some(me) => if !managed::mut_ptr_eq(self, me) { - die!(~"Asymmetric next-link in dlist node.") + fail!(~"Asymmetric next-link in dlist node.") }, - None => die!(~"One-way next-link in dlist node.") + None => fail!(~"One-way next-link in dlist node.") }, None => () } match self.prev { Some(neighbour) => match neighbour.next { Some(me) => if !managed::mut_ptr_eq(me, self) { - die!(~"Asymmetric prev-link in dlist node.") + fail!(~"Asymmetric prev-link in dlist node.") }, - None => die!(~"One-way prev-link in dlist node.") + None => fail!(~"One-way prev-link in dlist node.") }, None => () } @@ -72,7 +72,7 @@ impl DListNode { pure fn next_node(@mut self) -> @mut DListNode { match self.next_link() { Some(nobe) => nobe, - None => die!(~"This dlist node has no next neighbour.") + None => fail!(~"This dlist node has no next neighbour.") } } /// Get the previous node in the list, if there is one. @@ -84,7 +84,7 @@ impl DListNode { pure fn prev_node(@mut self) -> @mut DListNode { match self.prev_link() { Some(nobe) => nobe, - None => die!(~"This dlist node has no previous neighbour.") + None => fail!(~"This dlist node has no previous neighbour.") } } } @@ -136,21 +136,21 @@ priv impl DList { // These asserts could be stronger if we had node-root back-pointers, // but those wouldn't allow for O(1) append. if self.size == 0 { - die!(~"This dlist is empty; that node can't be on it.") + fail!(~"This dlist is empty; that node can't be on it.") } - if !nobe.linked { die!(~"That node isn't linked to any dlist.") } + if !nobe.linked { fail!(~"That node isn't linked to any dlist.") } if !((nobe.prev.is_some() || managed::mut_ptr_eq(self.hd.expect(~"headless dlist?"), nobe)) && (nobe.next.is_some() || managed::mut_ptr_eq(self.tl.expect(~"tailless dlist?"), nobe))) { - die!(~"That node isn't on this dlist.") + fail!(~"That node isn't on this dlist.") } } fn make_mine(nobe: @mut DListNode) { if nobe.prev.is_some() || nobe.next.is_some() || nobe.linked { - die!(~"Cannot insert node that's already on a dlist!") + fail!(~"Cannot insert node that's already on a dlist!") } nobe.linked = true; } @@ -322,7 +322,7 @@ impl DList { pure fn head_n(@mut self) -> @mut DListNode { match self.hd { Some(nobe) => nobe, - None => die!( + None => fail!( ~"Attempted to get the head of an empty dlist.") } } @@ -330,7 +330,7 @@ impl DList { pure fn tail_n(@mut self) -> @mut DListNode { match self.tl { Some(nobe) => nobe, - None => die!( + None => fail!( ~"Attempted to get the tail of an empty dlist.") } } @@ -344,7 +344,7 @@ impl DList { */ fn append(@mut self, them: @mut DList) { if managed::mut_ptr_eq(self, them) { - die!(~"Cannot append a dlist to itself!") + fail!(~"Cannot append a dlist to itself!") } if them.len() > 0 { self.link(self.tl, them.hd); @@ -361,7 +361,7 @@ impl DList { */ fn prepend(@mut self, them: @mut DList) { if managed::mut_ptr_eq(self, them) { - die!(~"Cannot prepend a dlist to itself!") + fail!(~"Cannot prepend a dlist to itself!") } if them.len() > 0 { self.link(them.tl, self.hd); diff --git a/src/libcore/dvec.rs b/src/libcore/dvec.rs index fe36ed15960..b0c33dc6f26 100644 --- a/src/libcore/dvec.rs +++ b/src/libcore/dvec.rs @@ -87,7 +87,7 @@ priv impl DVec { unsafe { let data: *() = cast::reinterpret_cast(&self.data); if data.is_null() { - die!(~"Recursive use of dvec"); + fail!(~"Recursive use of dvec"); } } } @@ -98,7 +98,7 @@ priv impl DVec { let mut data = cast::reinterpret_cast(&null::<()>()); data <-> self.data; let data_ptr: *() = cast::reinterpret_cast(&data); - if data_ptr.is_null() { die!(~"Recursive use of dvec"); } + if data_ptr.is_null() { fail!(~"Recursive use of dvec"); } return f(move data); } } @@ -175,7 +175,7 @@ impl DVec { let mut data = cast::reinterpret_cast(&null::<()>()); data <-> self.data; let data_ptr: *() = cast::reinterpret_cast(&data); - if data_ptr.is_null() { die!(~"Recursive use of dvec"); } + if data_ptr.is_null() { fail!(~"Recursive use of dvec"); } self.data = move ~[move t]; self.data.push_all_move(move data); } @@ -325,7 +325,7 @@ impl DVec { let length = self.len(); if length == 0 { - die!(~"attempt to retrieve the last element of an empty vector"); + fail!(~"attempt to retrieve the last element of an empty vector"); } return self.data[length - 1]; diff --git a/src/libcore/either.rs b/src/libcore/either.rs index b8f60c1a2d9..54c9f7b9879 100644 --- a/src/libcore/either.rs +++ b/src/libcore/either.rs @@ -132,7 +132,8 @@ pub pure fn unwrap_left(eith: Either) -> T { //! Retrieves the value in the left branch. Fails if the either is Right. match move eith { - Left(move x) => move x, Right(_) => die!(~"either::unwrap_left Right") + Left(move x) => move x, + Right(_) => fail!(~"either::unwrap_left Right") } } @@ -141,7 +142,8 @@ pub pure fn unwrap_right(eith: Either) -> U { //! Retrieves the value in the right branch. Fails if the either is Left. match move eith { - Right(move x) => move x, Left(_) => die!(~"either::unwrap_right Left") + Right(move x) => move x, + Left(_) => fail!(~"either::unwrap_right Left") } } diff --git a/src/libcore/extfmt.rs b/src/libcore/extfmt.rs index aa4a7546f02..3dbc3bef017 100644 --- a/src/libcore/extfmt.rs +++ b/src/libcore/extfmt.rs @@ -335,7 +335,7 @@ pub mod ct { } #[cfg(test)] - fn die(s: &str) -> ! { die!(s.to_owned()) } + fn die(s: &str) -> ! { fail!(s.to_owned()) } #[test] fn test_parse_count() { diff --git a/src/libcore/hash.rs b/src/libcore/hash.rs index e53b7d29ebe..4e391d6ee00 100644 --- a/src/libcore/hash.rs +++ b/src/libcore/hash.rs @@ -282,7 +282,7 @@ impl SipState : io::Writer { } fn seek(&self, _x: int, _s: io::SeekStyle) { - die!(); + fail!(); } fn tell(&self) -> uint { self.length diff --git a/src/libcore/hashmap.rs b/src/libcore/hashmap.rs index f8793f7e2ae..fc117f99e90 100644 --- a/src/libcore/hashmap.rs +++ b/src/libcore/hashmap.rs @@ -168,7 +168,7 @@ pub mod linear { /// True if there was no previous entry with that key fn insert_internal(&mut self, hash: uint, k: K, v: V) -> bool { match self.bucket_for_key_with_hash(hash, &k) { - TableFull => { die!(~"Internal logic error"); } + TableFull => { fail!(~"Internal logic error"); } FoundHole(idx) => { debug!("insert fresh (%?->%?) at idx %?, hash %?", k, v, idx, hash); @@ -438,7 +438,7 @@ pub mod linear { pure fn get(&self, k: &K) -> &self/V { match self.find(k) { Some(v) => v, - None => die!(fmt!("No entry found for key: %?", k)), + None => fail!(fmt!("No entry found for key: %?", k)), } } } @@ -689,7 +689,7 @@ mod test_map { assert m.find(&1).is_none(); m.insert(1, 2); match m.find(&1) { - None => die!(), + None => fail!(), Some(v) => assert *v == 2 } } diff --git a/src/libcore/io.rs b/src/libcore/io.rs index c1e47439e92..571d9344243 100644 --- a/src/libcore/io.rs +++ b/src/libcore/io.rs @@ -608,7 +608,7 @@ impl *libc::FILE: Writer { if nout != len as size_t { error!("error writing buffer"); log(error, os::last_os_error()); - die!(); + fail!(); } } } @@ -658,7 +658,7 @@ impl fd_t: Writer { if nout < 0 as ssize_t { error!("error writing buffer"); log(error, os::last_os_error()); - die!(); + fail!(); } count += nout as uint; } @@ -667,11 +667,11 @@ impl fd_t: Writer { } fn seek(&self, _offset: int, _whence: SeekStyle) { error!("need 64-bit foreign calls for seek, sorry"); - die!(); + fail!(); } fn tell(&self) -> uint { error!("need 64-bit foreign calls for tell, sorry"); - die!(); + fail!(); } fn flush(&self) -> int { 0 } fn get_type(&self) -> WriterType { @@ -1276,7 +1276,7 @@ mod tests { result::Err(copy e) => { assert e == ~"error opening not a file"; } - result::Ok(_) => die!() + result::Ok(_) => fail!() } } @@ -1317,7 +1317,7 @@ mod tests { result::Err(copy e) => { assert str::starts_with(e, "error opening"); } - result::Ok(_) => die!() + result::Ok(_) => fail!() } } @@ -1327,7 +1327,7 @@ mod tests { result::Err(copy e) => { assert str::starts_with(e, "error opening"); } - result::Ok(_) => die!() + result::Ok(_) => fail!() } } diff --git a/src/libcore/iter-trait/dlist.rs b/src/libcore/iter-trait/dlist.rs index 2c2d0938eda..5f95c00f336 100644 --- a/src/libcore/iter-trait/dlist.rs +++ b/src/libcore/iter-trait/dlist.rs @@ -39,7 +39,7 @@ mod inst { // Check (weakly) that the user didn't do a remove. if self.size == 0 { - die!(~"The dlist became empty during iteration??") + fail!(~"The dlist became empty during iteration??") } if !nobe.linked || (!((nobe.prev.is_some() @@ -48,7 +48,7 @@ mod inst { && (nobe.next.is_some() || managed::mut_ptr_eq(self.tl.expect(~"tailless dlist?"), nobe)))) { - die!(~"Removing a dlist node during iteration is forbidden!") + fail!(~"Removing a dlist node during iteration is forbidden!") } link = nobe.next_link(); } diff --git a/src/libcore/iter.rs b/src/libcore/iter.rs index f66f6b90e9e..a36fa56fc79 100644 --- a/src/libcore/iter.rs +++ b/src/libcore/iter.rs @@ -221,7 +221,7 @@ pub pure fn min>(self: &IA) -> A { } } { Some(move val) => val, - None => die!(~"min called on empty iterator") + None => fail!(~"min called on empty iterator") } } @@ -236,7 +236,7 @@ pub pure fn max>(self: &IA) -> A { } } { Some(move val) => val, - None => die!(~"max called on empty iterator") + None => fail!(~"max called on empty iterator") } } diff --git a/src/libcore/mutable.rs b/src/libcore/mutable.rs index 3c44c197f5e..49e0d0bdd8a 100644 --- a/src/libcore/mutable.rs +++ b/src/libcore/mutable.rs @@ -46,7 +46,7 @@ pub fn unwrap(m: Mut) -> T { impl Data { fn borrow_mut(op: &fn(t: &mut T) -> R) -> R { match self.mode { - Immutable => die!(fmt!("%? currently immutable", + Immutable => fail!(fmt!("%? currently immutable", self.value)), ReadOnly | Mutable => {} } @@ -62,7 +62,7 @@ impl Data { fn borrow_imm(op: &fn(t: &T) -> R) -> R { match self.mode { - Mutable => die!(fmt!("%? currently mutable", + Mutable => fail!(fmt!("%? currently mutable", self.value)), ReadOnly | Immutable => {} } diff --git a/src/libcore/num/f32.rs b/src/libcore/num/f32.rs index 6bea9e81197..eaed597dff7 100644 --- a/src/libcore/num/f32.rs +++ b/src/libcore/num/f32.rs @@ -402,7 +402,7 @@ pub pure fn to_str_hex(num: f32) -> ~str { pub pure fn to_str_radix(num: f32, rdx: uint) -> ~str { let (r, special) = num::to_str_common( &num, rdx, true, true, num::SignNeg, num::DigAll); - if special { die!(~"number has a special value, \ + if special { fail!(~"number has a special value, \ try to_str_radix_special() if those are expected") } r } diff --git a/src/libcore/num/f64.rs b/src/libcore/num/f64.rs index 75f68fdafc7..8aaa48524e2 100644 --- a/src/libcore/num/f64.rs +++ b/src/libcore/num/f64.rs @@ -427,7 +427,7 @@ pub pure fn to_str_hex(num: f64) -> ~str { pub pure fn to_str_radix(num: f64, rdx: uint) -> ~str { let (r, special) = num::to_str_common( &num, rdx, true, true, num::SignNeg, num::DigAll); - if special { die!(~"number has a special value, \ + if special { fail!(~"number has a special value, \ try to_str_radix_special() if those are expected") } r } diff --git a/src/libcore/num/float.rs b/src/libcore/num/float.rs index 74bf50737f5..c7d391bab08 100644 --- a/src/libcore/num/float.rs +++ b/src/libcore/num/float.rs @@ -143,7 +143,7 @@ pub pure fn to_str_hex(num: float) -> ~str { pub pure fn to_str_radix(num: float, radix: uint) -> ~str { let (r, special) = num::to_str_common( &num, radix, true, true, num::SignNeg, num::DigAll); - if special { die!(~"number has a special value, \ + if special { fail!(~"number has a special value, \ try to_str_radix_special() if those are expected") } r } @@ -509,16 +509,16 @@ pub fn test_from_str() { // note: NaN != NaN, hence this slightly complex test match from_str(~"NaN") { Some(f) => assert is_NaN(f), - None => die!() + None => fail!() } // note: -0 == 0, hence these slightly more complex tests match from_str(~"-0") { Some(v) if is_zero(v) => assert is_negative(v), - _ => die!() + _ => fail!() } match from_str(~"0") { Some(v) if is_zero(v) => assert is_positive(v), - _ => die!() + _ => fail!() } assert from_str(~"").is_none(); @@ -556,16 +556,16 @@ pub fn test_from_str_hex() { // note: NaN != NaN, hence this slightly complex test match from_str_hex(~"NaN") { Some(f) => assert is_NaN(f), - None => die!() + None => fail!() } // note: -0 == 0, hence these slightly more complex tests match from_str_hex(~"-0") { Some(v) if is_zero(v) => assert is_negative(v), - _ => die!() + _ => fail!() } match from_str_hex(~"0") { Some(v) if is_zero(v) => assert is_positive(v), - _ => die!() + _ => fail!() } assert from_str_hex(~"e") == Some(14.); assert from_str_hex(~"E") == Some(14.); diff --git a/src/libcore/num/int-template.rs b/src/libcore/num/int-template.rs index 4c22a8001e9..71c06bc9d24 100644 --- a/src/libcore/num/int-template.rs +++ b/src/libcore/num/int-template.rs @@ -108,7 +108,7 @@ pub pure fn is_nonnegative(x: T) -> bool { x >= 0 as T } pub pure fn range_step(start: T, stop: T, step: T, it: fn(T) -> bool) { let mut i = start; if step == 0 { - die!(~"range_step called with step == 0"); + fail!(~"range_step called with step == 0"); } else if step > 0 { // ascending while i < stop { if !it(i) { break } @@ -435,16 +435,16 @@ pub fn test_ranges() { // None of the `fail`s should execute. for range(10,0) |_i| { - die!(~"unreachable"); + fail!(~"unreachable"); } for range_rev(0,10) |_i| { - die!(~"unreachable"); + fail!(~"unreachable"); } for range_step(10,0,1) |_i| { - die!(~"unreachable"); + fail!(~"unreachable"); } for range_step(0,10,-1) |_i| { - die!(~"unreachable"); + fail!(~"unreachable"); } } diff --git a/src/libcore/num/num.rs b/src/libcore/num/num.rs index bc5a42262ca..8435a7b8ea2 100644 --- a/src/libcore/num/num.rs +++ b/src/libcore/num/num.rs @@ -260,10 +260,10 @@ pub pure fn to_str_bytes_common( num: &T, radix: uint, special: bool, negative_zero: bool, sign: SignFormat, digits: SignificantDigits) -> (~[u8], bool) { if radix as int < 2 { - die!(fmt!("to_str_bytes_common: radix %? to low, \ + fail!(fmt!("to_str_bytes_common: radix %? to low, \ must lie in the range [2, 36]", radix)); } else if radix as int > 36 { - die!(fmt!("to_str_bytes_common: radix %? to high, \ + fail!(fmt!("to_str_bytes_common: radix %? to high, \ must lie in the range [2, 36]", radix)); } @@ -539,19 +539,19 @@ pub pure fn from_str_bytes_common( ) -> Option { match exponent { ExpDec if radix >= DIGIT_E_RADIX // decimal exponent 'e' - => die!(fmt!("from_str_bytes_common: radix %? incompatible with \ + => fail!(fmt!("from_str_bytes_common: radix %? incompatible with \ use of 'e' as decimal exponent", radix)), ExpBin if radix >= DIGIT_P_RADIX // binary exponent 'p' - => die!(fmt!("from_str_bytes_common: radix %? incompatible with \ + => fail!(fmt!("from_str_bytes_common: radix %? incompatible with \ use of 'p' as binary exponent", radix)), _ if special && radix >= DIGIT_I_RADIX // first digit of 'inf' - => die!(fmt!("from_str_bytes_common: radix %? incompatible with \ + => fail!(fmt!("from_str_bytes_common: radix %? incompatible with \ special values 'inf' and 'NaN'", radix)), _ if radix as int < 2 - => die!(fmt!("from_str_bytes_common: radix %? to low, \ + => fail!(fmt!("from_str_bytes_common: radix %? to low, \ must lie in the range [2, 36]", radix)), _ if radix as int > 36 - => die!(fmt!("from_str_bytes_common: radix %? to high, \ + => fail!(fmt!("from_str_bytes_common: radix %? to high, \ must lie in the range [2, 36]", radix)), _ => () } diff --git a/src/libcore/num/uint-template.rs b/src/libcore/num/uint-template.rs index 4a3c5715201..0f74b73e1c5 100644 --- a/src/libcore/num/uint-template.rs +++ b/src/libcore/num/uint-template.rs @@ -76,7 +76,7 @@ pub pure fn is_nonnegative(x: T) -> bool { x >= 0 as T } pub pure fn range_step(start: T, stop: T, step: T_SIGNED, it: fn(T) -> bool) { let mut i = start; if step == 0 { - die!(~"range_step called with step == 0"); + fail!(~"range_step called with step == 0"); } if step >= 0 { while i < stop { @@ -388,16 +388,16 @@ pub fn test_ranges() { // None of the `fail`s should execute. for range(0,0) |_i| { - die!(~"unreachable"); + fail!(~"unreachable"); } for range_rev(0,0) |_i| { - die!(~"unreachable"); + fail!(~"unreachable"); } for range_step(10,0,1) |_i| { - die!(~"unreachable"); + fail!(~"unreachable"); } for range_step(0,1,-10) |_i| { - die!(~"unreachable"); + fail!(~"unreachable"); } } diff --git a/src/libcore/option.rs b/src/libcore/option.rs index c2af5f8b73b..e57d664c2aa 100644 --- a/src/libcore/option.rs +++ b/src/libcore/option.rs @@ -75,7 +75,7 @@ pub pure fn get(opt: Option) -> T { match opt { Some(copy x) => return x, - None => die!(~"option::get none") + None => fail!(~"option::get none") } } @@ -97,7 +97,7 @@ pub pure fn get_ref(opt: &r/Option) -> &r/T { */ match *opt { Some(ref x) => x, - None => die!(~"option::get_ref none") + None => fail!(~"option::get_ref none") } } @@ -226,7 +226,7 @@ pub pure fn unwrap(opt: Option) -> T { */ match move opt { Some(move x) => move x, - None => die!(~"option::unwrap none") + None => fail!(~"option::unwrap none") } } @@ -240,7 +240,7 @@ pub fn swap_unwrap(opt: &mut Option) -> T { Fails if the value equals `None`. */ - if opt.is_none() { die!(~"option::swap_unwrap none") } + if opt.is_none() { fail!(~"option::swap_unwrap none") } unwrap(util::replace(opt, None)) } @@ -249,7 +249,7 @@ pub pure fn expect(opt: Option, reason: &str) -> T { //! As unwrap, but with a specified failure message. match move opt { Some(move val) => val, - None => die!(reason.to_owned()), + None => fail!(reason.to_owned()), } } diff --git a/src/libcore/os.rs b/src/libcore/os.rs index ce590092db8..6ed8d70642c 100644 --- a/src/libcore/os.rs +++ b/src/libcore/os.rs @@ -1333,7 +1333,7 @@ mod tests { assert (libc::fclose(ostream) == (0u as c_int)); let rs = os::copy_file(&in, &out); if (!os::path_exists(&in)) { - die!(fmt!("%s doesn't exist", in.to_str())); + fail!(fmt!("%s doesn't exist", in.to_str())); } assert(rs); let rslt = run::run_program(~"diff", ~[in.to_str(), out.to_str()]); diff --git a/src/libcore/pipes.rs b/src/libcore/pipes.rs index 10aa4e41a0d..7964b081e49 100644 --- a/src/libcore/pipes.rs +++ b/src/libcore/pipes.rs @@ -326,7 +326,7 @@ fn wait_event(this: *rust_task) -> *libc::c_void { let killed = rustrt::task_wait_event(this, &mut event); if killed && !task::failing() { - die!(~"killed") + fail!(~"killed") } event } @@ -402,7 +402,7 @@ pub fn send(p: SendPacketBuffered, payload: T) -> bool { //unsafe { forget(p); } return true; } - Full => die!(~"duplicate send"), + Full => fail!(~"duplicate send"), Blocked => { debug!("waking up task for %?", p_); let old_task = swap_task(&mut p.header.blocked_task, ptr::null()); @@ -520,7 +520,7 @@ pub fn try_recv(p: RecvPacketBuffered) debug!("woke up, p.state = %?", copy p.header.state); } Blocked => if first { - die!(~"blocking on already blocked packet") + fail!(~"blocking on already blocked packet") }, Full => { let mut payload = None; @@ -556,7 +556,7 @@ pub fn try_recv(p: RecvPacketBuffered) pub pure fn peek(p: &RecvPacketBuffered) -> bool { match unsafe {(*p.header()).state} { Empty | Terminated => false, - Blocked => die!(~"peeking on blocked packet"), + Blocked => fail!(~"peeking on blocked packet"), Full => true } } @@ -589,7 +589,7 @@ fn sender_terminate(p: *Packet) { } Full => { // This is impossible - die!(~"you dun goofed") + fail!(~"you dun goofed") } Terminated => { assert p.header.blocked_task.is_null(); @@ -652,7 +652,7 @@ fn wait_many(pkts: &[T]) -> uint { (*p).state = old; break; } - Blocked => die!(~"blocking on blocked packet"), + Blocked => fail!(~"blocking on blocked packet"), Empty => () } } @@ -725,7 +725,7 @@ pub fn select2( match i { 0 => Left((try_recv(move a), move b)), 1 => Right((move a, try_recv(move b))), - _ => die!(~"select2 return an invalid packet") + _ => fail!(~"select2 return an invalid packet") } } @@ -749,7 +749,7 @@ pub fn select2i(a: &A, b: &B) -> match wait_many([a.header(), b.header()]) { 0 => Left(()), 1 => Right(()), - _ => die!(~"wait returned unexpected index") + _ => fail!(~"wait returned unexpected index") } } @@ -827,7 +827,7 @@ impl SendPacketBuffered { //forget(packet); header }, - None => die!(~"packet already consumed") + None => fail!(~"packet already consumed") } } @@ -893,7 +893,7 @@ impl RecvPacketBuffered : Selectable { //forget(packet); header }, - None => die!(~"packet already consumed") + None => fail!(~"packet already consumed") } } } @@ -1089,7 +1089,7 @@ impl Port: Peekable { endp <-> self.endp; let peek = match &endp { &Some(ref endp) => pipes::peek(endp), - &None => die!(~"peeking empty stream") + &None => fail!(~"peeking empty stream") }; self.endp <-> endp; peek @@ -1102,7 +1102,7 @@ impl Port: Selectable { unsafe { match self.endp { Some(ref endp) => endp.header(), - None => die!(~"peeking empty stream") + None => fail!(~"peeking empty stream") } } } @@ -1319,7 +1319,7 @@ pub mod test { c1.send(~"abc"); match (move p1, move p2).select() { - Right(_) => die!(), + Right(_) => fail!(), _ => () } diff --git a/src/libcore/private.rs b/src/libcore/private.rs index 038f61350b2..e6ced90c0d3 100644 --- a/src/libcore/private.rs +++ b/src/libcore/private.rs @@ -233,7 +233,7 @@ pub unsafe fn unwrap_shared_mutable_state(rc: SharedMutableState) cast::forget(move ptr); // Also we have to free the (rejected) server endpoints. let _server: UnwrapProto = cast::transmute(move serverp); - die!(~"Another task is already unwrapping this ARC!"); + fail!(~"Another task is already unwrapping this ARC!"); } } } @@ -380,7 +380,8 @@ impl Exclusive { let rec = get_shared_mutable_state(&self.x); do (*rec).lock.lock { if (*rec).failed { - die!(~"Poisoned exclusive - another task failed inside!"); + fail!( + ~"Poisoned exclusive - another task failed inside!"); } (*rec).failed = true; let result = f(&mut (*rec).data); @@ -523,7 +524,7 @@ pub mod tests { let x2 = x.clone(); do task::spawn { for 10.times { task::yield(); } // try to let the unwrapper go - die!(); // punt it awake from its deadlock + fail!(); // punt it awake from its deadlock } let _z = unwrap_exclusive(move x); do x2.with |_hello| { } diff --git a/src/libcore/private/finally.rs b/src/libcore/private/finally.rs index 50c5ea70cbb..30a309e80b0 100644 --- a/src/libcore/private/finally.rs +++ b/src/libcore/private/finally.rs @@ -93,7 +93,7 @@ fn test_fail() { let mut i = 0; do (|| { i = 10; - die!(); + fail!(); }).finally { assert failing(); assert i == 10; diff --git a/src/libcore/private/global.rs b/src/libcore/private/global.rs index cc46c19c3d2..e1ab28ce7ec 100644 --- a/src/libcore/private/global.rs +++ b/src/libcore/private/global.rs @@ -269,7 +269,7 @@ fn test_modify() { Some(~shared_mutable_state(10)) } } - _ => die!() + _ => fail!() } } @@ -280,7 +280,7 @@ fn test_modify() { assert *v == 10; None }, - _ => die!() + _ => fail!() } } @@ -291,7 +291,7 @@ fn test_modify() { Some(~shared_mutable_state(10)) } } - _ => die!() + _ => fail!() } } } diff --git a/src/libcore/private/weak_task.rs b/src/libcore/private/weak_task.rs index 520d411e4c4..f285f811f15 100644 --- a/src/libcore/private/weak_task.rs +++ b/src/libcore/private/weak_task.rs @@ -113,7 +113,7 @@ fn run_weak_task_service(port: Port) { // nobody will receive this shutdown_chan.send(()); } - None => die!() + None => fail!() } } Shutdown => break @@ -196,7 +196,7 @@ fn test_select_stream_and_oneshot() { do weaken_task |signal| { match select2i(&port, &signal) { Left(*) => (), - Right(*) => die!() + Right(*) => fail!() } } } diff --git a/src/libcore/repr.rs b/src/libcore/repr.rs index a47bad008b8..5848a868f44 100644 --- a/src/libcore/repr.rs +++ b/src/libcore/repr.rs @@ -294,7 +294,7 @@ impl ReprVisitor : TyVisitor { } // Type no longer exists, vestigial function. - fn visit_str(&self) -> bool { die!(); } + fn visit_str(&self) -> bool { fail!(); } fn visit_estr_box(&self) -> bool { do self.get::<@str> |s| { @@ -316,7 +316,7 @@ impl ReprVisitor : TyVisitor { // Type no longer exists, vestigial function. fn visit_estr_fixed(&self, _n: uint, _sz: uint, - _align: uint) -> bool { die!(); } + _align: uint) -> bool { fail!(); } fn visit_box(&self, mtbl: uint, inner: *TyDesc) -> bool { self.writer.write_char('@'); @@ -352,7 +352,7 @@ impl ReprVisitor : TyVisitor { } // Type no longer exists, vestigial function. - fn visit_vec(&self, _mtbl: uint, _inner: *TyDesc) -> bool { die!(); } + fn visit_vec(&self, _mtbl: uint, _inner: *TyDesc) -> bool { fail!(); } fn visit_unboxed_vec(&self, mtbl: uint, inner: *TyDesc) -> bool { @@ -559,7 +559,7 @@ impl ReprVisitor : TyVisitor { } // Type no longer exists, vestigial function. - fn visit_constr(&self, _inner: *TyDesc) -> bool { die!(); } + fn visit_constr(&self, _inner: *TyDesc) -> bool { fail!(); } fn visit_closure_ptr(&self, _ck: uint) -> bool { true } } diff --git a/src/libcore/result.rs b/src/libcore/result.rs index 7f151317378..fb824087f21 100644 --- a/src/libcore/result.rs +++ b/src/libcore/result.rs @@ -41,7 +41,7 @@ pub pure fn get(res: &Result) -> T { match *res { Ok(copy t) => t, Err(ref the_err) => unsafe { - die!(fmt!("get called on error result: %?", *the_err)) + fail!(fmt!("get called on error result: %?", *the_err)) } } } @@ -58,7 +58,7 @@ pub pure fn get_ref(res: &a/Result) -> &a/T { match *res { Ok(ref t) => t, Err(ref the_err) => unsafe { - die!(fmt!("get_ref called on error result: %?", *the_err)) + fail!(fmt!("get_ref called on error result: %?", *the_err)) } } } @@ -74,7 +74,7 @@ pub pure fn get_ref(res: &a/Result) -> &a/T { pub pure fn get_err(res: &Result) -> U { match *res { Err(copy u) => u, - Ok(_) => die!(~"get_err called on ok result") + Ok(_) => fail!(~"get_err called on ok result") } } @@ -379,7 +379,7 @@ pub fn iter_vec2(ss: &[S], ts: &[T], pub pure fn unwrap(res: Result) -> T { match move res { Ok(move t) => move t, - Err(_) => die!(~"unwrap called on an err result") + Err(_) => fail!(~"unwrap called on an err result") } } @@ -388,7 +388,7 @@ pub pure fn unwrap(res: Result) -> T { pub pure fn unwrap_err(res: Result) -> U { match move res { Err(move u) => move u, - Ok(_) => die!(~"unwrap called on an ok result") + Ok(_) => fail!(~"unwrap called on an ok result") } } diff --git a/src/libcore/run.rs b/src/libcore/run.rs index 0ef22cfc5ec..690486010ca 100644 --- a/src/libcore/run.rs +++ b/src/libcore/run.rs @@ -180,7 +180,7 @@ fn with_dirp(d: &Option<~str>, pub fn run_program(prog: &str, args: &[~str]) -> int { let pid = spawn_process(prog, args, &None, &None, 0i32, 0i32, 0i32); - if pid == -1 as pid_t { die!(); } + if pid == -1 as pid_t { fail!(); } return waitpid(pid); } @@ -210,7 +210,7 @@ pub fn start_program(prog: &str, args: &[~str]) -> Program { pipe_err.out); unsafe { - if pid == -1 as pid_t { die!(); } + if pid == -1 as pid_t { fail!(); } libc::close(pipe_input.in); libc::close(pipe_output.out); libc::close(pipe_err.out); @@ -330,7 +330,7 @@ pub fn program_output(prog: &str, args: &[~str]) -> ProgramOutput { os::close(pipe_in.out); os::close(pipe_out.in); os::close(pipe_err.in); - die!(); + fail!(); } os::close(pipe_in.out); @@ -364,7 +364,7 @@ pub fn program_output(prog: &str, args: &[~str]) -> ProgramOutput { errs = move s; } (n, _) => { - die!(fmt!("program_output received an unexpected file \ + fail!(fmt!("program_output received an unexpected file \ number: %u", n)); } }; @@ -478,7 +478,7 @@ mod tests { os::close(pipe_out.out); os::close(pipe_err.out); - if pid == -1i32 { die!(); } + if pid == -1i32 { fail!(); } let expected = ~"test"; writeclose(pipe_in.out, copy expected); let actual = readclose(pipe_out.in); diff --git a/src/libcore/str.rs b/src/libcore/str.rs index 6665ab6c6f7..b01f422c84a 100644 --- a/src/libcore/str.rs +++ b/src/libcore/str.rs @@ -3025,7 +3025,7 @@ mod tests { #[should_fail] fn test_as_bytes_fail() { // Don't double free - as_bytes::<()>(&~"", |_bytes| die!() ); + as_bytes::<()>(&~"", |_bytes| fail!() ); } #[test] @@ -3125,12 +3125,12 @@ mod tests { 0 => assert ch == 'x', 1 => assert ch == '\u03c0', 2 => assert ch == 'y', - _ => die!(~"test_chars_each failed") + _ => fail!(~"test_chars_each failed") } i += 1; } - chars_each(~"", |_ch| die!() ); // should not fail + chars_each(~"", |_ch| fail!() ); // should not fail } #[test] @@ -3142,7 +3142,7 @@ mod tests { 0 => assert bb == 'x' as u8, 1 => assert bb == 'y' as u8, 2 => assert bb == 'z' as u8, - _ => die!(~"test_bytes_each failed") + _ => fail!(~"test_bytes_each failed") } i += 1; } @@ -3204,7 +3204,7 @@ mod tests { ii += 1; } - words_each(~"", |_x| die!()); // should not fail + words_each(~"", |_x| fail!()); // should not fail } #[test] diff --git a/src/libcore/task/local_data.rs b/src/libcore/task/local_data.rs index 5136af810e8..fe37a2e155f 100644 --- a/src/libcore/task/local_data.rs +++ b/src/libcore/task/local_data.rs @@ -133,15 +133,15 @@ fn test_tls_modify() { fn my_key(_x: @~str) { } local_data_modify(my_key, |data| { match data { - Some(@ref val) => die!(~"unwelcome value: " + *val), + Some(@ref val) => fail!(~"unwelcome value: " + *val), None => Some(@~"first data") } }); local_data_modify(my_key, |data| { match data { Some(@~"first data") => Some(@~"next data"), - Some(@ref val) => die!(~"wrong value: " + *val), - None => die!(~"missing value") + Some(@ref val) => fail!(~"wrong value: " + *val), + None => fail!(~"missing value") } }); assert *(local_data_pop(my_key).get()) == ~"next data"; @@ -212,11 +212,11 @@ fn test_tls_cleanup_on_failure() { local_data_set(str_key, @~"string data"); local_data_set(box_key, @@()); local_data_set(int_key, @42); - die!(); + fail!(); } } // Not quite nondeterministic. local_data_set(int_key, @31337); - die!(); + fail!(); } } diff --git a/src/libcore/task/mod.rs b/src/libcore/task/mod.rs index 9240a67c69a..698463b2147 100644 --- a/src/libcore/task/mod.rs +++ b/src/libcore/task/mod.rs @@ -213,7 +213,7 @@ pub fn task() -> TaskBuilder { priv impl TaskBuilder { fn consume() -> TaskBuilder { if self.consumed { - die!(~"Cannot copy a task_builder"); // Fake move mode on self + fail!(~"Cannot copy a task_builder"); // Fake move mode on self } self.consumed = true; let notify_chan = replace(&mut self.opts.notify_chan, None); @@ -309,7 +309,7 @@ impl TaskBuilder { // sending out messages. if self.opts.notify_chan.is_some() { - die!(~"Can't set multiple future_results for one task!"); + fail!(~"Can't set multiple future_results for one task!"); } // Construct the future and give it to the caller. @@ -543,7 +543,7 @@ pub fn yield() { let task_ = rt::rust_get_task(); let killed = rt::rust_task_yield(task_); if killed && !failing() { - die!(~"killed"); + fail!(~"killed"); } } } @@ -689,24 +689,24 @@ fn test_spawn_unlinked_unsup_no_fail_down() { // grandchild sends on a port for iter::repeat(16) { task::yield(); } ch.send(()); // If killed first, grandparent hangs. } - die!(); // Shouldn't kill either (grand)parent or (grand)child. + fail!(); // Shouldn't kill either (grand)parent or (grand)child. } po.recv(); } #[test] #[ignore(cfg(windows))] fn test_spawn_unlinked_unsup_no_fail_up() { // child unlinked fails - do spawn_unlinked { die!(); } + do spawn_unlinked { fail!(); } } #[test] #[ignore(cfg(windows))] fn test_spawn_unlinked_sup_no_fail_up() { // child unlinked fails - do spawn_supervised { die!(); } + do spawn_supervised { fail!(); } // Give child a chance to fail-but-not-kill-us. for iter::repeat(16) { task::yield(); } } #[test] #[should_fail] #[ignore(cfg(windows))] fn test_spawn_unlinked_sup_fail_down() { do spawn_supervised { loop { task::yield(); } } - die!(); // Shouldn't leave a child hanging around. + fail!(); // Shouldn't leave a child hanging around. } #[test] #[should_fail] #[ignore(cfg(windows))] @@ -728,7 +728,7 @@ fn test_spawn_linked_sup_fail_up() { // child fails; parent fails can_not_copy: None, .. b0 }; - do b1.spawn { die!(); } + do b1.spawn { fail!(); } po.recv(); // We should get punted awake } #[test] #[should_fail] #[ignore(cfg(windows))] @@ -749,26 +749,26 @@ fn test_spawn_linked_sup_fail_down() { // parent fails; child fails .. b0 }; do b1.spawn { loop { task::yield(); } } - die!(); // *both* mechanisms would be wrong if this didn't kill the child + fail!(); // *both* mechanisms would be wrong if this didn't kill the child } #[test] #[should_fail] #[ignore(cfg(windows))] fn test_spawn_linked_unsup_fail_up() { // child fails; parent fails let (po, _ch) = stream::<()>(); // Default options are to spawn linked & unsupervised. - do spawn { die!(); } + do spawn { fail!(); } po.recv(); // We should get punted awake } #[test] #[should_fail] #[ignore(cfg(windows))] fn test_spawn_linked_unsup_fail_down() { // parent fails; child fails // Default options are to spawn linked & unsupervised. do spawn { loop { task::yield(); } } - die!(); + fail!(); } #[test] #[should_fail] #[ignore(cfg(windows))] fn test_spawn_linked_unsup_default_opts() { // parent fails; child fails // Make sure the above test is the same as this one. do task().linked().spawn { loop { task::yield(); } } - die!(); + fail!(); } // A couple bonus linked failure tests - testing for failure propagation even @@ -783,7 +783,7 @@ fn test_spawn_failure_propagate_grandchild() { } } for iter::repeat(16) { task::yield(); } - die!(); + fail!(); } #[test] #[should_fail] #[ignore(cfg(windows))] @@ -795,7 +795,7 @@ fn test_spawn_failure_propagate_secondborn() { } } for iter::repeat(16) { task::yield(); } - die!(); + fail!(); } #[test] #[should_fail] #[ignore(cfg(windows))] @@ -807,7 +807,7 @@ fn test_spawn_failure_propagate_nephew_or_niece() { } } for iter::repeat(16) { task::yield(); } - die!(); + fail!(); } #[test] #[should_fail] #[ignore(cfg(windows))] @@ -819,7 +819,7 @@ fn test_spawn_linked_sup_propagate_sibling() { } } for iter::repeat(16) { task::yield(); } - die!(); + fail!(); } #[test] @@ -863,7 +863,7 @@ fn test_future_result() { result = None; do task().future_result(|+r| { result = Some(move r); }).unlinked().spawn { - die!(); + fail!(); } assert option::unwrap(move result).recv() == Failure; } @@ -879,7 +879,7 @@ fn test_try_success() { ~"Success!" } { result::Ok(~"Success!") => (), - _ => die!() + _ => fail!() } } @@ -887,10 +887,10 @@ fn test_try_success() { #[ignore(cfg(windows))] fn test_try_fail() { match do try { - die!() + fail!() } { result::Err(()) => (), - result::Ok(()) => die!() + result::Ok(()) => fail!() } } @@ -1090,7 +1090,7 @@ fn test_unkillable() { yield(); // We want to fail after the unkillable task // blocks on recv - die!(); + fail!(); } unsafe { @@ -1125,7 +1125,7 @@ fn test_unkillable_nested() { yield(); // We want to fail after the unkillable task // blocks on recv - die!(); + fail!(); } unsafe { diff --git a/src/libcore/task/spawn.rs b/src/libcore/task/spawn.rs index 22a0c870de6..a57e8a8ee44 100644 --- a/src/libcore/task/spawn.rs +++ b/src/libcore/task/spawn.rs @@ -644,7 +644,7 @@ pub fn spawn_raw(opts: TaskOpts, f: fn~()) { fn new_task_in_sched(opts: SchedOpts) -> *rust_task { if opts.foreign_stack_size != None { - die!(~"foreign_stack_size scheduler option unimplemented"); + fail!(~"foreign_stack_size scheduler option unimplemented"); } let num_threads = match opts.mode { @@ -655,11 +655,11 @@ pub fn spawn_raw(opts: TaskOpts, f: fn~()) { SingleThreaded => 1u, ThreadPerCore => unsafe { rt::rust_num_threads() }, ThreadPerTask => { - die!(~"ThreadPerTask scheduling mode unimplemented") + fail!(~"ThreadPerTask scheduling mode unimplemented") } ManualThreads(threads) => { if threads == 0u { - die!(~"can not create a scheduler with no threads"); + fail!(~"can not create a scheduler with no threads"); } threads } @@ -695,7 +695,7 @@ fn test_spawn_raw_unsupervise() { .. default_task_opts() }; do spawn_raw(move opts) { - die!(); + fail!(); } } @@ -725,7 +725,7 @@ fn test_spawn_raw_notify_failure() { .. default_task_opts() }; do spawn_raw(move opts) { - die!(); + fail!(); } assert notify_po.recv() == Failure; } diff --git a/src/libcore/util.rs b/src/libcore/util.rs index 3b6a134bc52..87cbcdfe30b 100644 --- a/src/libcore/util.rs +++ b/src/libcore/util.rs @@ -96,7 +96,7 @@ fn choose_weighted_item(v: &[Item]) -> Item { */ pub fn unreachable() -> ! { - die!(~"internal error: entered unreachable code"); + fail!(~"internal error: entered unreachable code"); } mod tests { diff --git a/src/libcore/vec.rs b/src/libcore/vec.rs index 7f02ad79583..966928125a9 100644 --- a/src/libcore/vec.rs +++ b/src/libcore/vec.rs @@ -239,7 +239,7 @@ pub pure fn init(v: &[const T]) -> ~[T] { /// Returns the last element of the slice `v`, failing if the slice is empty. pub pure fn last(v: &[const T]) -> T { - if len(v) == 0u { die!(~"last_unsafe: empty vector") } + if len(v) == 0u { fail!(~"last_unsafe: empty vector") } v[len(v) - 1u] } @@ -562,7 +562,7 @@ pub fn consume(mut v: ~[T], f: fn(uint, v: T)) { pub fn pop(v: &mut ~[T]) -> T { let ln = v.len(); if ln == 0 { - die!(~"sorry, cannot vec::pop an empty vector") + fail!(~"sorry, cannot vec::pop an empty vector") } let valptr = ptr::to_mut_unsafe_ptr(&mut v[ln - 1u]); unsafe { @@ -583,7 +583,7 @@ pub fn pop(v: &mut ~[T]) -> T { pub fn swap_remove(v: &mut ~[T], index: uint) -> T { let ln = v.len(); if index >= ln { - die!(fmt!("vec::swap_remove - index %u >= length %u", index, ln)); + fail!(fmt!("vec::swap_remove - index %u >= length %u", index, ln)); } if index < ln - 1 { v[index] <-> v[ln - 1]; @@ -825,7 +825,7 @@ pub pure fn flat_map(v: &[T], f: fn(t: &T) -> ~[U]) -> ~[U] { pub pure fn map2(v0: &[T], v1: &[U], f: fn(t: &T, v: &U) -> V) -> ~[V] { let v0_len = len(v0); - if v0_len != len(v1) { die!(); } + if v0_len != len(v1) { fail!(); } let mut u: ~[V] = ~[]; let mut i = 0u; while i < v0_len { @@ -2912,7 +2912,7 @@ mod tests { #[test] fn test_each_empty() { for each::(~[]) |_v| { - die!(); // should never be executed + fail!(); // should never be executed } } @@ -2939,7 +2939,7 @@ mod tests { #[test] fn test_reach_empty() { for rev_each::(~[]) |_v| { - die!(); // should never execute + fail!(); // should never execute } } @@ -3441,7 +3441,7 @@ mod tests { #[should_fail] fn test_from_fn_fail() { do from_fn(100) |v| { - if v == 50 { die!() } + if v == 50 { fail!() } (~0, @0) }; } @@ -3455,7 +3455,7 @@ mod tests { push((~0, @0)); push((~0, @0)); push((~0, @0)); - die!(); + fail!(); }; } @@ -3468,7 +3468,7 @@ mod tests { let mut i = 0; do split(v) |_elt| { if i == 2 { - die!() + fail!() } i += 1; @@ -3485,7 +3485,7 @@ mod tests { let mut i = 0; do split(v) |_elt| { if i == 2 { - die!() + fail!() } i += 1; @@ -3502,7 +3502,7 @@ mod tests { let mut i = 0; do splitn(v, 100) |_elt| { if i == 2 { - die!() + fail!() } i += 1; @@ -3519,7 +3519,7 @@ mod tests { let mut i = 0; do split(v) |_elt| { if i == 2 { - die!() + fail!() } i += 1; @@ -3536,7 +3536,7 @@ mod tests { let mut i = 0; do rsplit(v) |_elt| { if i == 2 { - die!() + fail!() } i += 1; @@ -3553,7 +3553,7 @@ mod tests { let mut i = 0; do rsplit(v) |_elt| { if i == 2 { - die!() + fail!() } i += 1; @@ -3570,7 +3570,7 @@ mod tests { let mut i = 0; do rsplitn(v, 100) |_elt| { if i == 2 { - die!() + fail!() } i += 1; @@ -3587,7 +3587,7 @@ mod tests { let mut i = 0; do rsplitn(v, 100) |_elt| { if i == 2 { - die!() + fail!() } i += 1; @@ -3603,7 +3603,7 @@ mod tests { let mut i = 0; do consume(v) |_i, _elt| { if i == 2 { - die!() + fail!() } i += 1; }; @@ -3617,7 +3617,7 @@ mod tests { let mut v = ~[]; do v.grow_fn(100) |i| { if i == 50 { - die!() + fail!() } (~0, @0) } @@ -3631,7 +3631,7 @@ mod tests { let mut i = 0; do map(v) |_elt| { if i == 2 { - die!() + fail!() } i += 0; ~[(~0, @0)] @@ -3646,7 +3646,7 @@ mod tests { let mut i = 0; do map_consume(v) |_elt| { if i == 2 { - die!() + fail!() } i += 0; ~[(~0, @0)] @@ -3661,7 +3661,7 @@ mod tests { let mut i = 0; do mapi(v) |_i, _elt| { if i == 2 { - die!() + fail!() } i += 0; ~[(~0, @0)] @@ -3676,7 +3676,7 @@ mod tests { let mut i = 0; do map(v) |_elt| { if i == 2 { - die!() + fail!() } i += 0; ~[(~0, @0)] @@ -3692,7 +3692,7 @@ mod tests { let mut i = 0; do map2(v, v) |_elt1, _elt2| { if i == 2 { - die!() + fail!() } i += 0; ~[(~0, @0)] @@ -3708,7 +3708,7 @@ mod tests { let mut i = 0; do filter_mapped(v) |_elt| { if i == 2 { - die!() + fail!() } i += 0; Some((~0, @0)) @@ -3724,7 +3724,7 @@ mod tests { let mut i = 0; do v.filtered |_elt| { if i == 2 { - die!() + fail!() } i += 0; true @@ -3740,7 +3740,7 @@ mod tests { let mut i = 0; do foldl((~0, @0), v) |_a, _b| { if i == 2 { - die!() + fail!() } i += 0; (~0, @0) @@ -3756,7 +3756,7 @@ mod tests { let mut i = 0; do foldr(v, (~0, @0)) |_a, _b| { if i == 2 { - die!() + fail!() } i += 0; (~0, @0) @@ -3771,7 +3771,7 @@ mod tests { let mut i = 0; do any(v) |_elt| { if i == 2 { - die!() + fail!() } i += 0; false @@ -3786,7 +3786,7 @@ mod tests { let mut i = 0; do any(v) |_elt| { if i == 2 { - die!() + fail!() } i += 0; false @@ -3801,7 +3801,7 @@ mod tests { let mut i = 0; do all(v) |_elt| { if i == 2 { - die!() + fail!() } i += 0; true @@ -3816,7 +3816,7 @@ mod tests { let mut i = 0; do alli(v) |_i, _elt| { if i == 2 { - die!() + fail!() } i += 0; true @@ -3831,7 +3831,7 @@ mod tests { let mut i = 0; do all2(v, v) |_elt1, _elt2| { if i == 2 { - die!() + fail!() } i += 0; true @@ -3847,7 +3847,7 @@ mod tests { let mut i = 0; do find(v) |_elt| { if i == 2 { - die!() + fail!() } i += 0; false @@ -3862,7 +3862,7 @@ mod tests { let mut i = 0; do position(v) |_elt| { if i == 2 { - die!() + fail!() } i += 0; false @@ -3877,7 +3877,7 @@ mod tests { let mut i = 0; do rposition(v) |_elt| { if i == 2 { - die!() + fail!() } i += 0; false @@ -3892,7 +3892,7 @@ mod tests { let mut i = 0; do each(v) |_elt| { if i == 2 { - die!() + fail!() } i += 0; false @@ -3907,7 +3907,7 @@ mod tests { let mut i = 0; do eachi(v) |_i, _elt| { if i == 2 { - die!() + fail!() } i += 0; false @@ -3923,7 +3923,7 @@ mod tests { let mut i = 0; for each_permutation(v) |_elt| { if i == 2 { - die!() + fail!() } i += 0; } @@ -3935,7 +3935,7 @@ mod tests { fn test_as_imm_buf_fail() { let v = [(~0, @0), (~0, @0), (~0, @0), (~0, @0)]; do as_imm_buf(v) |_buf, _i| { - die!() + fail!() } } @@ -3945,7 +3945,7 @@ mod tests { fn test_as_const_buf_fail() { let v = [(~0, @0), (~0, @0), (~0, @0), (~0, @0)]; do as_const_buf(v) |_buf, _i| { - die!() + fail!() } } @@ -3955,7 +3955,7 @@ mod tests { fn test_as_mut_buf_fail() { let mut v = [(~0, @0), (~0, @0), (~0, @0), (~0, @0)]; do as_mut_buf(v) |_buf, _i| { - die!() + fail!() } } diff --git a/src/libfuzzer/fuzzer.rc b/src/libfuzzer/fuzzer.rc index c8083554c8b..6d0b2f8a762 100644 --- a/src/libfuzzer/fuzzer.rc +++ b/src/libfuzzer/fuzzer.rc @@ -569,7 +569,7 @@ pub fn check_roundtrip_convergence(code: @~str, maxIters: uint) { run::run_program(~"diff", ~[~"-w", ~"-u", ~"round-trip-a.rs", ~"round-trip-b.rs"]); - die!(~"Mismatch"); + fail!(~"Mismatch"); } } diff --git a/src/libfuzzer/rand_util.rs b/src/libfuzzer/rand_util.rs index ea8bd05c38b..cb074eecd6d 100644 --- a/src/libfuzzer/rand_util.rs +++ b/src/libfuzzer/rand_util.rs @@ -42,7 +42,7 @@ fn shuffled(r : rand::rng, v : ~[T]) -> ~[T] { } // sample from a population without replacement -//fn sample(r : rand::rng, pop : ~[T], k : uint) -> ~[T] { die!() } +//fn sample(r : rand::rng, pop : ~[T], k : uint) -> ~[T] { fail!() } // Two ways to make a weighted choice. // * weighted_choice is O(number of choices) time diff --git a/src/librustc/back/link.rs b/src/librustc/back/link.rs index 2b8e52888f1..df362b77984 100644 --- a/src/librustc/back/link.rs +++ b/src/librustc/back/link.rs @@ -509,7 +509,7 @@ pub fn build_link_meta(sess: Session, c: &ast::crate, output: &Path, } ast::meta_list(_, _) => { // FIXME (#607): Implement this - die!(~"unimplemented meta_item variant"); + fail!(~"unimplemented meta_item variant"); } } } diff --git a/src/librustc/back/rpath.rs b/src/librustc/back/rpath.rs index 4cca6757cc3..18e89635ab2 100644 --- a/src/librustc/back/rpath.rs +++ b/src/librustc/back/rpath.rs @@ -178,7 +178,7 @@ pub fn get_install_prefix_rpath(target_triple: &str) -> Path { let install_prefix = env!("CFG_PREFIX"); if install_prefix == ~"" { - die!(~"rustc compiled without CFG_PREFIX environment variable"); + fail!(~"rustc compiled without CFG_PREFIX environment variable"); } let tlib = filesearch::relative_target_lib_path(target_triple); diff --git a/src/librustc/driver/driver.rs b/src/librustc/driver/driver.rs index 4273f4f135b..b0024bace37 100644 --- a/src/librustc/driver/driver.rs +++ b/src/librustc/driver/driver.rs @@ -506,7 +506,7 @@ pub fn host_triple() -> ~str { return if ht != ~"" { ht } else { - die!(~"rustc built without CFG_HOST_TRIPLE") + fail!(~"rustc built without CFG_HOST_TRIPLE") }; } @@ -841,7 +841,7 @@ pub fn build_output_filenames(input: input, pub fn early_error(emitter: diagnostic::Emitter, msg: ~str) -> ! { emitter(None, msg, diagnostic::fatal); - die!(); + fail!(); } pub fn list_metadata(sess: Session, path: &Path, out: io::Writer) { @@ -869,7 +869,7 @@ pub mod test { let matches = &match getopts(~[~"--test"], optgroups()) { Ok(copy m) => m, - Err(copy f) => die!(~"test_switch_implies_cfg_test: " + + Err(copy f) => fail!(~"test_switch_implies_cfg_test: " + getopts::fail_str(f)) }; let sessopts = build_session_options( @@ -887,7 +887,7 @@ pub mod test { &match getopts(~[~"--test", ~"--cfg=test"], optgroups()) { Ok(copy m) => m, Err(copy f) => { - die!(~"test_switch_implies_cfg_test_unless_cfg_test: " + + fail!(~"test_switch_implies_cfg_test_unless_cfg_test: " + getopts::fail_str(f)); } }; diff --git a/src/librustc/lib/llvm.rs b/src/librustc/lib/llvm.rs index 3a419ac9f59..4b63bb37215 100644 --- a/src/librustc/lib/llvm.rs +++ b/src/librustc/lib/llvm.rs @@ -1457,7 +1457,7 @@ pub fn float_width(llt: TypeRef) -> uint { 2 => 64u, 3 => 80u, 4 | 5 => 128u, - _ => die!(~"llvm_float_width called on a non-float type") + _ => fail!(~"llvm_float_width called on a non-float type") }; } } diff --git a/src/librustc/metadata/decoder.rs b/src/librustc/metadata/decoder.rs index 14dda962282..cb56136f1c4 100644 --- a/src/librustc/metadata/decoder.rs +++ b/src/librustc/metadata/decoder.rs @@ -92,7 +92,7 @@ fn find_item(item_id: int, items: ebml::Doc) -> ebml::Doc { fn lookup_item(item_id: int, data: @~[u8]) -> ebml::Doc { let items = reader::get_doc(reader::Doc(data), tag_items); match maybe_find_item(item_id, items) { - None => die!(fmt!("lookup_item: id not found: %d", item_id)), + None => fail!(fmt!("lookup_item: id not found: %d", item_id)), Some(d) => d } } @@ -150,7 +150,7 @@ fn item_family(item: ebml::Doc) -> Family { 'g' => PublicField, 'j' => PrivateField, 'N' => InheritedField, - c => die!(fmt!("unexpected family char: %c", c)) + c => fail!(fmt!("unexpected family char: %c", c)) } } @@ -399,7 +399,7 @@ pub fn struct_dtor(cdata: cmd, id: ast::node_id) -> Option { let mut found = None; let cls_items = match maybe_find_item(id, items) { Some(it) => it, - None => die!(fmt!("struct_dtor: class id not found \ + None => fail!(fmt!("struct_dtor: class id not found \ when looking up dtor for %d", id)) }; for reader::tagged_docs(cls_items, tag_item_dtor) |doc| { @@ -424,8 +424,8 @@ pub enum def_like { fn def_like_to_def(def_like: def_like) -> ast::def { match def_like { dl_def(def) => return def, - dl_impl(*) => die!(~"found impl in def_like_to_def"), - dl_field => die!(~"found field in def_like_to_def") + dl_impl(*) => fail!(~"found impl in def_like_to_def"), + dl_field => fail!(~"found field in def_like_to_def") } } @@ -626,7 +626,7 @@ fn get_self_ty(item: ebml::Doc) -> ast::self_ty_ { 'm' => { ast::m_mutbl } 'c' => { ast::m_const } _ => { - die!(fmt!("unknown mutability character: `%c`", ch as char)) + fail!(fmt!("unknown mutability character: `%c`", ch as char)) } } } @@ -643,7 +643,7 @@ fn get_self_ty(item: ebml::Doc) -> ast::self_ty_ { '~' => { return ast::sty_uniq(get_mutability(string[1])); } '&' => { return ast::sty_region(get_mutability(string[1])); } _ => { - die!(fmt!("unknown self type code: `%c`", self_ty_kind as char)); + fail!(fmt!("unknown self type code: `%c`", self_ty_kind as char)); } } } @@ -834,7 +834,7 @@ pub fn get_static_methods_if_impl(intr: @ident_interner, StaticMethod => purity = ast::impure_fn, UnsafeStaticMethod => purity = ast::unsafe_fn, PureStaticMethod => purity = ast::pure_fn, - _ => die!() + _ => fail!() } static_impl_methods.push(StaticMethodInfo { @@ -867,7 +867,7 @@ pure fn family_to_visibility(family: Family) -> ast::visibility { PublicField => ast::public, PrivateField => ast::private, InheritedField => ast::inherited, - _ => die!() + _ => fail!() } } @@ -926,7 +926,7 @@ fn describe_def(items: ebml::Doc, id: ast::def_id) -> ~str { if id.crate != ast::local_crate { return ~"external"; } let it = match maybe_find_item(id.node, items) { Some(it) => it, - None => die!(fmt!("describe_def: item not found %?", id)) + None => fail!(fmt!("describe_def: item not found %?", id)) }; return item_family_to_str(item_family(it)); } @@ -1111,7 +1111,7 @@ pub fn translate_def_id(cdata: cmd, did: ast::def_id) -> ast::def_id { match cdata.cnum_map.find(&did.crate) { option::Some(n) => ast::def_id { crate: n, node: did.node }, - option::None => die!(~"didn't find a crate in the cnum_map") + option::None => fail!(~"didn't find a crate in the cnum_map") } } diff --git a/src/librustc/metadata/encoder.rs b/src/librustc/metadata/encoder.rs index 3c39a4032f5..12c5e3388db 100644 --- a/src/librustc/metadata/encoder.rs +++ b/src/librustc/metadata/encoder.rs @@ -553,7 +553,7 @@ fn purity_static_method_family(p: purity) -> char { unsafe_fn => 'U', pure_fn => 'P', impure_fn => 'F', - _ => die!(~"extern fn can't be static") + _ => fail!(~"extern fn can't be static") } } @@ -879,7 +879,7 @@ fn encode_info_for_item(ecx: @encode_ctxt, ebml_w: writer::Encoder, true, item.id, *m, /*bad*/copy m.tps); } } - item_mac(*) => die!(~"item macros unimplemented") + item_mac(*) => fail!(~"item macros unimplemented") } } @@ -936,7 +936,7 @@ fn encode_info_for_items(ecx: @encode_ctxt, ebml_w: writer::Encoder, encode_info_for_item(ecx, ebml_w, i, index, *pt); } - _ => die!(~"bad item") + _ => fail!(~"bad item") } } }, @@ -951,7 +951,7 @@ fn encode_info_for_items(ecx: @encode_ctxt, ebml_w: writer::Encoder, abi); } // case for separate item and foreign-item tables - _ => die!(~"bad foreign item") + _ => fail!(~"bad foreign item") } } }, diff --git a/src/librustc/metadata/filesearch.rs b/src/librustc/metadata/filesearch.rs index dfccaf77dfd..eac459ec703 100644 --- a/src/librustc/metadata/filesearch.rs +++ b/src/librustc/metadata/filesearch.rs @@ -108,7 +108,7 @@ fn make_target_lib_path(sysroot: &Path, fn get_or_default_sysroot() -> Path { match os::self_exe_path() { option::Some(ref p) => (*p).pop(), - option::None => die!(~"can't determine value for sysroot") + option::None => fail!(~"can't determine value for sysroot") } } @@ -176,7 +176,7 @@ fn get_cargo_lib_path_nearest() -> Result { pub fn libdir() -> ~str { let libdir = env!("CFG_LIBDIR"); if str::is_empty(libdir) { - die!(~"rustc compiled without CFG_LIBDIR environment variable"); + fail!(~"rustc compiled without CFG_LIBDIR environment variable"); } libdir } diff --git a/src/librustc/metadata/loader.rs b/src/librustc/metadata/loader.rs index c4cb154e21f..9e5b1db879f 100644 --- a/src/librustc/metadata/loader.rs +++ b/src/librustc/metadata/loader.rs @@ -150,10 +150,10 @@ pub fn crate_name_from_metas(+metas: ~[@ast::meta_item]) -> ~str { Some(ref n) => (/*bad*/copy *n), // FIXME (#2406): Probably want a warning here since the user // is using the wrong type of meta item. - _ => die!() + _ => fail!() } } - None => die!(~"expected to find the crate name") + None => fail!(~"expected to find the crate name") } } diff --git a/src/librustc/metadata/tydecode.rs b/src/librustc/metadata/tydecode.rs index c4b32047995..2599ceb2ef1 100644 --- a/src/librustc/metadata/tydecode.rs +++ b/src/librustc/metadata/tydecode.rs @@ -190,7 +190,7 @@ fn parse_bound_region(st: @mut PState) -> ty::bound_region { assert next(st) == '|'; ty::br_cap_avoid(id, @parse_bound_region(st)) }, - _ => die!(~"parse_bound_region: bad input") + _ => fail!(~"parse_bound_region: bad input") } } @@ -215,7 +215,7 @@ fn parse_region(st: @mut PState) -> ty::Region { 't' => { ty::re_static } - _ => die!(~"parse_region: bad input") + _ => fail!(~"parse_region: bad input") } } @@ -223,7 +223,7 @@ fn parse_opt(st: @mut PState, f: fn() -> T) -> Option { match next(st) { 'n' => None, 's' => Some(f()), - _ => die!(~"parse_opt: bad input") + _ => fail!(~"parse_opt: bad input") } } @@ -256,7 +256,7 @@ fn parse_ty(st: @mut PState, conv: conv_did) -> ty::t { 'D' => return ty::mk_mach_int(st.tcx, ast::ty_i64), 'f' => return ty::mk_mach_float(st.tcx, ast::ty_f32), 'F' => return ty::mk_mach_float(st.tcx, ast::ty_f64), - _ => die!(~"parse_ty: bad numeric type") + _ => fail!(~"parse_ty: bad numeric type") } } 'c' => return ty::mk_char(st.tcx), @@ -360,7 +360,7 @@ fn parse_ty(st: @mut PState, conv: conv_did) -> ty::t { assert (next(st) == ']'); return ty::mk_struct(st.tcx, did, substs); } - c => { error!("unexpected char in type string: %c", c); die!();} + c => { error!("unexpected char in type string: %c", c); fail!();} } } @@ -412,14 +412,14 @@ fn parse_purity(c: char) -> purity { 'p' => pure_fn, 'i' => impure_fn, 'c' => extern_fn, - _ => die!(~"parse_purity: bad purity") + _ => fail!(~"parse_purity: bad purity") } } fn parse_abi(c: char) -> Abi { match c { 'r' => ast::RustAbi, - _ => die!(fmt!("parse_abi: bad ABI '%c'", c)) + _ => fail!(fmt!("parse_abi: bad ABI '%c'", c)) } } @@ -427,7 +427,7 @@ fn parse_onceness(c: char) -> ast::Onceness { match c { 'o' => ast::Once, 'm' => ast::Many, - _ => die!(~"parse_onceness: bad onceness") + _ => fail!(~"parse_onceness: bad onceness") } } @@ -440,7 +440,7 @@ fn parse_mode(st: @mut PState) -> ast::mode { '+' => ast::by_copy, '=' => ast::by_ref, '#' => ast::by_val, - _ => die!(~"bad mode") + _ => fail!(~"bad mode") }); return m; } @@ -490,7 +490,7 @@ pub fn parse_def_id(buf: &[u8]) -> ast::def_id { while colon_idx < len && buf[colon_idx] != ':' as u8 { colon_idx += 1u; } if colon_idx == len { error!("didn't find ':' when parsing def id"); - die!(); + fail!(); } let crate_part = vec::view(buf, 0u, colon_idx); @@ -498,12 +498,12 @@ pub fn parse_def_id(buf: &[u8]) -> ast::def_id { let crate_num = match uint::parse_bytes(crate_part, 10u) { Some(cn) => cn as int, - None => die!(fmt!("internal error: parse_def_id: crate number \ + None => fail!(fmt!("internal error: parse_def_id: crate number \ expected, but found %?", crate_part)) }; let def_num = match uint::parse_bytes(def_part, 10u) { Some(dn) => dn as int, - None => die!(fmt!("internal error: parse_def_id: id expected, but \ + None => fail!(fmt!("internal error: parse_def_id: id expected, but \ found %?", def_part)) }; ast::def_id { crate: crate_num, node: def_num } @@ -526,7 +526,7 @@ fn parse_bounds(st: @mut PState, conv: conv_did) -> @~[ty::param_bound] { 'O' => ty::bound_durable, 'I' => ty::bound_trait(parse_ty(st, conv)), '.' => break, - _ => die!(~"parse_bounds: bad bounds") + _ => fail!(~"parse_bounds: bad bounds") }); } @bounds diff --git a/src/librustc/metadata/tyencode.rs b/src/librustc/metadata/tyencode.rs index a87ce02d5a3..252de54cb9b 100644 --- a/src/librustc/metadata/tyencode.rs +++ b/src/librustc/metadata/tyencode.rs @@ -326,7 +326,7 @@ fn enc_sty(w: io::Writer, cx: @ctxt, +st: ty::sty) { debug!("~~~~ %s", ~"]"); w.write_char(']'); } - ty::ty_err => die!(~"Shouldn't encode error type") + ty::ty_err => fail!(~"Shouldn't encode error type") } } diff --git a/src/librustc/middle/astencode.rs b/src/librustc/middle/astencode.rs index 72da98be6b0..af2465fe4d1 100644 --- a/src/librustc/middle/astencode.rs +++ b/src/librustc/middle/astencode.rs @@ -304,7 +304,7 @@ fn simplify_ast(ii: ast::inlined_item) -> ast::inlined_item { span: _}, _) => true, ast::stmt_decl(@codemap::spanned { node: ast::decl_item(_), span: _}, _) => false, - ast::stmt_mac(*) => die!(~"unexpanded macro in astencode") + ast::stmt_mac(*) => fail!(~"unexpanded macro in astencode") } }; let blk_sans_items = ast::blk_ { @@ -717,7 +717,7 @@ impl reader::Decoder: vtable_decoder_helpers { ) } // hard to avoid - user input - _ => die!(~"bad enum variant") + _ => fail!(~"bad enum variant") } } } @@ -1288,6 +1288,6 @@ fn test_simplification() { assert pprust::item_to_str(item_out, ext_cx.parse_sess().interner) == pprust::item_to_str(item_exp, ext_cx.parse_sess().interner); } - _ => die!() + _ => fail!() } } diff --git a/src/librustc/middle/check_const.rs b/src/librustc/middle/check_const.rs index 8890da1587d..6d4de6aeb93 100644 --- a/src/librustc/middle/check_const.rs +++ b/src/librustc/middle/check_const.rs @@ -253,7 +253,7 @@ pub fn check_item_recursion(sess: Session, ast_map::node_item(it, _) => { (v.visit_item)(it, env, v); } - _ => die!(~"const not bound to an item") + _ => fail!(~"const not bound to an item") } } _ => () diff --git a/src/librustc/middle/check_match.rs b/src/librustc/middle/check_match.rs index 1a3e4251129..bd07ca84c9a 100644 --- a/src/librustc/middle/check_match.rs +++ b/src/librustc/middle/check_match.rs @@ -147,11 +147,11 @@ pub fn check_exhaustive(cx: @MatchCheckCtxt, sp: span, pats: ~[@pat]) { } ty::ty_enum(id, _) => { let vid = match (*ctor) { variant(id) => id, - _ => die!(~"check_exhaustive: non-variant ctor") }; + _ => fail!(~"check_exhaustive: non-variant ctor") }; match vec::find(*ty::enum_variants(cx.tcx, id), |v| v.id == vid) { Some(v) => Some(cx.tcx.sess.str_of(v.name)), - None => die!(~"check_exhaustive: bad variant in ctor") + None => fail!(~"check_exhaustive: bad variant in ctor") } } ty::ty_unboxed_vec(*) | ty::ty_evec(*) => { @@ -366,7 +366,7 @@ pub fn missing_ctor(cx: @MatchCheckCtxt, return Some(variant(v.id)); } } - die!(); + fail!(); } else { None } } ty::ty_nil => None, @@ -377,7 +377,7 @@ pub fn missing_ctor(cx: @MatchCheckCtxt, None => (), Some(val(const_bool(true))) => true_found = true, Some(val(const_bool(false))) => false_found = true, - _ => die!(~"impossible case") + _ => fail!(~"impossible case") } } if true_found && false_found { None } @@ -445,10 +445,10 @@ pub fn ctor_arity(cx: @MatchCheckCtxt, ctor: ctor, ty: ty::t) -> uint { ty::ty_box(_) | ty::ty_uniq(_) | ty::ty_rptr(*) => 1u, ty::ty_enum(eid, _) => { let id = match ctor { variant(id) => id, - _ => die!(~"impossible case") }; + _ => fail!(~"impossible case") }; match vec::find(*ty::enum_variants(cx.tcx, eid), |v| v.id == id ) { Some(v) => v.args.len(), - None => die!(~"impossible case") + None => fail!(~"impossible case") } } ty::ty_struct(cid, _) => ty::lookup_struct_fields(cx.tcx, cid).len(), @@ -496,7 +496,7 @@ pub fn specialize(cx: @MatchCheckCtxt, compare_const_vals((*c_hi), e_v) <= 0 } single => true, - _ => die!(~"type error") + _ => fail!(~"type error") }; if match_ { Some(vec::tail(r)) } else { None } } @@ -529,7 +529,7 @@ pub fn specialize(cx: @MatchCheckCtxt, pat_rec(ref flds, _) => { let ty_flds = match /*bad*/copy ty::get(left_ty).sty { ty::ty_rec(flds) => flds, - _ => die!(~"bad type for pat_rec") + _ => fail!(~"bad type for pat_rec") }; let args = vec::map(ty_flds, |ty_fld| { match flds.find(|f| f.ident == ty_fld.ident) { @@ -595,7 +595,7 @@ pub fn specialize(cx: @MatchCheckCtxt, compare_const_vals((*c_hi), e_v) <= 0 } single => true, - _ => die!(~"type error") + _ => fail!(~"type error") }; if match_ { Some(vec::tail(r)) } else { None } } @@ -605,7 +605,7 @@ pub fn specialize(cx: @MatchCheckCtxt, range(ref lo, ref hi) => ((/*bad*/copy *lo), (/*bad*/copy *hi)), single => return Some(vec::tail(r)), - _ => die!(~"type error") + _ => fail!(~"type error") }; let v_lo = eval_const_expr(cx.tcx, lo), v_hi = eval_const_expr(cx.tcx, hi); diff --git a/src/librustc/middle/const_eval.rs b/src/librustc/middle/const_eval.rs index e01595d8d93..ae83e996aba 100644 --- a/src/librustc/middle/const_eval.rs +++ b/src/librustc/middle/const_eval.rs @@ -233,7 +233,7 @@ pub enum const_val { pub fn eval_const_expr(tcx: middle::ty::ctxt, e: @expr) -> const_val { match eval_const_expr_partial(tcx, e) { Ok(ref r) => (/*bad*/copy *r), - Err(ref s) => die!(/*bad*/copy *s) + Err(ref s) => fail!(/*bad*/copy *s) } } @@ -459,7 +459,7 @@ pub fn compare_const_vals(a: const_val, b: const_val) -> int { 1 } } - _ => die!(~"compare_const_vals: ill-typed comparison") + _ => fail!(~"compare_const_vals: ill-typed comparison") } } diff --git a/src/librustc/middle/freevars.rs b/src/librustc/middle/freevars.rs index 0d3b7c36f6d..2c39e41c57b 100644 --- a/src/librustc/middle/freevars.rs +++ b/src/librustc/middle/freevars.rs @@ -57,7 +57,7 @@ fn collect_freevars(def_map: resolve::DefMap, blk: ast::blk) ast::expr_path(*) => { let mut i = 0; match def_map.find(&expr.id) { - None => die!(~"path not found"), + None => fail!(~"path not found"), Some(df) => { let mut def = df; while i < depth { @@ -117,7 +117,7 @@ pub fn annotate_freevars(def_map: resolve::DefMap, crate: @ast::crate) -> pub fn get_freevars(tcx: ty::ctxt, fid: ast::node_id) -> freevar_info { match tcx.freevars.find(&fid) { - None => die!(~"get_freevars: " + int::str(fid) + ~" has no freevars"), + None => fail!(~"get_freevars: " + int::str(fid) + ~" has no freevars"), Some(d) => return d } } diff --git a/src/librustc/middle/kind.rs b/src/librustc/middle/kind.rs index a949b40bf75..29a3a833642 100644 --- a/src/librustc/middle/kind.rs +++ b/src/librustc/middle/kind.rs @@ -204,7 +204,7 @@ pub fn check_expr(e: @expr, cx: ctx, v: visit::vt) { }; if vec::len(*ts) != vec::len(*bounds) { // Fail earlier to make debugging easier - die!(fmt!("internal error: in kind::check_expr, length \ + fail!(fmt!("internal error: in kind::check_expr, length \ mismatch between actual and declared bounds: actual = \ %s (%u tys), declared = %? (%u tys)", tys_to_str(cx.tcx, *ts), ts.len(), diff --git a/src/librustc/middle/lint.rs b/src/librustc/middle/lint.rs index 487148ddd97..da153778b9a 100644 --- a/src/librustc/middle/lint.rs +++ b/src/librustc/middle/lint.rs @@ -485,7 +485,7 @@ fn check_item_type_limits(cx: ty::ctxt, it: @ast::item) { ast::gt => v >= min, ast::ge => v > min, ast::eq | ast::ne => v >= min && v <= max, - _ => die!() + _ => fail!() } } @@ -544,7 +544,7 @@ fn check_item_type_limits(cx: ty::ctxt, it: @ast::item) { ast::lit_int_unsuffixed(v) => v, _ => return true }, - _ => die!() + _ => fail!() }; is_valid(norm_binop, lit_val, min, max) } @@ -557,7 +557,7 @@ fn check_item_type_limits(cx: ty::ctxt, it: @ast::item) { ast::lit_int_unsuffixed(v) => v as u64, _ => return true }, - _ => die!() + _ => fail!() }; is_valid(norm_binop, lit_val, min, max) } @@ -960,7 +960,7 @@ fn check_fn_deprecated_modes(tcx: ty::ctxt, fn_ty: ty::t, decl: ast::fn_decl, ty_to_str(tcx, arg_ty.ty), mode_to_str(arg_ast.mode)); error!("%?",arg_ast.ty.node); - die!() + fail!() } }; } diff --git a/src/librustc/middle/resolve.rs b/src/librustc/middle/resolve.rs index ea840da73cd..acb73e90c5d 100644 --- a/src/librustc/middle/resolve.rs +++ b/src/librustc/middle/resolve.rs @@ -323,7 +323,7 @@ pub fn namespace_for_duplicate_checking_mode(mode: DuplicateCheckingMode) ForbidDuplicateModules | ForbidDuplicateTypes | ForbidDuplicateTypesAndValues => TypeNS, ForbidDuplicateValues => ValueNS, - OverwriteDuplicates => die!(~"OverwriteDuplicates has no namespace") + OverwriteDuplicates => fail!(~"OverwriteDuplicates has no namespace") } } @@ -618,7 +618,7 @@ pub impl NameBindings { fn get_module(@mut self) -> @Module { match self.get_module_if_available() { None => { - die!(~"get_module called on a node with no module \ + fail!(~"get_module called on a node with no module \ definition!") } Some(module_def) => module_def @@ -1337,7 +1337,7 @@ pub impl Resolver { } item_mac(*) => { - die!(~"item macros unimplemented") + fail!(~"item macros unimplemented") } } } @@ -1599,7 +1599,7 @@ pub impl Resolver { match existing_module.parent_link { NoParentLink | BlockParentLink(*) => { - die!(~"can't happen"); + fail!(~"can't happen"); } ModuleParentLink(parent_module, ident) => { let name_bindings = parent_module.children.get( @@ -1666,7 +1666,7 @@ pub impl Resolver { def_prim_ty(*) | def_ty_param(*) | def_binding(*) | def_use(*) | def_upvar(*) | def_region(*) | def_typaram_binder(*) | def_label(*) | def_self_ty(*) => { - die!(fmt!("didn't expect `%?`", def)); + fail!(fmt!("didn't expect `%?`", def)); } } } @@ -2254,7 +2254,7 @@ pub impl Resolver { } UnboundResult => { /* Continue. */ } UnknownResult => { - die!(~"value result should be known at this point"); + fail!(~"value result should be known at this point"); } } match type_result { @@ -2264,7 +2264,7 @@ pub impl Resolver { } UnboundResult => { /* Continue. */ } UnknownResult => { - die!(~"type result should be known at this point"); + fail!(~"type result should be known at this point"); } } @@ -2417,7 +2417,7 @@ pub impl Resolver { binding"); } UnknownResult => { - die!(~"module result should be known at this point"); + fail!(~"module result should be known at this point"); } } @@ -3033,7 +3033,7 @@ pub impl Resolver { allowable_namespaces = namespaces; } GlobImport => { - die!(~"found `import *`, which is invalid"); + fail!(~"found `import *`, which is invalid"); } } @@ -3153,7 +3153,7 @@ pub impl Resolver { // Otherwise, proceed and write in the bindings. match module_.import_resolutions.find(&target_name) { None => { - die!(~"(resolving one-level renaming import) reduced graph \ + fail!(~"(resolving one-level renaming import) reduced graph \ construction or glob importing should have created the \ import resolution name by now"); } @@ -3769,7 +3769,7 @@ pub impl Resolver { } item_mac(*) => { - die!(~"item macros unimplemented") + fail!(~"item macros unimplemented") } } @@ -4471,8 +4471,8 @@ pub impl Resolver { Success(target) => { match target.bindings.value_def { None => { - die!(~"resolved name in the value namespace to a set \ - of name bindings with no def?!"); + fail!(~"resolved name in the value namespace to a \ + set of name bindings with no def?!"); } Some(def) => { match def.def { @@ -4491,7 +4491,7 @@ pub impl Resolver { } Indeterminate => { - die!(~"unexpected indeterminate result"); + fail!(~"unexpected indeterminate result"); } Failed => { @@ -4652,7 +4652,7 @@ pub impl Resolver { } Indeterminate => { - die!(~"indeterminate unexpected"); + fail!(~"indeterminate unexpected"); } Success(resulting_module) => { @@ -4699,7 +4699,7 @@ pub impl Resolver { } Indeterminate => { - die!(~"indeterminate unexpected"); + fail!(~"indeterminate unexpected"); } Success(resulting_module) => { @@ -4777,7 +4777,7 @@ pub impl Resolver { } } Indeterminate => { - die!(~"unexpected indeterminate result"); + fail!(~"unexpected indeterminate result"); } Failed => { return None; diff --git a/src/librustc/middle/trans/_match.rs b/src/librustc/middle/trans/_match.rs index d9d3b63b6c9..492adc8631d 100644 --- a/src/librustc/middle/trans/_match.rs +++ b/src/librustc/middle/trans/_match.rs @@ -209,7 +209,7 @@ pub fn opt_eq(tcx: ty::ctxt, a: &Opt, b: &Opt) -> bool { a_expr = e.get(); } UnitLikeStructLit(_) => { - die!(~"UnitLikeStructLit should have been handled \ + fail!(~"UnitLikeStructLit should have been handled \ above") } } @@ -222,7 +222,7 @@ pub fn opt_eq(tcx: ty::ctxt, a: &Opt, b: &Opt) -> bool { b_expr = e.get(); } UnitLikeStructLit(_) => { - die!(~"UnitLikeStructLit should have been handled \ + fail!(~"UnitLikeStructLit should have been handled \ above") } } diff --git a/src/librustc/middle/trans/base.rs b/src/librustc/middle/trans/base.rs index c61ff7d5e02..9a82bb53e01 100644 --- a/src/librustc/middle/trans/base.rs +++ b/src/librustc/middle/trans/base.rs @@ -1874,7 +1874,7 @@ pub fn trans_enum_variant(ccx: @crate_ctxt, // works. So we have to cast to the destination's view of the type. let llarg = match fcx.llargs.find(&va.id) { Some(local_mem(x)) => x, - _ => die!(~"trans_enum_variant: how do we know this works?"), + _ => fail!(~"trans_enum_variant: how do we know this works?"), }; let arg_ty = arg_tys[i].ty; memcpy_ty(bcx, lldestptr, llarg, arg_ty); @@ -2016,7 +2016,7 @@ pub fn trans_item(ccx: @crate_ctxt, item: ast::item) { let path = match ccx.tcx.items.get(&item.id) { ast_map::node_item(_, p) => p, // tjc: ? - _ => die!(~"trans_item"), + _ => fail!(~"trans_item"), }; match /*bad*/copy item.node { ast::item_fn(ref decl, purity, ref tps, ref body) => { @@ -2277,7 +2277,7 @@ pub fn item_path(ccx: @crate_ctxt, i: @ast::item) -> path { /*bad*/copy *match ccx.tcx.items.get(&i.id) { ast_map::node_item(_, p) => p, // separate map for paths? - _ => die!(~"item_path") + _ => fail!(~"item_path") }, ~[path_name(i.ident)]) } @@ -2364,7 +2364,7 @@ pub fn get_item_val(ccx: @crate_ctxt, id: ast::node_id) -> ValueRef { set_inline_hint_if_appr(/*bad*/copy i.attrs, llfn); llfn } - _ => die!(~"get_item_val: weird result in table") + _ => fail!(~"get_item_val: weird result in table") } } ast_map::node_trait_method(trait_method, _, pth) => { @@ -2445,14 +2445,14 @@ pub fn get_item_val(ccx: @crate_ctxt, id: ast::node_id) -> ValueRef { ast::item_enum(_, _) => { register_fn(ccx, (*v).span, pth, id, enm.attrs) } - _ => die!(~"node_variant, shouldn't happen") + _ => fail!(~"node_variant, shouldn't happen") }; } ast::struct_variant_kind(_) => { - die!(~"struct variant kind unexpected in get_item_val") + fail!(~"struct variant kind unexpected in get_item_val") } ast::enum_variant_kind(_) => { - die!(~"enum variant kind unexpected in get_item_val") + fail!(~"enum variant kind unexpected in get_item_val") } } set_inline_hint(llfn); diff --git a/src/librustc/middle/trans/build.rs b/src/librustc/middle/trans/build.rs index 24e9d967fac..43953b68f59 100644 --- a/src/librustc/middle/trans/build.rs +++ b/src/librustc/middle/trans/build.rs @@ -33,7 +33,7 @@ pub fn terminate(cx: block, _: &str) { pub fn check_not_terminated(cx: block) { if cx.terminated { - die!(~"already terminated!"); + fail!(~"already terminated!"); } } diff --git a/src/librustc/middle/trans/cabi_x86_64.rs b/src/librustc/middle/trans/cabi_x86_64.rs index 00235c32d3c..bac91e17e03 100644 --- a/src/librustc/middle/trans/cabi_x86_64.rs +++ b/src/librustc/middle/trans/cabi_x86_64.rs @@ -96,7 +96,7 @@ fn classify_ty(ty: TypeRef) -> ~[x86_64_reg_class] { let elt = llvm::LLVMGetElementType(ty); ty_align(elt) } - _ => die!(~"ty_size: unhandled type") + _ => fail!(~"ty_size: unhandled type") }; } } @@ -122,7 +122,7 @@ fn classify_ty(ty: TypeRef) -> ~[x86_64_reg_class] { let eltsz = ty_size(elt); len * eltsz } - _ => die!(~"ty_size: unhandled type") + _ => fail!(~"ty_size: unhandled type") }; } } @@ -215,7 +215,7 @@ fn classify_ty(ty: TypeRef) -> ~[x86_64_reg_class] { i += 1u; } } - _ => die!(~"classify: unhandled type") + _ => fail!(~"classify: unhandled type") } } } @@ -316,7 +316,7 @@ fn llreg_ty(cls: &[x86_64_reg_class]) -> TypeRef { sse_ds_class => { tys.push(T_f64()); } - _ => die!(~"llregtype: unhandled class") + _ => fail!(~"llregtype: unhandled class") } i += 1u; } diff --git a/src/librustc/middle/trans/callee.rs b/src/librustc/middle/trans/callee.rs index 81fa221aac4..709ab9365ed 100644 --- a/src/librustc/middle/trans/callee.rs +++ b/src/librustc/middle/trans/callee.rs @@ -383,7 +383,7 @@ pub fn trans_rtcall_or_lang_call_with_type_params(bcx: block, llfnty = T_ptr(struct_elt(llfnty, 0)); new_llval = PointerCast(callee.bcx, fn_data.llfn, llfnty); } - _ => die!() + _ => fail!() } Callee { bcx: callee.bcx, data: Fn(FnData { llfn: new_llval }) } }, diff --git a/src/librustc/middle/trans/debuginfo.rs b/src/librustc/middle/trans/debuginfo.rs index f50cadc9671..7c6f03cb364 100644 --- a/src/librustc/middle/trans/debuginfo.rs +++ b/src/librustc/middle/trans/debuginfo.rs @@ -268,7 +268,7 @@ fn create_block(cx: block) -> @metadata { while cx.node_info.is_none() { match cx.parent { Some(b) => cx = b, - None => die!() + None => fail!() } } let sp = cx.node_info.get().span; @@ -553,7 +553,7 @@ fn create_ty(_cx: @crate_ctxt, _t: ty::t, _ty: @ast::Ty) * elsewhere, not be self-contained. */ - die!(); + fail!(); /* fn t_to_ty(cx: crate_ctxt, t: ty::t, span: span) -> @ast::ty { let ty = match ty::get(t).struct { @@ -669,7 +669,7 @@ pub fn create_local_var(bcx: block, local: @ast::local) let name = match local.node.pat.node { ast::pat_ident(_, pth, _) => ast_util::path_to_ident(pth), // FIXME this should be handled (#2533) - _ => die!(~"no single variable name for local") + _ => fail!(~"no single variable name for local") }; let loc = cx.sess.codemap.lookup_char_pos(local.span.lo); let ty = node_id_type(bcx, local.node.id); diff --git a/src/librustc/middle/trans/foreign.rs b/src/librustc/middle/trans/foreign.rs index bb14fce8053..718f41de00a 100644 --- a/src/librustc/middle/trans/foreign.rs +++ b/src/librustc/middle/trans/foreign.rs @@ -498,7 +498,7 @@ pub fn trans_intrinsic(ccx: @crate_ctxt, if tp_sz != out_sz { let sp = match ccx.tcx.items.get(&ref_id.get()) { ast_map::node_expr(e) => e.span, - _ => die!(~"reinterpret_cast or forget has non-expr arg") + _ => fail!(~"reinterpret_cast or forget has non-expr arg") }; ccx.sess.span_fatal( sp, fmt!("reinterpret_cast called on types \ @@ -956,7 +956,7 @@ fn abi_of_foreign_fn(ccx: @crate_ctxt, i: @ast::foreign_item) None => match ccx.tcx.items.get(&i.id) { ast_map::node_foreign_item(_, abi, _) => abi, // ?? - _ => die!(~"abi_of_foreign_fn: not foreign") + _ => fail!(~"abi_of_foreign_fn: not foreign") }, Some(_) => match attr::foreign_abi(i.attrs) { either::Right(abi) => abi, diff --git a/src/librustc/middle/trans/meth.rs b/src/librustc/middle/trans/meth.rs index fb487b98e15..a79a24ba460 100644 --- a/src/librustc/middle/trans/meth.rs +++ b/src/librustc/middle/trans/meth.rs @@ -253,7 +253,7 @@ pub fn trans_method_callee(bcx: block, trait_id, off, vtbl) } // how to get rid of this? - None => die!(~"trans_method_callee: missing param_substs") + None => fail!(~"trans_method_callee: missing param_substs") } } typeck::method_trait(_, off, vstore) => { @@ -265,7 +265,7 @@ pub fn trans_method_callee(bcx: block, mentry.explicit_self) } typeck::method_self(*) | typeck::method_super(*) => { - die!(~"method_self or method_super should have been handled \ + fail!(~"method_self or method_super should have been handled \ above") } } @@ -312,13 +312,13 @@ pub fn trans_static_method_callee(bcx: block, ast_map::node_trait_method(trait_method, _, _) => { ast_util::trait_method_to_ty_method(*trait_method).ident } - _ => die!(~"callee is not a trait method") + _ => fail!(~"callee is not a trait method") } } else { let path = csearch::get_item_path(bcx.tcx(), method_id); match path[path.len()-1] { path_name(s) => { s } - path_mod(_) => { die!(~"path doesn't have a name?") } + path_mod(_) => { fail!(~"path doesn't have a name?") } } }; debug!("trans_static_method_callee: method_id=%?, callee_id=%?, \ @@ -348,7 +348,7 @@ pub fn trans_static_method_callee(bcx: block, FnData {llfn: PointerCast(bcx, lval, llty)} } _ => { - die!(~"vtable_param left in monomorphized \ + fail!(~"vtable_param left in monomorphized \ function's vtable substs"); } } @@ -369,7 +369,7 @@ pub fn method_with_name(ccx: @crate_ctxt, impl_id: ast::def_id, }, _) => { method_from_methods(/*bad*/copy *ms, name).get() } - _ => die!(~"method_with_name") + _ => fail!(~"method_with_name") } } else { csearch::get_impl_method(ccx.sess.cstore, impl_id, name) @@ -397,13 +397,13 @@ pub fn method_with_name_or_default(ccx: @crate_ctxt, impl_id: ast::def_id, return pmi.method_info.did; } } - die!() + fail!() } - None => die!() + None => fail!() } } } - _ => die!(~"method_with_name") + _ => fail!(~"method_with_name") } } else { csearch::get_impl_method(ccx.sess.cstore, impl_id, name) @@ -422,14 +422,14 @@ pub fn method_ty_param_count(ccx: @crate_ctxt, m_id: ast::def_id, method_ty_param_count( ccx, source.method_id, source.impl_id) } - None => die!() + None => fail!() } } Some(ast_map::node_trait_method(@ast::provided(@ref m), _, _)) => { m.tps.len() } - copy e => die!(fmt!("method_ty_param_count %?", e)) + copy e => fail!(fmt!("method_ty_param_count %?", e)) } } else { csearch::get_type_param_count(ccx.sess.cstore, m_id) - @@ -494,7 +494,7 @@ pub fn trans_monomorphized_callee(bcx: block, mentry.explicit_self) } typeck::vtable_param(*) => { - die!(~"vtable_param left in monomorphized function's " + + fail!(~"vtable_param left in monomorphized function's " + "vtable substs"); } }; @@ -770,7 +770,7 @@ pub fn vtable_id(ccx: @crate_ctxt, } } // can't this be checked at the callee? - _ => die!(~"vtable_id") + _ => fail!(~"vtable_id") } } @@ -785,7 +785,7 @@ pub fn get_vtable(ccx: @crate_ctxt, typeck::vtable_static(id, substs, sub_vtables) => { make_impl_vtable(ccx, id, substs, sub_vtables) } - _ => die!(~"get_vtable: expected a static origin") + _ => fail!(~"get_vtable: expected a static origin") } } } diff --git a/src/librustc/middle/trans/reachable.rs b/src/librustc/middle/trans/reachable.rs index bf417e9a5f4..d56d28c982d 100644 --- a/src/librustc/middle/trans/reachable.rs +++ b/src/librustc/middle/trans/reachable.rs @@ -138,7 +138,7 @@ fn traverse_public_item(cx: ctx, item: @item) { } item_const(*) | item_enum(*) | item_trait(*) => (), - item_mac(*) => die!(~"item macros unimplemented") + item_mac(*) => fail!(~"item macros unimplemented") } } diff --git a/src/librustc/middle/trans/type_use.rs b/src/librustc/middle/trans/type_use.rs index 3fd334c2d15..af570e1f259 100644 --- a/src/librustc/middle/trans/type_use.rs +++ b/src/librustc/middle/trans/type_use.rs @@ -148,7 +148,7 @@ pub fn type_uses_for(ccx: @crate_ctxt, fn_id: def_id, n_tps: uint) ~"bswap16" | ~"bswap32" | ~"bswap64" => 0, // would be cool to make these an enum instead of strings! - _ => die!(~"unknown intrinsic in type_use") + _ => fail!(~"unknown intrinsic in type_use") }; for uint::range(0u, n_tps) |n| { cx.uses[n] |= flags;} } diff --git a/src/librustc/middle/ty.rs b/src/librustc/middle/ty.rs index d38eef0fcf9..08885127761 100644 --- a/src/librustc/middle/ty.rs +++ b/src/librustc/middle/ty.rs @@ -1505,7 +1505,7 @@ pub fn get_element_type(ty: t, i: uint) -> t { match /*bad*/copy get(ty).sty { ty_rec(flds) => return flds[i].mt.ty, ty_tup(ts) => return ts[i], - _ => die!(~"get_element_type called on invalid type") + _ => fail!(~"get_element_type called on invalid type") } } @@ -2788,7 +2788,7 @@ pub fn ty_fn_args(fty: t) -> ~[arg] { ty_bare_fn(ref f) => copy f.sig.inputs, ty_closure(ref f) => copy f.sig.inputs, ref s => { - die!(fmt!("ty_fn_args() called on non-fn type: %?", s)) + fail!(fmt!("ty_fn_args() called on non-fn type: %?", s)) } } } @@ -2797,7 +2797,8 @@ pub fn ty_closure_sigil(fty: t) -> Sigil { match get(fty).sty { ty_closure(ref f) => f.sigil, ref s => { - die!(fmt!("ty_closure_sigil() called on non-closure type: %?", s)) + fail!(fmt!("ty_closure_sigil() called on non-closure type: %?", + s)) } } } @@ -2807,7 +2808,7 @@ pub fn ty_fn_purity(fty: t) -> ast::purity { ty_bare_fn(ref f) => f.purity, ty_closure(ref f) => f.purity, ref s => { - die!(fmt!("ty_fn_purity() called on non-fn type: %?", s)) + fail!(fmt!("ty_fn_purity() called on non-fn type: %?", s)) } } } @@ -2817,7 +2818,7 @@ pub pure fn ty_fn_ret(fty: t) -> t { ty_bare_fn(ref f) => f.sig.output, ty_closure(ref f) => f.sig.output, ref s => { - die!(fmt!("ty_fn_ret() called on non-fn type: %?", s)) + fail!(fmt!("ty_fn_ret() called on non-fn type: %?", s)) } } } @@ -2834,7 +2835,7 @@ pub pure fn ty_vstore(ty: t) -> vstore { match get(ty).sty { ty_evec(_, vstore) => vstore, ty_estr(vstore) => vstore, - ref s => die!(fmt!("ty_vstore() called on invalid sty: %?", s)) + ref s => fail!(fmt!("ty_vstore() called on invalid sty: %?", s)) } } @@ -2843,7 +2844,7 @@ pub fn ty_region(ty: t) -> Region { ty_rptr(r, _) => r, ty_evec(_, vstore_slice(r)) => r, ty_estr(vstore_slice(r)) => r, - ref s => die!(fmt!("ty_region() invoked on in appropriate ty: %?", + ref s => fail!(fmt!("ty_region() invoked on in appropriate ty: %?", (*s))) } } @@ -3209,7 +3210,7 @@ pub fn stmt_node_id(s: @ast::stmt) -> ast::node_id { ast::stmt_decl(_, id) | stmt_expr(_, id) | stmt_semi(_, id) => { return id; } - ast::stmt_mac(*) => die!(~"unexpanded macro in trans") + ast::stmt_mac(*) => fail!(~"unexpanded macro in trans") } } @@ -3233,7 +3234,7 @@ pub fn get_field(tcx: ctxt, rec_ty: t, id: ast::ident) -> field { match vec::find(get_fields(rec_ty), |f| f.ident == id) { Some(f) => f, // Do we only call this when we know the field is legit? - None => die!(fmt!("get_field: ty doesn't have a field %s", + None => fail!(fmt!("get_field: ty doesn't have a field %s", tcx.sess.str_of(id))) } } @@ -3242,7 +3243,7 @@ pub fn get_fields(rec_ty:t) -> ~[field] { match /*bad*/copy get(rec_ty).sty { ty_rec(fields) => fields, // Can we check at the caller? - _ => die!(~"get_fields: not a record type") + _ => fail!(~"get_fields: not a record type") } } @@ -3904,10 +3905,10 @@ pub fn enum_variants(cx: ctxt, id: ast::def_id) -> @~[VariantInfo] { } } ast::struct_variant_kind(_) => { - die!(~"struct variant kinds unimpl in enum_variants") + fail!(~"struct variant kinds unimpl in enum_variants") } ast::enum_variant_kind(_) => { - die!(~"enum variant kinds unimpl in enum_variants") + fail!(~"enum variant kinds unimpl in enum_variants") } } }) diff --git a/src/librustc/middle/typeck/check/method.rs b/src/librustc/middle/typeck/check/method.rs index 45b0fa962ad..eca368e5d76 100644 --- a/src/librustc/middle/typeck/check/method.rs +++ b/src/librustc/middle/typeck/check/method.rs @@ -1234,7 +1234,7 @@ pub impl LookupContext { let span = if did.crate == ast::local_crate { match self.tcx().items.find(&did.node) { Some(ast_map::node_method(m, _, _)) => m.span, - _ => die!(fmt!("report_static_candidate: bad item %?", did)) + _ => fail!(fmt!("report_static_candidate: bad item %?", did)) } } else { self.expr.span diff --git a/src/librustc/middle/typeck/check/mod.rs b/src/librustc/middle/typeck/check/mod.rs index d6bd9aa96dd..a8439c3c459 100644 --- a/src/librustc/middle/typeck/check/mod.rs +++ b/src/librustc/middle/typeck/check/mod.rs @@ -2097,7 +2097,7 @@ pub fn check_expr_with_unifier(fcx: @mut FnCtxt, inner_ty, fcx.expr_ty(loop_body)); } ref n => { - die!(fmt!( + fail!(fmt!( "check_loop_body expected expr_fn_block, not %?", n)) } } @@ -2394,7 +2394,7 @@ pub fn check_expr_with_unifier(fcx: @mut FnCtxt, demand::suptype(fcx, b.span, inner_ty, fcx.expr_ty(b)); } // argh - _ => die!(~"expected fn ty") + _ => fail!(~"expected fn ty") } fcx.write_ty(expr.id, fcx.node_ty(b.id)); } diff --git a/src/librustc/middle/typeck/check/vtable.rs b/src/librustc/middle/typeck/check/vtable.rs index 410b4a3e33d..c2a7292c48d 100644 --- a/src/librustc/middle/typeck/check/vtable.rs +++ b/src/librustc/middle/typeck/check/vtable.rs @@ -148,7 +148,7 @@ pub fn fixup_substs(vcx: &VtableContext, location_info: &LocationInfo, do fixup_ty(vcx, location_info, t, is_early).map |t_f| { match ty::get(*t_f).sty { ty::ty_trait(_, ref substs_f, _) => (/*bad*/copy *substs_f), - _ => die!(~"t_f should be a trait") + _ => fail!(~"t_f should be a trait") } } } diff --git a/src/librustc/middle/typeck/coherence.rs b/src/librustc/middle/typeck/coherence.rs index fdf936f7aec..64ac5a9ae82 100644 --- a/src/librustc/middle/typeck/coherence.rs +++ b/src/librustc/middle/typeck/coherence.rs @@ -135,7 +135,7 @@ pub fn get_base_type_def_id(inference_context: @mut InferCtxt, return Some(def_id); } _ => { - die!(~"get_base_type() returned a type that wasn't an \ + fail!(~"get_base_type() returned a type that wasn't an \ enum, class, or trait"); } } diff --git a/src/librustc/middle/typeck/collect.rs b/src/librustc/middle/typeck/collect.rs index 982a8d7d957..2a42e75f53d 100644 --- a/src/librustc/middle/typeck/collect.rs +++ b/src/librustc/middle/typeck/collect.rs @@ -870,8 +870,8 @@ pub fn ty_of_item(ccx: @mut CrateCtxt, it: @ast::item) return tpt; } ast::item_impl(*) | ast::item_mod(_) | - ast::item_foreign_mod(_) => die!(), - ast::item_mac(*) => die!(~"item macros unimplemented") + ast::item_foreign_mod(_) => fail!(), + ast::item_mac(*) => fail!(~"item macros unimplemented") } } diff --git a/src/librustc/middle/typeck/infer/test.rs b/src/librustc/middle/typeck/infer/test.rs index 416dcbcd30a..d79343e64a6 100644 --- a/src/librustc/middle/typeck/infer/test.rs +++ b/src/librustc/middle/typeck/infer/test.rs @@ -102,7 +102,7 @@ impl Env { return match search_mod(self, &self.crate.node.module, 0, names) { Some(id) => id, None => { - die!(fmt!("No item found: `%s`", str::connect(names, "::"))); + fail!(fmt!("No item found: `%s`", str::connect(names, "::"))); } }; @@ -155,7 +155,7 @@ impl Env { fn assert_subtype(&self, a: ty::t, b: ty::t) { if !self.is_subtype(a, b) { - die!(fmt!("%s is not a subtype of %s, but it should be", + fail!(fmt!("%s is not a subtype of %s, but it should be", self.ty_to_str(a), self.ty_to_str(b))); } @@ -163,7 +163,7 @@ impl Env { fn assert_not_subtype(&self, a: ty::t, b: ty::t) { if self.is_subtype(a, b) { - die!(fmt!("%s is a subtype of %s, but it shouldn't be", + fail!(fmt!("%s is a subtype of %s, but it shouldn't be", self.ty_to_str(a), self.ty_to_str(b))); } @@ -240,7 +240,7 @@ impl Env { fn check_lub(&self, t1: ty::t, t2: ty::t, t_lub: ty::t) { match self.lub().tys(t1, t2) { Err(e) => { - die!(fmt!("Unexpected error computing LUB: %?", e)) + fail!(fmt!("Unexpected error computing LUB: %?", e)) } Ok(t) => { self.assert_eq(t, t_lub); @@ -262,7 +262,7 @@ impl Env { self.ty_to_str(t_glb)); match self.glb().tys(t1, t2) { Err(e) => { - die!(fmt!("Unexpected error computing LUB: %?", e)) + fail!(fmt!("Unexpected error computing LUB: %?", e)) } Ok(t) => { self.assert_eq(t, t_glb); @@ -281,7 +281,7 @@ impl Env { match self.lub().tys(t1, t2) { Err(_) => {} Ok(t) => { - die!(fmt!("Unexpected success computing LUB: %?", + fail!(fmt!("Unexpected success computing LUB: %?", self.ty_to_str(t))) } } @@ -292,7 +292,7 @@ impl Env { match self.glb().tys(t1, t2) { Err(_) => {} Ok(t) => { - die!(fmt!("Unexpected success computing GLB: %?", + fail!(fmt!("Unexpected success computing GLB: %?", self.ty_to_str(t))) } } diff --git a/src/librustc/rustc.rc b/src/librustc/rustc.rc index 5273dbd3049..62067a4bd7a 100644 --- a/src/librustc/rustc.rc +++ b/src/librustc/rustc.rc @@ -368,7 +368,7 @@ pub fn monitor(+f: fn~(diagnostic::Emitter)) { } } // Fail so the process returns a failure code - die!(); + fail!(); } } } diff --git a/src/librustdoc/attr_pass.rs b/src/librustdoc/attr_pass.rs index c595ebce65f..9669beae575 100644 --- a/src/librustdoc/attr_pass.rs +++ b/src/librustdoc/attr_pass.rs @@ -119,7 +119,7 @@ fn parse_item_attrs( let attrs = match ctxt.ast_map.get(&id) { ast_map::node_item(item, _) => copy item.attrs, ast_map::node_foreign_item(item, _, _) => copy item.attrs, - _ => die!(~"parse_item_attrs: not an item") + _ => fail!(~"parse_item_attrs: not an item") }; parse_attrs(attrs) } @@ -183,7 +183,7 @@ fn fold_enum( copy ast_variant.node.attrs) } _ => { - die!(fmt!("Enum variant %s has id that's \ + fail!(fmt!("Enum variant %s has id that's \ not bound to an enum item", variant.name)) } @@ -258,7 +258,7 @@ fn merge_method_attrs( attr_parser::parse_desc(copy method.attrs)) }) } - _ => die!(~"unexpected item") + _ => fail!(~"unexpected item") } }; diff --git a/src/librustdoc/demo.rs b/src/librustdoc/demo.rs index ff6b745612d..ffc0d668aed 100644 --- a/src/librustdoc/demo.rs +++ b/src/librustdoc/demo.rs @@ -71,7 +71,7 @@ fn take_my_order_please( * This function is full of fail */ - die!(); + fail!(); } mod fortress_of_solitude { @@ -192,6 +192,6 @@ impl OmNomNomy: TheShunnedHouse { } fn construct(&self) -> bool { - die!(); + fail!(); } } diff --git a/src/librustdoc/extract.rs b/src/librustdoc/extract.rs index 822a423eae4..0184945d6f8 100644 --- a/src/librustdoc/extract.rs +++ b/src/librustdoc/extract.rs @@ -322,7 +322,7 @@ fn structdoc_from_struct( fields: do struct_def.fields.map |field| { match field.node.kind { ast::named_field(ident, _, _) => to_str(ident), - ast::unnamed_field => die!( + ast::unnamed_field => fail!( ~"what is an unnamed struct field?") } }, diff --git a/src/librustdoc/markdown_pass.rs b/src/librustdoc/markdown_pass.rs index 161642a2f3d..bf499e2c5d0 100644 --- a/src/librustdoc/markdown_pass.rs +++ b/src/librustdoc/markdown_pass.rs @@ -539,7 +539,7 @@ fn write_sig(ctxt: &Ctxt, sig: Option<~str>) { ctxt.w.write_line(code_block_indent(sig)); ctxt.w.write_line(~""); } - None => die!(~"unimplemented") + None => fail!(~"unimplemented") } } diff --git a/src/librustdoc/markdown_writer.rs b/src/librustdoc/markdown_writer.rs index 9b5efb7c90d..7577785d954 100644 --- a/src/librustdoc/markdown_writer.rs +++ b/src/librustdoc/markdown_writer.rs @@ -145,7 +145,7 @@ fn pandoc_writer( if status != 0 { error!("pandoc-out: %s", stdout); error!("pandoc-err: %s", stderr); - die!(~"pandoc failed"); + fail!(~"pandoc failed"); } } } @@ -287,7 +287,7 @@ fn write_file(path: &Path, s: ~str) { result::Ok(writer) => { writer.write_str(s); } - result::Err(e) => die!(e) + result::Err(e) => fail!(e) } } diff --git a/src/librustdoc/tystr_pass.rs b/src/librustdoc/tystr_pass.rs index 58a2e0e1324..c14eb32022f 100644 --- a/src/librustdoc/tystr_pass.rs +++ b/src/librustdoc/tystr_pass.rs @@ -80,7 +80,7 @@ fn get_fn_sig(srv: astsrv::Srv, fn_id: doc::AstId) -> Option<~str> { Some(pprust::fun_to_str(*decl, ident, copy *tys, extract::interner())) } - _ => die!(~"get_fn_sig: fn_id not bound to a fn item") + _ => fail!(~"get_fn_sig: fn_id not bound to a fn item") } } } @@ -113,7 +113,7 @@ fn fold_const( }, _) => { pprust::ty_to_str(ty, extract::interner()) } - _ => die!(~"fold_const: id not bound to a const item") + _ => fail!(~"fold_const: id not bound to a const item") } }}), .. doc @@ -150,7 +150,7 @@ fn fold_enum( pprust::variant_to_str( ast_variant, extract::interner()) } - _ => die!(~"enum variant not bound to an enum item") + _ => fail!(~"enum variant not bound to an enum item") } } }; @@ -229,7 +229,7 @@ fn get_method_sig( } } } - _ => die!(~"method not found") + _ => fail!(~"method not found") } } ast_map::node_item(@ast::item { @@ -246,10 +246,10 @@ fn get_method_sig( extract::interner() )) } - None => die!(~"method not found") + None => fail!(~"method not found") } } - _ => die!(~"get_method_sig: item ID not bound to trait or impl") + _ => fail!(~"get_method_sig: item ID not bound to trait or impl") } } } @@ -282,7 +282,7 @@ fn fold_impl( Some(pprust::ty_to_str( self_ty, extract::interner()))) } - _ => die!(~"expected impl") + _ => fail!(~"expected impl") } } }; @@ -315,7 +315,7 @@ fn should_add_impl_self_ty() { #[test] fn should_add_impl_method_sigs() { - let doc = test::mk_doc(~"impl int { fn a() -> int { die!() } }"); + let doc = test::mk_doc(~"impl int { fn a() -> int { fail!() } }"); assert doc.cratemod().impls()[0].methods[0].sig == Some(~"fn a() -> int"); } @@ -345,7 +345,7 @@ fn fold_type( extract::interner()) )) } - _ => die!(~"expected type") + _ => fail!(~"expected type") } } }, @@ -375,7 +375,7 @@ fn fold_struct( Some(pprust::item_to_str(item, extract::interner())) } - _ => die!(~"not an item") + _ => fail!(~"not an item") } } }, @@ -396,7 +396,7 @@ fn strip_struct_extra_stuff(item: @ast::item) -> @ast::item { }; ast::item_struct(def, tys) } - _ => die!(~"not a struct") + _ => fail!(~"not a struct") }; @ast::item { diff --git a/src/librusti/rusti.rc b/src/librusti/rusti.rc index 062d7841160..87beeaf4ec2 100644 --- a/src/librusti/rusti.rc +++ b/src/librusti/rusti.rc @@ -178,10 +178,10 @@ fn run(repl: Repl, input: ~str) -> Repl { ast::expr_call(_, exprs, _) => { match exprs[0].node { ast::expr_block(blk) => @blk, - _ => die!() + _ => fail!() } } - _ => die!() + _ => fail!() }; debug!("recording input into repl history"); record(repl, blk, sess.parse_sess.interner) @@ -320,7 +320,7 @@ fn run_cmd(repl: &mut Repl, _in: io::Reader, _out: io::Writer, let mut end_multiline = false; while (!end_multiline) { match get_line(~"rusti| ") { - None => die!(~"unterminated multiline command :{ .. :}"), + None => fail!(~"unterminated multiline command :{ .. :}"), Some(line) => { if str::trim(line) == ~":}" { end_multiline = true; diff --git a/src/libstd/arc.rs b/src/libstd/arc.rs index ff28d2cbebf..0a51a7ef191 100644 --- a/src/libstd/arc.rs +++ b/src/libstd/arc.rs @@ -224,7 +224,7 @@ pub fn unwrap_mutex_arc(arc: MutexARC) -> T { let inner = unsafe { unwrap_shared_mutable_state(move x) }; let MutexARCInner { failed: failed, data: data, _ } = move inner; if failed { - die!(~"Can't unwrap poisoned MutexARC - another task failed inside!") + fail!(~"Can't unwrap poisoned MutexARC - another task failed inside!") } move data } @@ -235,9 +235,9 @@ pub fn unwrap_mutex_arc(arc: MutexARC) -> T { fn check_poison(is_mutex: bool, failed: bool) { if failed { if is_mutex { - die!(~"Poisoned MutexARC - another task failed inside!"); + fail!(~"Poisoned MutexARC - another task failed inside!"); } else { - die!(~"Poisoned rw_arc - another task failed inside!"); + fail!(~"Poisoned rw_arc - another task failed inside!"); } } } @@ -423,7 +423,7 @@ pub fn unwrap_rw_arc(arc: RWARC) -> T { let inner = unsafe { unwrap_shared_mutable_state(move x) }; let RWARCInner { failed: failed, data: data, _ } = move inner; if failed { - die!(~"Can't unwrap poisoned RWARC - another task failed inside!") + fail!(~"Can't unwrap poisoned RWARC - another task failed inside!") } move data } diff --git a/src/libstd/arena.rs b/src/libstd/arena.rs index a2cbe27ea90..9beb8e276ef 100644 --- a/src/libstd/arena.rs +++ b/src/libstd/arena.rs @@ -303,6 +303,6 @@ fn test_arena_destructors_fail() { // get freed too. do arena.alloc { @20 }; // Now fail. - die!(); + fail!(); }; } diff --git a/src/libstd/base64.rs b/src/libstd/base64.rs index d9e121798f1..10ea113f74e 100644 --- a/src/libstd/base64.rs +++ b/src/libstd/base64.rs @@ -63,7 +63,7 @@ impl &[u8]: ToBase64 { str::push_char(&mut s, chars[(n >> 6u) & 63u]); str::push_char(&mut s, '='); } - _ => die!(~"Algebra is broken, please alert the math police") + _ => fail!(~"Algebra is broken, please alert the math police") } } s @@ -82,7 +82,7 @@ pub trait FromBase64 { impl ~[u8]: FromBase64 { pure fn from_base64() -> ~[u8] { - if self.len() % 4u != 0u { die!(~"invalid base64 length"); } + if self.len() % 4u != 0u { fail!(~"invalid base64 length"); } let len = self.len(); let mut padding = 0u; @@ -124,10 +124,10 @@ impl ~[u8]: FromBase64 { r.push(((n >> 10u) & 0xFFu) as u8); return copy r; } - _ => die!(~"invalid base64 padding") + _ => fail!(~"invalid base64 padding") } } else { - die!(~"invalid base64 character"); + fail!(~"invalid base64 character"); } i += 1u; diff --git a/src/libstd/bigint.rs b/src/libstd/bigint.rs index 092a0d18a0f..2c713e58e9a 100644 --- a/src/libstd/bigint.rs +++ b/src/libstd/bigint.rs @@ -245,7 +245,7 @@ impl BigUint : Modulo { } impl BigUint : Neg { - pure fn neg(&self) -> BigUint { die!() } + pure fn neg(&self) -> BigUint { fail!() } } impl BigUint : IntConvertible { @@ -332,7 +332,7 @@ pub impl BigUint { } pure fn divmod(&self, other: &BigUint) -> (BigUint, BigUint) { - if other.is_zero() { die!() } + if other.is_zero() { fail!() } if self.is_zero() { return (Zero::zero(), Zero::zero()); } if *other == One::one() { return (copy *self, Zero::zero()); } @@ -523,7 +523,7 @@ priv pure fn get_radix_base(radix: uint) -> (uint, uint) { 14 => (1475789056, 8), 15 => (2562890625, 8), 16 => (4294967296, 8), - _ => die!() + _ => fail!() } } @@ -547,7 +547,7 @@ priv pure fn get_radix_base(radix: uint) -> (uint, uint) { 14 => (38416, 4), 15 => (50625, 4), 16 => (65536, 4), - _ => die!() + _ => fail!() } } @@ -797,7 +797,7 @@ pub impl BigInt { let d = BigInt::from_biguint(Plus, d_ui), m = BigInt::from_biguint(Plus, m_ui); match (self.sign, other.sign) { - (_, Zero) => die!(), + (_, Zero) => fail!(), (Plus, Plus) | (Zero, Plus) => (d, m), (Plus, Minus) | (Zero, Minus) => if m.is_zero() { (-d, Zero::zero()) @@ -828,7 +828,7 @@ pub impl BigInt { let q = BigInt::from_biguint(Plus, q_ui); let r = BigInt::from_biguint(Plus, r_ui); match (self.sign, other.sign) { - (_, Zero) => die!(), + (_, Zero) => fail!(), (Plus, Plus) | (Zero, Plus) => ( q, r), (Plus, Minus) | (Zero, Minus) => (-q, r), (Minus, Plus) => (-q, -r), @@ -1193,7 +1193,7 @@ mod biguint_tests { ~"2" + str::from_chars(vec::from_elem(bits / 2 - 1, '0')) + "1"), (10, match bits { - 32 => ~"8589934593", 16 => ~"131073", _ => die!() + 32 => ~"8589934593", 16 => ~"131073", _ => fail!() }), (16, ~"2" + @@ -1210,7 +1210,7 @@ mod biguint_tests { (10, match bits { 32 => ~"55340232229718589441", 16 => ~"12885032961", - _ => die!() + _ => fail!() }), (16, ~"3" + str::from_chars(vec::from_elem(bits / 4 - 1, '0')) + "2" + @@ -1257,7 +1257,7 @@ mod biguint_tests { fn check(n: uint, s: &str) { let n = factor(n); let ans = match BigUint::from_str_radix(s, 10) { - Some(x) => x, None => die!() + Some(x) => x, None => fail!() }; assert n == ans; } diff --git a/src/libstd/bitv.rs b/src/libstd/bitv.rs index a94c4f79064..d62fb2e8f6e 100644 --- a/src/libstd/bitv.rs +++ b/src/libstd/bitv.rs @@ -240,7 +240,7 @@ pub fn Bitv (nbits: uint, init: bool) -> Bitv { priv impl Bitv { fn die() -> ! { - die!(~"Tried to do operation on bit vectors with different sizes"); + fail!(~"Tried to do operation on bit vectors with different sizes"); } #[inline(always)] @@ -985,7 +985,7 @@ mod tests { let b = Bitv(14, true); b.clear(); for b.ones |i| { - die!(fmt!("found 1 at %?", i)); + fail!(fmt!("found 1 at %?", i)); } } @@ -994,7 +994,7 @@ mod tests { let b = Bitv(140, true); b.clear(); for b.ones |i| { - die!(fmt!("found 1 at %?", i)); + fail!(fmt!("found 1 at %?", i)); } } } diff --git a/src/libstd/cell.rs b/src/libstd/cell.rs index 10a896a4089..f0ec3c1b9d7 100644 --- a/src/libstd/cell.rs +++ b/src/libstd/cell.rs @@ -32,7 +32,7 @@ impl Cell { /// Yields the value, failing if the cell is empty. fn take() -> T { if self.is_empty() { - die!(~"attempt to take an empty cell"); + fail!(~"attempt to take an empty cell"); } let mut value = None; @@ -43,7 +43,7 @@ impl Cell { /// Returns the value, failing if the cell is full. fn put_back(value: T) { if !self.is_empty() { - die!(~"attempt to put a value back into a full cell"); + fail!(~"attempt to put a value back into a full cell"); } self.value = Some(move value); } diff --git a/src/libstd/deque.rs b/src/libstd/deque.rs index 465c5d8f8fe..7d819ba0b3f 100644 --- a/src/libstd/deque.rs +++ b/src/libstd/deque.rs @@ -57,7 +57,7 @@ pub fn create() -> Deque { move rv } fn get(elts: &DVec>, i: uint) -> T { - match (*elts).get_elt(i) { Some(move t) => t, _ => die!() } + match (*elts).get_elt(i) { Some(move t) => t, _ => fail!() } } struct Repr { diff --git a/src/libstd/ebml.rs b/src/libstd/ebml.rs index 768d2dbf2d4..c332c7656b4 100644 --- a/src/libstd/ebml.rs +++ b/src/libstd/ebml.rs @@ -107,7 +107,7 @@ pub mod reader { (data[start + 2u] as uint) << 8u | (data[start + 3u] as uint), next: start + 4u}; - } else { error!("vint too big"); die!(); } + } else { error!("vint too big"); fail!(); } } pub fn Doc(data: @~[u8]) -> Doc { @@ -143,7 +143,7 @@ pub mod reader { Some(d) => d, None => { error!("failed to find block with tag %u", tg); - die!(); + fail!(); } } } @@ -230,7 +230,7 @@ pub mod reader { self.pos = r_doc.end; let str = doc_as_str(r_doc); if lbl != str { - die!(fmt!("Expected label %s but found %s", lbl, + fail!(fmt!("Expected label %s but found %s", lbl, str)); } } @@ -240,7 +240,7 @@ pub mod reader { fn next_doc(exp_tag: EbmlEncoderTag) -> Doc { debug!(". next_doc(exp_tag=%?)", exp_tag); if self.pos >= self.parent.end { - die!(~"no more documents in current node!"); + fail!(~"no more documents in current node!"); } let TaggedDoc { tag: r_tag, doc: r_doc } = doc_at(self.parent.data, self.pos); @@ -248,11 +248,11 @@ pub mod reader { copy self.parent.start, copy self.parent.end, copy self.pos, r_tag, r_doc.start, r_doc.end); if r_tag != (exp_tag as uint) { - die!(fmt!("expected EBML doc with tag %? but found tag %?", + fail!(fmt!("expected EBML doc with tag %? but found tag %?", exp_tag, r_tag)); } if r_doc.end > self.parent.end { - die!(fmt!("invalid EBML, child extends to 0x%x, \ + fail!(fmt!("invalid EBML, child extends to 0x%x, \ parent to 0x%x", r_doc.end, self.parent.end)); } self.pos = r_doc.end; @@ -295,7 +295,7 @@ pub mod reader { fn read_uint(&self) -> uint { let v = doc_as_u64(self.next_doc(EsUint)); if v > (::core::uint::max_value as u64) { - die!(fmt!("uint %? too large for this architecture", v)); + fail!(fmt!("uint %? too large for this architecture", v)); } v as uint } @@ -307,7 +307,7 @@ pub mod reader { fn read_int(&self) -> int { let v = doc_as_u64(self.next_doc(EsInt)) as i64; if v > (int::max_value as i64) || v < (int::min_value as i64) { - die!(fmt!("int %? out of range for this architecture", v)); + fail!(fmt!("int %? out of range for this architecture", v)); } v as int } @@ -315,14 +315,14 @@ pub mod reader { fn read_bool(&self) -> bool { doc_as_u8(self.next_doc(EsBool)) as bool } - fn read_f64(&self) -> f64 { die!(~"read_f64()"); } - fn read_f32(&self) -> f32 { die!(~"read_f32()"); } - fn read_float(&self) -> float { die!(~"read_float()"); } + fn read_f64(&self) -> f64 { fail!(~"read_f64()"); } + fn read_f32(&self) -> f32 { fail!(~"read_f32()"); } + fn read_float(&self) -> float { fail!(~"read_float()"); } - fn read_char(&self) -> char { die!(~"read_char()"); } + fn read_char(&self) -> char { fail!(~"read_char()"); } fn read_owned_str(&self) -> ~str { doc_as_str(self.next_doc(EsStr)) } - fn read_managed_str(&self) -> @str { die!(~"read_managed_str()"); } + fn read_managed_str(&self) -> @str { fail!(~"read_managed_str()"); } // Compound types: fn read_owned(&self, f: fn() -> T) -> T { @@ -431,7 +431,7 @@ pub mod writer { n as u8]), 4u => w.write(&[0x10u8 | ((n >> 24_u) as u8), (n >> 16_u) as u8, (n >> 8_u) as u8, n as u8]), - _ => die!(fmt!("vint to write too big: %?", n)) + _ => fail!(fmt!("vint to write too big: %?", n)) }; } @@ -440,7 +440,7 @@ pub mod writer { if n < 0x4000_u { write_sized_vuint(w, n, 2u); return; } if n < 0x200000_u { write_sized_vuint(w, n, 3u); return; } if n < 0x10000000_u { write_sized_vuint(w, n, 4u); return; } - die!(fmt!("vint to write too big: %?", n)); + fail!(fmt!("vint to write too big: %?", n)); } pub fn Encoder(w: io::Writer) -> Encoder { @@ -602,17 +602,17 @@ pub mod writer { // FIXME (#2742): implement these fn emit_f64(&self, _v: f64) { - die!(~"Unimplemented: serializing an f64"); + fail!(~"Unimplemented: serializing an f64"); } fn emit_f32(&self, _v: f32) { - die!(~"Unimplemented: serializing an f32"); + fail!(~"Unimplemented: serializing an f32"); } fn emit_float(&self, _v: float) { - die!(~"Unimplemented: serializing a float"); + fail!(~"Unimplemented: serializing a float"); } fn emit_char(&self, _v: char) { - die!(~"Unimplemented: serializing a char"); + fail!(~"Unimplemented: serializing a char"); } fn emit_borrowed_str(&self, v: &str) { diff --git a/src/libstd/flatpipes.rs b/src/libstd/flatpipes.rs index ba95fa5b661..a7507a971c8 100644 --- a/src/libstd/flatpipes.rs +++ b/src/libstd/flatpipes.rs @@ -262,7 +262,7 @@ pub impl,P:BytePort> FlatPort: GenericPort { fn recv() -> T { match self.try_recv() { Some(move val) => move val, - None => die!(~"port is closed") + None => fail!(~"port is closed") } } fn try_recv() -> Option { @@ -298,7 +298,7 @@ pub impl,P:BytePort> FlatPort: GenericPort { } } else { - die!(~"flatpipe: unrecognized command"); + fail!(~"flatpipe: unrecognized command"); } } } @@ -480,7 +480,7 @@ pub mod flatteners { Ok(move json) => { json::Decoder(move json) } - Err(e) => die!(fmt!("flatpipe: can't parse json: %?", e)) + Err(e) => fail!(fmt!("flatpipe: can't parse json: %?", e)) } } } diff --git a/src/libstd/future.rs b/src/libstd/future.rs index 57b768a742f..ec71c30242c 100644 --- a/src/libstd/future.rs +++ b/src/libstd/future.rs @@ -65,14 +65,14 @@ impl Future { unsafe { match self.state { Forced(ref mut v) => { return cast::transmute(v); } - Evaluating => die!(~"Recursive forcing of future!"), + Evaluating => fail!(~"Recursive forcing of future!"), Pending(_) => {} } let mut state = Evaluating; self.state <-> state; match move state { - Forced(_) | Evaluating => die!(~"Logic error."), + Forced(_) | Evaluating => fail!(~"Logic error."), Pending(move f) => { self.state = Forced(move f()); self.get_ref() @@ -195,7 +195,7 @@ pub mod test { #[should_fail] #[ignore(cfg(target_os = "win32"))] pub fn test_futurefail() { - let f = spawn(|| die!()); + let f = spawn(|| fail!()); let _x: ~str = f.get(); } diff --git a/src/libstd/getopts.rs b/src/libstd/getopts.rs index e3f8ef1b2b5..3d6d0b1bb7d 100644 --- a/src/libstd/getopts.rs +++ b/src/libstd/getopts.rs @@ -349,7 +349,7 @@ fn opt_vals(mm: &Matches, nm: &str) -> ~[Optval] { Some(id) => mm.vals[id], None => { error!("No option '%s' defined", nm); - die!() + fail!() } }; } @@ -385,7 +385,7 @@ pub fn opts_present(mm: &Matches, names: &[~str]) -> bool { * argument */ pub fn opt_str(mm: &Matches, nm: &str) -> ~str { - return match opt_val(mm, nm) { Val(copy s) => s, _ => die!() }; + return match opt_val(mm, nm) { Val(copy s) => s, _ => fail!() }; } /** @@ -401,7 +401,7 @@ pub fn opts_str(mm: &Matches, names: &[~str]) -> ~str { _ => () } } - die!(); + fail!(); } @@ -551,7 +551,7 @@ pub mod groups { match ((*lopt).short_name.len(), (*lopt).long_name.len()) { - (0,0) => die!(~"this long-format option was given no name"), + (0,0) => fail!(~"this long-format option was given no name"), (0,_) => ~[Opt {name: Long(((*lopt).long_name)), hasarg: (*lopt).hasarg, @@ -568,7 +568,7 @@ pub mod groups { hasarg: (*lopt).hasarg, occur: (*lopt).occur}], - (_,_) => die!(~"something is wrong with the long-form opt") + (_,_) => fail!(~"something is wrong with the long-form opt") } } @@ -599,7 +599,7 @@ pub mod groups { row += match short_name.len() { 0 => ~"", 1 => ~"-" + short_name + " ", - _ => die!(~"the short name should only be 1 char long"), + _ => fail!(~"the short name should only be 1 char long"), }; // long option @@ -669,7 +669,7 @@ mod tests { assert (opt_present(m, ~"test")); assert (opt_str(m, ~"test") == ~"20"); } - _ => { die!(~"test_reqopt_long failed"); } + _ => { fail!(~"test_reqopt_long failed"); } } } @@ -680,7 +680,7 @@ mod tests { let rs = getopts(args, opts); match rs { Err(copy f) => check_fail_type(f, OptionMissing_), - _ => die!() + _ => fail!() } } @@ -691,7 +691,7 @@ mod tests { let rs = getopts(args, opts); match rs { Err(copy f) => check_fail_type(f, ArgumentMissing_), - _ => die!() + _ => fail!() } } @@ -702,7 +702,7 @@ mod tests { let rs = getopts(args, opts); match rs { Err(copy f) => check_fail_type(f, OptionDuplicated_), - _ => die!() + _ => fail!() } } @@ -716,7 +716,7 @@ mod tests { assert (opt_present(m, ~"t")); assert (opt_str(m, ~"t") == ~"20"); } - _ => die!() + _ => fail!() } } @@ -727,7 +727,7 @@ mod tests { let rs = getopts(args, opts); match rs { Err(copy f) => check_fail_type(f, OptionMissing_), - _ => die!() + _ => fail!() } } @@ -738,7 +738,7 @@ mod tests { let rs = getopts(args, opts); match rs { Err(copy f) => check_fail_type(f, ArgumentMissing_), - _ => die!() + _ => fail!() } } @@ -749,7 +749,7 @@ mod tests { let rs = getopts(args, opts); match rs { Err(copy f) => check_fail_type(f, OptionDuplicated_), - _ => die!() + _ => fail!() } } @@ -765,7 +765,7 @@ mod tests { assert (opt_present(m, ~"test")); assert (opt_str(m, ~"test") == ~"20"); } - _ => die!() + _ => fail!() } } @@ -776,7 +776,7 @@ mod tests { let rs = getopts(args, opts); match rs { Ok(ref m) => assert (!opt_present(m, ~"test")), - _ => die!() + _ => fail!() } } @@ -787,7 +787,7 @@ mod tests { let rs = getopts(args, opts); match rs { Err(copy f) => check_fail_type(f, ArgumentMissing_), - _ => die!() + _ => fail!() } } @@ -798,7 +798,7 @@ mod tests { let rs = getopts(args, opts); match rs { Err(copy f) => check_fail_type(f, OptionDuplicated_), - _ => die!() + _ => fail!() } } @@ -812,7 +812,7 @@ mod tests { assert (opt_present(m, ~"t")); assert (opt_str(m, ~"t") == ~"20"); } - _ => die!() + _ => fail!() } } @@ -823,7 +823,7 @@ mod tests { let rs = getopts(args, opts); match rs { Ok(ref m) => assert (!opt_present(m, ~"t")), - _ => die!() + _ => fail!() } } @@ -834,7 +834,7 @@ mod tests { let rs = getopts(args, opts); match rs { Err(copy f) => check_fail_type(f, ArgumentMissing_), - _ => die!() + _ => fail!() } } @@ -845,7 +845,7 @@ mod tests { let rs = getopts(args, opts); match rs { Err(copy f) => check_fail_type(f, OptionDuplicated_), - _ => die!() + _ => fail!() } } @@ -858,7 +858,7 @@ mod tests { let rs = getopts(args, opts); match rs { Ok(ref m) => assert (opt_present(m, ~"test")), - _ => die!() + _ => fail!() } } @@ -869,7 +869,7 @@ mod tests { let rs = getopts(args, opts); match rs { Ok(ref m) => assert (!opt_present(m, ~"test")), - _ => die!() + _ => fail!() } } @@ -883,7 +883,7 @@ mod tests { log(error, fail_str(f)); check_fail_type(f, UnexpectedArgument_); } - _ => die!() + _ => fail!() } } @@ -894,7 +894,7 @@ mod tests { let rs = getopts(args, opts); match rs { Err(copy f) => check_fail_type(f, OptionDuplicated_), - _ => die!() + _ => fail!() } } @@ -905,7 +905,7 @@ mod tests { let rs = getopts(args, opts); match rs { Ok(ref m) => assert (opt_present(m, ~"t")), - _ => die!() + _ => fail!() } } @@ -916,7 +916,7 @@ mod tests { let rs = getopts(args, opts); match rs { Ok(ref m) => assert (!opt_present(m, ~"t")), - _ => die!() + _ => fail!() } } @@ -931,7 +931,7 @@ mod tests { assert (m.free[0] == ~"20"); } - _ => die!() + _ => fail!() } } @@ -942,7 +942,7 @@ mod tests { let rs = getopts(args, opts); match rs { Err(copy f) => check_fail_type(f, OptionDuplicated_), - _ => die!() + _ => fail!() } } @@ -956,7 +956,7 @@ mod tests { Ok(ref m) => { assert (opt_count(m, ~"v") == 1); } - _ => die!() + _ => fail!() } } @@ -969,7 +969,7 @@ mod tests { Ok(ref m) => { assert (opt_count(m, ~"v") == 2); } - _ => die!() + _ => fail!() } } @@ -982,7 +982,7 @@ mod tests { Ok(ref m) => { assert (opt_count(m, ~"v") == 2); } - _ => die!() + _ => fail!() } } @@ -995,7 +995,7 @@ mod tests { Ok(ref m) => { assert (opt_count(m, ~"verbose") == 1); } - _ => die!() + _ => fail!() } } @@ -1008,7 +1008,7 @@ mod tests { Ok(ref m) => { assert (opt_count(m, ~"verbose") == 2); } - _ => die!() + _ => fail!() } } @@ -1023,7 +1023,7 @@ mod tests { assert (opt_present(m, ~"test")); assert (opt_str(m, ~"test") == ~"20"); } - _ => die!() + _ => fail!() } } @@ -1034,7 +1034,7 @@ mod tests { let rs = getopts(args, opts); match rs { Ok(ref m) => assert (!opt_present(m, ~"test")), - _ => die!() + _ => fail!() } } @@ -1045,7 +1045,7 @@ mod tests { let rs = getopts(args, opts); match rs { Err(copy f) => check_fail_type(f, ArgumentMissing_), - _ => die!() + _ => fail!() } } @@ -1062,7 +1062,7 @@ mod tests { assert (pair[0] == ~"20"); assert (pair[1] == ~"30"); } - _ => die!() + _ => fail!() } } @@ -1076,7 +1076,7 @@ mod tests { assert (opt_present(m, ~"t")); assert (opt_str(m, ~"t") == ~"20"); } - _ => die!() + _ => fail!() } } @@ -1087,7 +1087,7 @@ mod tests { let rs = getopts(args, opts); match rs { Ok(ref m) => assert (!opt_present(m, ~"t")), - _ => die!() + _ => fail!() } } @@ -1098,7 +1098,7 @@ mod tests { let rs = getopts(args, opts); match rs { Err(copy f) => check_fail_type(f, ArgumentMissing_), - _ => die!() + _ => fail!() } } @@ -1115,7 +1115,7 @@ mod tests { assert (pair[0] == ~"20"); assert (pair[1] == ~"30"); } - _ => die!() + _ => fail!() } } @@ -1126,7 +1126,7 @@ mod tests { let rs = getopts(args, opts); match rs { Err(copy f) => check_fail_type(f, UnrecognizedOption_), - _ => die!() + _ => fail!() } } @@ -1137,7 +1137,7 @@ mod tests { let rs = getopts(args, opts); match rs { Err(copy f) => check_fail_type(f, UnrecognizedOption_), - _ => die!() + _ => fail!() } } @@ -1169,7 +1169,7 @@ mod tests { assert (pair[1] == ~"-60 70"); assert (!opt_present(m, ~"notpresent")); } - _ => die!() + _ => fail!() } } @@ -1179,7 +1179,7 @@ mod tests { let opts = ~[optopt(~"e"), optopt(~"encrypt")]; let matches = &match getopts(args, opts) { result::Ok(move m) => m, - result::Err(_) => die!() + result::Err(_) => fail!() }; assert opts_present(matches, ~[~"e"]); assert opts_present(matches, ~[~"encrypt"]); @@ -1200,7 +1200,7 @@ mod tests { let opts = ~[optmulti(~"L"), optmulti(~"M")]; let matches = &match getopts(args, opts) { result::Ok(move m) => m, - result::Err(_) => die!() + result::Err(_) => fail!() }; assert opts_present(matches, ~[~"L"]); assert opts_str(matches, ~[~"L"]) == ~"foo"; diff --git a/src/libstd/json.rs b/src/libstd/json.rs index d5ad2f7fce7..95f9130fa37 100644 --- a/src/libstd/json.rs +++ b/src/libstd/json.rs @@ -257,7 +257,7 @@ pub impl PrettyEncoder: serialize::Encoder { fn emit_managed(&self, f: fn()) { f() } fn emit_enum(&self, name: &str, f: fn()) { - if name != "option" { die!(~"only supports option enum") } + if name != "option" { fail!(~"only supports option enum") } f() } fn emit_enum_variant(&self, _name: &str, id: uint, _cnt: uint, f: fn()) { @@ -773,7 +773,7 @@ pub impl Decoder: serialize::Decoder { debug!("read_nil"); match *self.pop() { Null => (), - _ => die!(~"not a null") + _ => fail!(~"not a null") } } @@ -793,7 +793,7 @@ pub impl Decoder: serialize::Decoder { debug!("read_bool"); match *self.pop() { Boolean(b) => b, - _ => die!(~"not a boolean") + _ => fail!(~"not a boolean") } } @@ -803,13 +803,13 @@ pub impl Decoder: serialize::Decoder { debug!("read_float"); match *self.pop() { Number(f) => f, - _ => die!(~"not a number") + _ => fail!(~"not a number") } } fn read_char(&self) -> char { let v = str::chars(self.read_owned_str()); - if v.len() != 1 { die!(~"string must have one character") } + if v.len() != 1 { fail!(~"string must have one character") } v[0] } @@ -817,7 +817,7 @@ pub impl Decoder: serialize::Decoder { debug!("read_owned_str"); match *self.pop() { String(ref s) => copy *s, - _ => die!(~"not a string") + _ => fail!(~"not a string") } } @@ -825,7 +825,7 @@ pub impl Decoder: serialize::Decoder { debug!("read_managed_str"); match *self.pop() { String(ref s) => s.to_managed(), - _ => die!(~"not a string") + _ => fail!(~"not a string") } } @@ -841,7 +841,7 @@ pub impl Decoder: serialize::Decoder { fn read_enum(&self, name: &str, f: fn() -> T) -> T { debug!("read_enum(%s)", name); - if name != ~"option" { die!(~"only supports the option enum") } + if name != ~"option" { fail!(~"only supports the option enum") } f() } @@ -856,7 +856,7 @@ pub impl Decoder: serialize::Decoder { fn read_enum_variant_arg(&self, idx: uint, f: fn() -> T) -> T { debug!("read_enum_variant_arg(idx=%u)", idx); - if idx != 0 { die!(~"unknown index") } + if idx != 0 { fail!(~"unknown index") } f() } @@ -864,7 +864,7 @@ pub impl Decoder: serialize::Decoder { debug!("read_owned_vec()"); let len = match *self.peek() { List(ref list) => list.len(), - _ => die!(~"not a list"), + _ => fail!(~"not a list"), }; let res = f(len); self.pop(); @@ -875,7 +875,7 @@ pub impl Decoder: serialize::Decoder { debug!("read_owned_vec()"); let len = match *self.peek() { List(ref list) => list.len(), - _ => die!(~"not a list"), + _ => fail!(~"not a list"), }; let res = f(len); self.pop(); @@ -889,7 +889,7 @@ pub impl Decoder: serialize::Decoder { self.stack.push(&list[idx]); f() } - _ => die!(~"not a list"), + _ => fail!(~"not a list"), } } @@ -913,20 +913,20 @@ pub impl Decoder: serialize::Decoder { match *top { Object(ref obj) => { match obj.find(&name.to_owned()) { - None => die!(fmt!("no such field: %s", name)), + None => fail!(fmt!("no such field: %s", name)), Some(json) => { self.stack.push(json); f() } } } - Number(_) => die!(~"num"), - String(_) => die!(~"str"), - Boolean(_) => die!(~"bool"), - List(_) => die!(fmt!("list: %?", top)), - Null => die!(~"null"), + Number(_) => fail!(~"num"), + String(_) => fail!(~"str"), + Boolean(_) => fail!(~"bool"), + List(_) => fail!(fmt!("list: %?", top)), + Null => fail!(~"null"), - //_ => die!(fmt!("not an object: %?", *top)) + //_ => fail!(fmt!("not an object: %?", *top)) } } @@ -944,7 +944,7 @@ pub impl Decoder: serialize::Decoder { self.stack.push(&list[idx]); f() } - _ => die!(~"not a list") + _ => fail!(~"not a list") } } } diff --git a/src/libstd/list.rs b/src/libstd/list.rs index 140c2013738..5feac4ad454 100644 --- a/src/libstd/list.rs +++ b/src/libstd/list.rs @@ -93,7 +93,7 @@ pub pure fn len(ls: @List) -> uint { pub pure fn tail(ls: @List) -> @List { match *ls { Cons(_, tl) => return tl, - Nil => die!(~"list empty") + Nil => fail!(~"list empty") } } @@ -102,7 +102,7 @@ pub pure fn head(ls: @List) -> T { match *ls { Cons(copy hd, _) => hd, // makes me sad - _ => die!(~"head invoked on empty list") + _ => fail!(~"head invoked on empty list") } } diff --git a/src/libstd/net_ip.rs b/src/libstd/net_ip.rs index 511e80b0160..2f423f4c8d4 100644 --- a/src/libstd/net_ip.rs +++ b/src/libstd/net_ip.rs @@ -63,14 +63,14 @@ pub fn format_addr(ip: &IpAddr) -> ~str { Ipv4(ref addr) => unsafe { let result = uv_ip4_name(addr); if result == ~"" { - die!(~"failed to convert inner sockaddr_in address to str") + fail!(~"failed to convert inner sockaddr_in address to str") } result }, Ipv6(ref addr) => unsafe { let result = uv_ip6_name(addr); if result == ~"" { - die!(~"failed to convert inner sockaddr_in address to str") + fail!(~"failed to convert inner sockaddr_in address to str") } result } @@ -182,7 +182,7 @@ pub mod v4 { pub fn parse_addr(ip: &str) -> IpAddr { match try_parse_addr(ip) { result::Ok(move addr) => move addr, - result::Err(ref err_data) => die!(err_data.err_msg) + result::Err(ref err_data) => fail!(err_data.err_msg) } } // the simple, old style numberic representation of @@ -277,7 +277,7 @@ pub mod v6 { pub fn parse_addr(ip: &str) -> IpAddr { match try_parse_addr(ip) { result::Ok(move addr) => move addr, - result::Err(copy err_data) => die!(err_data.err_msg) + result::Err(copy err_data) => fail!(err_data.err_msg) } } pub fn try_parse_addr(ip: &str) -> result::Result { @@ -399,7 +399,7 @@ mod test { assert true; } result::Ok(ref addr) => { - die!(fmt!("Expected failure, but got addr %?", addr)); + fail!(fmt!("Expected failure, but got addr %?", addr)); } } } @@ -412,7 +412,7 @@ mod test { assert true; } result::Ok(ref addr) => { - die!(fmt!("Expected failure, but got addr %?", addr)); + fail!(fmt!("Expected failure, but got addr %?", addr)); } } } @@ -423,7 +423,7 @@ mod test { let iotask = &uv::global_loop::get(); let ga_result = get_addr(localhost_name, iotask); if result::is_err(&ga_result) { - die!(~"got err result from net::ip::get_addr();") + fail!(~"got err result from net::ip::get_addr();") } // note really sure how to realiably test/assert // this.. mostly just wanting to see it work, atm. diff --git a/src/libstd/net_tcp.rs b/src/libstd/net_tcp.rs index c90518f1692..8addea9c30b 100644 --- a/src/libstd/net_tcp.rs +++ b/src/libstd/net_tcp.rs @@ -941,7 +941,7 @@ impl TcpSocketBuf: io::Reader { } else { debug!("ERROR sock_buf as io::reader.read err %? %?", err_data.err_name, err_data.err_msg); - die!() + fail!() } } else { @@ -1645,7 +1645,7 @@ pub mod test { hl_loop); match actual_resp_result.get_err() { ConnectionRefused => (), - _ => die!(~"unknown error.. expected connection_refused") + _ => fail!(~"unknown error.. expected connection_refused") } } pub fn impl_gl_tcp_ipv4_server_address_in_use() { @@ -1686,7 +1686,7 @@ pub mod test { assert true; } _ => { - die!(~"expected address_in_use listen error,"+ + fail!(~"expected address_in_use listen error,"+ ~"but got a different error varient. check logs."); } } @@ -1705,7 +1705,7 @@ pub mod test { assert true; } _ => { - die!(~"expected address_in_use listen error,"+ + fail!(~"expected address_in_use listen error,"+ ~"but got a different error varient. check logs."); } } @@ -1885,14 +1885,14 @@ pub mod test { if result::is_err(&listen_result) { match result::get_err(&listen_result) { GenericListenErr(ref name, ref msg) => { - die!(fmt!("SERVER: exited abnormally name %s msg %s", + fail!(fmt!("SERVER: exited abnormally name %s msg %s", *name, *msg)); } AccessDenied => { - die!(~"SERVER: exited abnormally, got access denied.."); + fail!(~"SERVER: exited abnormally, got access denied.."); } AddressInUse => { - die!(~"SERVER: exited abnormally, got address in use..."); + fail!(~"SERVER: exited abnormally, got address in use..."); } } } @@ -1911,7 +1911,7 @@ pub mod test { debug!("establish_cb %?", kill_ch); }, |new_conn, kill_ch| { - die!(fmt!("SERVER: shouldn't be called.. %? %?", + fail!(fmt!("SERVER: shouldn't be called.. %? %?", new_conn, kill_ch)); }); // err check on listen_result @@ -1919,7 +1919,7 @@ pub mod test { result::get_err(&listen_result) } else { - die!(~"SERVER: did not fail as expected") + fail!(~"SERVER: did not fail as expected") } } @@ -1963,7 +1963,7 @@ pub mod test { debug!("tcp_write_single err name: %s msg: %s", err_data.err_name, err_data.err_msg); // meh. torn on what to do here. - die!(~"tcp_write_single failed"); + fail!(~"tcp_write_single failed"); } } } diff --git a/src/libstd/oldmap.rs b/src/libstd/oldmap.rs index cea6d17e35d..900b7068ce3 100644 --- a/src/libstd/oldmap.rs +++ b/src/libstd/oldmap.rs @@ -319,7 +319,7 @@ pub mod chained { pure fn get(&self, k: &K) -> V { let opt_v = self.find(k); if opt_v.is_none() { - die!(fmt!("Key not found in table: %?", k)); + fail!(fmt!("Key not found in table: %?", k)); } option::unwrap(move opt_v) } diff --git a/src/libstd/oldsmallintmap.rs b/src/libstd/oldsmallintmap.rs index 803e75e4cf7..c9e739e3c8b 100644 --- a/src/libstd/oldsmallintmap.rs +++ b/src/libstd/oldsmallintmap.rs @@ -67,7 +67,7 @@ pub pure fn get(self: SmallIntMap, key: uint) -> T { match find(self, key) { None => { error!("smallintmap::get(): key not present"); - die!(); + fail!(); } Some(move v) => return v } diff --git a/src/libstd/rope.rs b/src/libstd/rope.rs index dbfa771e0a2..8ff90b940fb 100644 --- a/src/libstd/rope.rs +++ b/src/libstd/rope.rs @@ -98,7 +98,7 @@ pub fn of_str(str: @~str) -> Rope { */ pub fn of_substr(str: @~str, byte_offset: uint, byte_len: uint) -> Rope { if byte_len == 0u { return node::Empty; } - if byte_offset + byte_len > str::len(*str) { die!(); } + if byte_offset + byte_len > str::len(*str) { fail!(); } return node::Content(node::of_substr(str, byte_offset, byte_len)); } @@ -244,9 +244,9 @@ Section: Transforming ropes pub fn sub_chars(rope: Rope, char_offset: uint, char_len: uint) -> Rope { if char_len == 0u { return node::Empty; } match (rope) { - node::Empty => die!(), + node::Empty => fail!(), node::Content(node) => if char_len > node::char_len(node) { - die!() + fail!() } else { return node::Content(node::sub_chars(node, char_offset, char_len)) } @@ -269,9 +269,9 @@ pub fn sub_chars(rope: Rope, char_offset: uint, char_len: uint) -> Rope { pub fn sub_bytes(rope: Rope, byte_offset: uint, byte_len: uint) -> Rope { if byte_len == 0u { return node::Empty; } match (rope) { - node::Empty => die!(), + node::Empty => fail!(), node::Content(node) =>if byte_len > node::byte_len(node) { - die!() + fail!() } else { return node::Content(node::sub_bytes(node, byte_offset, byte_len)) } @@ -548,7 +548,7 @@ pub pure fn byte_len(rope: Rope) -> uint { */ pub fn char_at(rope: Rope, pos: uint) -> char { match (rope) { - node::Empty => die!(), + node::Empty => fail!(), node::Content(x) => return node::char_at(x, pos) } } diff --git a/src/libstd/serialize.rs b/src/libstd/serialize.rs index 972df73d216..d4afdbf6f30 100644 --- a/src/libstd/serialize.rs +++ b/src/libstd/serialize.rs @@ -389,7 +389,7 @@ pub impl> Option: Decodable { 0 => None, 1 => Some(d.read_enum_variant_arg( 0u, || Decodable::decode(d))), - _ => die!(fmt!("Bad variant for option: %u", i)) + _ => fail!(fmt!("Bad variant for option: %u", i)) } } } diff --git a/src/libstd/sha1.rs b/src/libstd/sha1.rs index 788d1d1012d..e89f3787830 100644 --- a/src/libstd/sha1.rs +++ b/src/libstd/sha1.rs @@ -83,7 +83,7 @@ pub fn sha1() -> Sha1 { st.len_high += 1u32; if st.len_high == 0u32 { // FIXME: Need better failure mode (#2346) - die!(); + fail!(); } } if st.msg_block_idx == msg_block_len { process_msg_block(st); } diff --git a/src/libstd/sort.rs b/src/libstd/sort.rs index 9c7d31e15f3..f8acbe84180 100644 --- a/src/libstd/sort.rs +++ b/src/libstd/sort.rs @@ -546,7 +546,7 @@ impl MergeState { copy_vec(array, dest, array, c2, len2); array[dest+len2] <-> tmp[c1]; } else if len1 == 0 { - die!(~"Comparison violates its contract!"); + fail!(~"Comparison violates its contract!"); } else { assert len2 == 0; assert len1 > 1; @@ -664,7 +664,7 @@ impl MergeState { copy_vec(array, dest+1, array, c1+1, len1); array[dest] <-> tmp[c2]; } else if len2 == 0 { - die!(~"Comparison violates its contract!"); + fail!(~"Comparison violates its contract!"); } else { assert len1 == 0; assert len2 != 0; @@ -912,7 +912,7 @@ mod test_tim_sort { pure fn lt(&self, other: &CVal) -> bool { unsafe { let rng = rand::Rng(); - if rng.gen_float() > 0.995 { die!(~"It's happening!!!"); } + if rng.gen_float() > 0.995 { fail!(~"It's happening!!!"); } } (*self).val < other.val } @@ -968,7 +968,7 @@ mod test_tim_sort { }; tim_sort(arr); - die!(~"Guarantee the fail"); + fail!(~"Guarantee the fail"); } struct DVal { val: uint } @@ -1036,7 +1036,7 @@ mod big_tests { fn isSorted(arr: &[const T]) { for uint::range(0, arr.len()-1) |i| { if arr[i] > arr[i+1] { - die!(~"Array not sorted"); + fail!(~"Array not sorted"); } } } @@ -1108,7 +1108,7 @@ mod big_tests { fn isSorted(arr: &[const @T]) { for uint::range(0, arr.len()-1) |i| { if arr[i] > arr[i+1] { - die!(~"Array not sorted"); + fail!(~"Array not sorted"); } } } @@ -1191,7 +1191,7 @@ mod big_tests { task::local_data::local_data_set(self.key, @(y+1)); } } - _ => die!(~"Expected key to work"), + _ => fail!(~"Expected key to work"), } } } diff --git a/src/libstd/sync.rs b/src/libstd/sync.rs index b7e75897bf1..8a5741201c0 100644 --- a/src/libstd/sync.rs +++ b/src/libstd/sync.rs @@ -333,10 +333,10 @@ fn check_cvar_bounds(out_of_bounds: Option, id: uint, act: &str, blk: fn() -> U) -> U { match out_of_bounds { Some(0) => - die!(fmt!("%s with illegal ID %u - this lock has no condvars!", + fail!(fmt!("%s with illegal ID %u - this lock has no condvars!", act, id)), Some(length) => - die!(fmt!("%s with illegal ID %u - ID must be less than %u", + fail!(fmt!("%s with illegal ID %u - ID must be less than %u", act, id, length)), None => blk() } @@ -580,7 +580,7 @@ impl &RWlock { /// To be called inside of the write_downgrade block. fn downgrade(token: RWlockWriteMode/&a) -> RWlockReadMode/&a { if !ptr::ref_eq(self, token.lock) { - die!(~"Can't downgrade() with a different rwlock's write_mode!"); + fail!(~"Can't downgrade() with a different rwlock's write_mode!"); } unsafe { do task::unkillable { @@ -933,7 +933,7 @@ mod tests { let result: result::Result<(),()> = do task::try |move m2| { do m2.lock { - die!(); + fail!(); } }; assert result.is_err(); @@ -952,7 +952,7 @@ mod tests { do task::spawn |move p| { // linked let _ = p.recv(); // wait for sibling to get in the mutex task::yield(); - die!(); + fail!(); } do m2.lock_cond |cond| { c.send(()); // tell sibling go ahead @@ -994,7 +994,7 @@ mod tests { } do m2.lock { } c.send(move sibling_convos); // let parent wait on all children - die!(); + fail!(); }; assert result.is_err(); // child task must have finished by the time try returns @@ -1048,7 +1048,7 @@ mod tests { let _ = p.recv(); do m.lock_cond |cond| { if !cond.signal_on(0) { - die!(); // success; punt sibling awake. + fail!(); // success; punt sibling awake. } } }; @@ -1288,7 +1288,7 @@ mod tests { let result: result::Result<(),()> = do task::try |move x2| { do lock_rwlock_in_mode(x2, mode1) { - die!(); + fail!(); } }; assert result.is_err(); diff --git a/src/libstd/test.rs b/src/libstd/test.rs index f3e96826a8e..530761e48a2 100644 --- a/src/libstd/test.rs +++ b/src/libstd/test.rs @@ -121,9 +121,9 @@ pub fn test_main(args: &[~str], tests: ~[TestDescAndFn]) { let opts = match parse_opts(args) { either::Left(move o) => o, - either::Right(move m) => die!(m) + either::Right(move m) => fail!(m) }; - if !run_tests_console(&opts, tests) { die!(~"Some tests failed"); } + if !run_tests_console(&opts, tests) { fail!(~"Some tests failed"); } } // A variant optimized for invocation with a static test vector. @@ -284,7 +284,7 @@ pub fn run_tests_console(opts: &TestOpts, io::Truncate]) { result::Ok(w) => Some(w), result::Err(ref s) => { - die!(fmt!("can't open output file: %s", *s)) + fail!(fmt!("can't open output file: %s", *s)) } }, None => None @@ -800,7 +800,7 @@ mod tests { #[test] pub fn do_not_run_ignored_tests() { - fn f() { die!(); } + fn f() { fail!(); } let desc = TestDescAndFn { desc: TestDesc { name: StaticTestName("whatever"), @@ -837,7 +837,7 @@ mod tests { #[test] #[ignore(cfg(windows))] pub fn test_should_fail() { - fn f() { die!(); } + fn f() { fail!(); } let desc = TestDescAndFn { desc: TestDesc { name: StaticTestName("whatever"), @@ -876,7 +876,7 @@ mod tests { let args = ~[~"progname", ~"filter"]; let opts = match parse_opts(args) { either::Left(copy o) => o, - _ => die!(~"Malformed arg in first_free_arg_should_be_a_filter") + _ => fail!(~"Malformed arg in first_free_arg_should_be_a_filter") }; assert ~"filter" == opts.filter.get(); } @@ -886,7 +886,7 @@ mod tests { let args = ~[~"progname", ~"filter", ~"--ignored"]; let opts = match parse_opts(args) { either::Left(copy o) => o, - _ => die!(~"Malformed arg in parse_ignored_flag") + _ => fail!(~"Malformed arg in parse_ignored_flag") }; assert (opts.run_ignored); } diff --git a/src/libstd/time.rs b/src/libstd/time.rs index f696d239d30..622e1ea65d8 100644 --- a/src/libstd/time.rs +++ b/src/libstd/time.rs @@ -1040,7 +1040,7 @@ mod tests { == Err(~"Invalid time"); match strptime(~"Fri Feb 13 15:31:30 2009", format) { - Err(copy e) => die!(e), + Err(copy e) => fail!(e), Ok(ref tm) => { assert tm.tm_sec == 30_i32; assert tm.tm_min == 31_i32; @@ -1060,7 +1060,7 @@ mod tests { fn test(s: &str, format: &str) -> bool { match strptime(s, format) { Ok(ref tm) => tm.strftime(format) == str::from_slice(s), - Err(copy e) => die!(e) + Err(copy e) => fail!(e) } } diff --git a/src/libstd/timer.rs b/src/libstd/timer.rs index 1da1bc60314..6e1e6a331a2 100644 --- a/src/libstd/timer.rs +++ b/src/libstd/timer.rs @@ -67,12 +67,12 @@ pub fn delayed_send(iotask: &IoTask, } else { let error_msg = uv::ll::get_last_err_info( loop_ptr); - die!(~"timer::delayed_send() start failed: " + + fail!(~"timer::delayed_send() start failed: " + error_msg); } } else { let error_msg = uv::ll::get_last_err_info(loop_ptr); - die!(~"timer::delayed_send() init failed: " + + fail!(~"timer::delayed_send() init failed: " + error_msg); } } @@ -157,7 +157,7 @@ extern fn delayed_send_cb(handle: *uv::ll::uv_timer_t, } else { let loop_ptr = uv::ll::get_loop_for_uv_handle(handle); let error_msg = uv::ll::get_last_err_info(loop_ptr); - die!(~"timer::sleep() init failed: "+error_msg); + fail!(~"timer::sleep() init failed: "+error_msg); } } } diff --git a/src/libstd/uv_global_loop.rs b/src/libstd/uv_global_loop.rs index 9763f655a6f..6621eef8b0b 100644 --- a/src/libstd/uv_global_loop.rs +++ b/src/libstd/uv_global_loop.rs @@ -184,11 +184,11 @@ mod test { simple_timer_cb, 1u, 0u); if(start_status != 0i32) { - die!(~"failure on ll::timer_start()"); + fail!(~"failure on ll::timer_start()"); } } else { - die!(~"failure on ll::timer_init()"); + fail!(~"failure on ll::timer_init()"); } } }; diff --git a/src/libstd/workcache.rs b/src/libstd/workcache.rs index 69116ace9e8..d78761b70e3 100644 --- a/src/libstd/workcache.rs +++ b/src/libstd/workcache.rs @@ -382,7 +382,7 @@ fn unwrap s; match move s { - None => die!(), + None => fail!(), Some(Left(move v)) => move v, Some(Right(move port)) => { diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index b109333c3b5..949e9ff447c 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -37,7 +37,7 @@ pub impl ident: Encodable { let intr = match unsafe { task::local_data::local_data_get(interner_key!()) } { - None => die!(~"encode: TLS interner not set up"), + None => fail!(~"encode: TLS interner not set up"), Some(intr) => intr }; @@ -50,7 +50,7 @@ pub impl ident: Decodable { let intr = match unsafe { task::local_data::local_data_get(interner_key!()) } { - None => die!(~"decode: TLS interner not set up"), + None => fail!(~"decode: TLS interner not set up"), Some(intr) => intr }; diff --git a/src/libsyntax/ast_map.rs b/src/libsyntax/ast_map.rs index 8be4b219ded..9eeee943f8b 100644 --- a/src/libsyntax/ast_map.rs +++ b/src/libsyntax/ast_map.rs @@ -320,7 +320,7 @@ pub fn map_struct_def(struct_def: @ast::struct_def, parent_node: ast_node, cx.map.insert(ctor_id, node_struct_ctor(struct_def, item, p)); } - _ => die!(~"struct def parent wasn't an item") + _ => fail!(~"struct def parent wasn't an item") } } } @@ -404,7 +404,7 @@ pub fn node_item_query(items: map, id: node_id, error_msg: ~str) -> Result { match items.find(&id) { Some(node_item(it, _)) => query(it), - _ => die!(error_msg) + _ => fail!(error_msg) } } diff --git a/src/libsyntax/ast_util.rs b/src/libsyntax/ast_util.rs index c659d6d6020..335dd4e3fa2 100644 --- a/src/libsyntax/ast_util.rs +++ b/src/libsyntax/ast_util.rs @@ -44,7 +44,7 @@ pub pure fn stmt_id(s: stmt) -> node_id { stmt_decl(_, id) => id, stmt_expr(_, id) => id, stmt_semi(_, id) => id, - stmt_mac(*) => die!(~"attempted to analyze unexpanded stmt") + stmt_mac(*) => fail!(~"attempted to analyze unexpanded stmt") } } @@ -53,7 +53,7 @@ pub fn variant_def_ids(d: def) -> {enm: def_id, var: def_id} { def_variant(enum_id, var_id) => { return {enm: enum_id, var: var_id} } - _ => die!(~"non-variant in variant_def_ids") + _ => fail!(~"non-variant in variant_def_ids") } } @@ -71,7 +71,7 @@ pub pure fn def_id_of_def(d: def) -> def_id { local_def(id) } - def_prim_ty(_) => die!() + def_prim_ty(_) => fail!() } } diff --git a/src/libsyntax/attr.rs b/src/libsyntax/attr.rs index d258393e3b9..22f1e2d4753 100644 --- a/src/libsyntax/attr.rs +++ b/src/libsyntax/attr.rs @@ -198,7 +198,7 @@ fn eq(a: @ast::meta_item, b: @ast::meta_item) -> bool { // FIXME (#607): Needs implementing // This involves probably sorting the list by name and // meta_item variant - die!(~"unimplemented meta_item variant") + fail!(~"unimplemented meta_item variant") } } } diff --git a/src/libsyntax/codemap.rs b/src/libsyntax/codemap.rs index a509325face..b41e84a04f8 100644 --- a/src/libsyntax/codemap.rs +++ b/src/libsyntax/codemap.rs @@ -401,7 +401,7 @@ pub impl CodeMap { for self.files.each |fm| { if fm.name == filename { return *fm; } } //XXjdm the following triggers a mismatched type bug // (or expected function, found _|_) - die!(); // ("asking for " + filename + " which we don't know about"); + fail!(); // ("asking for " + filename + " which we don't know about"); } } @@ -421,7 +421,7 @@ priv impl CodeMap { } } if (a >= len) { - die!(fmt!("position %u does not resolve to a source location", + fail!(fmt!("position %u does not resolve to a source location", pos.to_uint())) } diff --git a/src/libsyntax/diagnostic.rs b/src/libsyntax/diagnostic.rs index 51ef085839d..e44ee4eef0a 100644 --- a/src/libsyntax/diagnostic.rs +++ b/src/libsyntax/diagnostic.rs @@ -66,7 +66,7 @@ struct CodemapT { impl CodemapT: span_handler { fn span_fatal(@mut self, sp: span, msg: &str) -> ! { self.handler.emit(Some((self.cm, sp)), msg, fatal); - die!(); + fail!(); } fn span_err(@mut self, sp: span, msg: &str) { self.handler.emit(Some((self.cm, sp)), msg, error); @@ -92,7 +92,7 @@ impl CodemapT: span_handler { impl HandlerT: handler { fn fatal(@mut self, msg: &str) -> ! { (self.emit)(None, msg, fatal); - die!(); + fail!(); } fn err(@mut self, msg: &str) { (self.emit)(None, msg, error); diff --git a/src/libsyntax/ext/auto_encode.rs b/src/libsyntax/ext/auto_encode.rs index acbe4d7fa23..c854fca6424 100644 --- a/src/libsyntax/ext/auto_encode.rs +++ b/src/libsyntax/ext/auto_encode.rs @@ -812,7 +812,7 @@ fn mk_struct_fields(fields: ~[@ast::struct_field]) -> ~[field] { do fields.map |field| { let (ident, mutbl) = match field.node.kind { ast::named_field(ident, mutbl, _) => (ident, mutbl), - _ => die!(~"[auto_encode] does not support \ + _ => fail!(~"[auto_encode] does not support \ unnamed fields") }; @@ -954,9 +954,9 @@ fn mk_enum_ser_body( ast::tuple_variant_kind(args) => ser_variant(cx, span, variant.node.name, v_idx, args), ast::struct_variant_kind(*) => - die!(~"struct variants unimplemented"), + fail!(~"struct variants unimplemented"), ast::enum_variant_kind(*) => - die!(~"enum variants unimplemented"), + fail!(~"enum variants unimplemented"), } }; @@ -1047,9 +1047,9 @@ fn mk_enum_deser_body( } }, ast::struct_variant_kind(*) => - die!(~"struct variants unimplemented"), + fail!(~"struct variants unimplemented"), ast::enum_variant_kind(*) => - die!(~"enum variants unimplemented") + fail!(~"enum variants unimplemented") }; let pat = @ast::pat { diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs index 18256369c78..17197f64c55 100644 --- a/src/libsyntax/ext/expand.rs +++ b/src/libsyntax/ext/expand.rs @@ -292,7 +292,7 @@ pub fn core_macros() -> ~str { ::core::sys::begin_unwind($msg, file!().to_owned(), line!()) ); () => ( - die!(~\"explicit failure\") + fail!(~\"explicit failure\") ) ) @@ -301,14 +301,14 @@ pub fn core_macros() -> ~str { ::core::sys::begin_unwind($msg, file!().to_owned(), line!()) ); () => ( - die!(~\"explicit failure\") + fail!(~\"explicit failure\") ) ) macro_rules! fail_unless( ($cond:expr) => { if !$cond { - die!(~\"assertion failed: \" + stringify!($cond)) + fail!(~\"assertion failed: \" + stringify!($cond)) } } ) diff --git a/src/libsyntax/ext/pipes/parse_proto.rs b/src/libsyntax/ext/pipes/parse_proto.rs index 1502332859c..6a1708b8e2b 100644 --- a/src/libsyntax/ext/pipes/parse_proto.rs +++ b/src/libsyntax/ext/pipes/parse_proto.rs @@ -40,13 +40,13 @@ pub impl parser::Parser: proto_parser { self.expect(token::COLON); let dir = match copy self.token { token::IDENT(n, _) => self.interner.get(n), - _ => die!() + _ => fail!() }; self.bump(); let dir = match dir { @~"send" => send, @~"recv" => recv, - _ => die!() + _ => fail!() }; let typarms = if self.token == token::LT { diff --git a/src/libsyntax/ext/quote.rs b/src/libsyntax/ext/quote.rs index 4a9a22de50f..4522c7e0fd6 100644 --- a/src/libsyntax/ext/quote.rs +++ b/src/libsyntax/ext/quote.rs @@ -184,7 +184,7 @@ pub mod rt { Some(ast) => ast, None => { error!("Parse error with ```\n%s\n```", s); - die!() + fail!() } } } @@ -399,7 +399,7 @@ fn mk_token(cx: ext_ctxt, sp: span, tok: token::Token) -> @ast::expr { ~[mk_ident(cx, sp, ident)]); } - INTERPOLATED(_) => die!(~"quote! with interpolated token"), + INTERPOLATED(_) => fail!(~"quote! with interpolated token"), _ => () } @@ -437,7 +437,7 @@ fn mk_token(cx: ext_ctxt, sp: span, tok: token::Token) -> @ast::expr { DOLLAR => "DOLLAR", UNDERSCORE => "UNDERSCORE", EOF => "EOF", - _ => die!() + _ => fail!() }; build::mk_path(cx, sp, ids_ext(cx, ~[name.to_owned()])) @@ -467,7 +467,7 @@ fn mk_tt(cx: ext_ctxt, sp: span, tt: &ast::token_tree) } ast::tt_delim(ref tts) => mk_tts(cx, sp, *tts), - ast::tt_seq(*) => die!(~"tt_seq in quote!"), + ast::tt_seq(*) => fail!(~"tt_seq in quote!"), ast::tt_nonterminal(sp, ident) => { diff --git a/src/libsyntax/ext/tt/macro_parser.rs b/src/libsyntax/ext/tt/macro_parser.rs index 4b1194bb5f1..9e89e703c09 100644 --- a/src/libsyntax/ext/tt/macro_parser.rs +++ b/src/libsyntax/ext/tt/macro_parser.rs @@ -124,7 +124,7 @@ pub type matcher_pos = ~{ pub fn copy_up(&& mpu: matcher_pos_up) -> matcher_pos { match &mpu { &matcher_pos_up(Some(ref mp)) => copy (*mp), - _ => die!() + _ => fail!() } } @@ -361,7 +361,7 @@ pub fn parse(sess: parse_sess, fmt!("%s ('%s')", *sess.interner.get(name), *sess.interner.get(bind)) } - _ => die!() + _ => fail!() } }), ~" or "); return error(sp, fmt!( "Local ambiguity: multiple parsing options: \ @@ -386,7 +386,7 @@ pub fn parse(sess: parse_sess, parse_nt(rust_parser, *sess.interner.get(name)))); ei.idx += 1u; } - _ => die!() + _ => fail!() } cur_eis.push(move ei); diff --git a/src/libsyntax/parse/comments.rs b/src/libsyntax/parse/comments.rs index a8db06fe085..1e17cf3543d 100644 --- a/src/libsyntax/parse/comments.rs +++ b/src/libsyntax/parse/comments.rs @@ -117,7 +117,7 @@ pub fn strip_doc_comment_decoration(comment: ~str) -> ~str { return str::connect(lines, ~"\n"); } - die!(~"not a doc-comment: " + comment); + fail!(~"not a doc-comment: " + comment); } fn read_to_eol(rdr: @mut StringReader) -> ~str { @@ -297,7 +297,7 @@ fn consume_comment(rdr: @mut StringReader, read_block_comment(rdr, code_to_the_left, comments); } else if rdr.curr == '#' && nextch(rdr) == '!' { read_shebang_comment(rdr, code_to_the_left, comments); - } else { die!(); } + } else { fail!(); } debug!("<<< consume comment"); } diff --git a/src/libsyntax/parse/lexer.rs b/src/libsyntax/parse/lexer.rs index e8afd0b96a2..48ba94bdc33 100644 --- a/src/libsyntax/parse/lexer.rs +++ b/src/libsyntax/parse/lexer.rs @@ -215,7 +215,7 @@ fn hex_digit_val(c: char) -> int { if in_range(c, '0', '9') { return (c as int) - ('0' as int); } if in_range(c, 'a', 'f') { return (c as int) - ('a' as int) + 10; } if in_range(c, 'A', 'F') { return (c as int) - ('A' as int) + 10; } - die!(); + fail!(); } fn bin_digit_value(c: char) -> int { if c == '0' { return 0; } return 1; } diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 6382413b081..1fcd99e1946 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -2538,7 +2538,7 @@ pub impl Parser { _ => None } } - _ => die!() + _ => fail!() }; match maybe_bound { @@ -3907,7 +3907,7 @@ pub impl Parser { let metadata = self.parse_optional_meta(); view_item_use(ident, metadata, self.get_id()) } else { - die!(); + fail!(); }; self.expect(token::SEMI); @ast::view_item { node: node, diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs index b8d756d893a..dbcb3d756c8 100644 --- a/src/libsyntax/parse/token.rs +++ b/src/libsyntax/parse/token.rs @@ -210,7 +210,7 @@ pub fn to_str(in: @ident_interner, t: Token) -> ~str { nt_block(*) => ~"block", nt_stmt(*) => ~"statement", nt_pat(*) => ~"pattern", - nt_expr(*) => die!(~"should have been handled above"), + nt_expr(*) => fail!(~"should have been handled above"), nt_ty(*) => ~"type", nt_ident(*) => ~"identifier", nt_path(*) => ~"path", @@ -263,7 +263,7 @@ pub fn flip_delimiter(t: token::Token) -> token::Token { token::RPAREN => token::LPAREN, token::RBRACE => token::LBRACE, token::RBRACKET => token::LBRACKET, - _ => die!() + _ => fail!() } } diff --git a/src/libsyntax/print/pp.rs b/src/libsyntax/print/pp.rs index 4b9767ca6c8..aeebcce1f2b 100644 --- a/src/libsyntax/print/pp.rs +++ b/src/libsyntax/print/pp.rs @@ -519,7 +519,7 @@ pub impl Printer { } EOF => { // EOF should never get here. - die!(); + fail!(); } } } diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index 7a60696c0a2..b05461aa8d9 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -440,10 +440,10 @@ pub fn print_type_ex(s: @ps, &&ty: @ast::Ty, print_colons: bool) { word(s.s, ~"]"); } ast::ty_mac(_) => { - die!(~"print_type doesn't know how to print a ty_mac"); + fail!(~"print_type doesn't know how to print a ty_mac"); } ast::ty_infer => { - die!(~"print_type shouldn't see a ty_infer"); + fail!(~"print_type shouldn't see a ty_infer"); } } @@ -637,7 +637,7 @@ pub fn print_enum_def(s: @ps, enum_definition: ast::enum_def, word_space(s, ~"="); match enum_definition.variants[0].node.kind { ast::tuple_variant_kind(args) => print_type(s, args[0].ty), - _ => die!(~"newtype syntax with struct?") + _ => fail!(~"newtype syntax with struct?") } word(s.s, ~";"); end(s); @@ -706,7 +706,7 @@ pub fn print_struct(s: @ps, } match field.node.kind { - ast::named_field(*) => die!(~"unexpected named field"), + ast::named_field(*) => fail!(~"unexpected named field"), ast::unnamed_field => { maybe_print_comment(s, field.span.lo); print_type(s, field.node.ty); @@ -729,7 +729,7 @@ pub fn print_struct(s: @ps, for struct_def.fields.each |field| { match field.node.kind { - ast::unnamed_field => die!(~"unexpected unnamed field"), + ast::unnamed_field => fail!(~"unexpected unnamed field"), ast::named_field(ident, mutability, visibility) => { hardbreak_if_not_bol(s); maybe_print_comment(s, field.span.lo); @@ -1015,7 +1015,7 @@ pub fn print_if(s: @ps, test: @ast::expr, blk: ast::blk, } // BLEAH, constraints would be great here _ => { - die!(~"print_if saw if with weird alternative"); + fail!(~"print_if saw if with weird alternative"); } } } @@ -1316,7 +1316,7 @@ pub fn print_expr(s: @ps, &&expr: @ast::expr) { } end(s); // close enclosing cbox } - None => die!() + None => fail!() } } else { // the block will close the pattern's ibox @@ -2257,7 +2257,7 @@ pub mod test { fn string_check (given : &T, expected: &T) { if !(given == expected) { - die!(fmt!("given %?, expected %?",given,expected)); + fail!(fmt!("given %?, expected %?",given,expected)); } } diff --git a/src/libsyntax/util/testing.rs b/src/libsyntax/util/testing.rs index 39d3b003e66..b6d333349a0 100644 --- a/src/libsyntax/util/testing.rs +++ b/src/libsyntax/util/testing.rs @@ -13,12 +13,12 @@ use core::cmp; pub pure fn check_equal_ptr (given : &T, expected: &T) { if !((given == expected) && (expected == given )) { - die!(fmt!("given %?, expected %?",given,expected)); + fail!(fmt!("given %?, expected %?",given,expected)); } } pub pure fn check_equal (given : T, expected: T) { if !((given == expected) && (expected == given )) { - die!(fmt!("given %?, expected %?",given,expected)); + fail!(fmt!("given %?, expected %?",given,expected)); } } diff --git a/src/test/auxiliary/cci_nested_lib.rs b/src/test/auxiliary/cci_nested_lib.rs index e9f799d1f75..8f1c3d5bb5f 100644 --- a/src/test/auxiliary/cci_nested_lib.rs +++ b/src/test/auxiliary/cci_nested_lib.rs @@ -25,7 +25,7 @@ pub fn alist_get(lst: alist, k: A) -> B { for lst.data.each |entry| { if eq_fn(entry.key, k) { return entry.value; } } - die!(); + fail!(); } #[inline] diff --git a/src/test/auxiliary/issue2378a.rs b/src/test/auxiliary/issue2378a.rs index a27d7a771c5..6007b1f3d17 100644 --- a/src/test/auxiliary/issue2378a.rs +++ b/src/test/auxiliary/issue2378a.rs @@ -14,7 +14,7 @@ impl methods for maybe { fn ~[](idx: uint) -> T { match self { just(t) { t } - nothing { die!(); } + nothing { fail!(); } } } } diff --git a/src/test/auxiliary/issue_2723_a.rs b/src/test/auxiliary/issue_2723_a.rs index ef74b61f93a..b3fa8e73cc2 100644 --- a/src/test/auxiliary/issue_2723_a.rs +++ b/src/test/auxiliary/issue_2723_a.rs @@ -9,5 +9,5 @@ // except according to those terms. pub unsafe fn f(xs: ~[int]) { - xs.map(|_x| { unsafe fn q() { die!(); } }); + xs.map(|_x| { unsafe fn q() { fail!(); } }); } diff --git a/src/test/auxiliary/static-methods-crate.rs b/src/test/auxiliary/static-methods-crate.rs index cda4f32ab5c..37be325f15b 100644 --- a/src/test/auxiliary/static-methods-crate.rs +++ b/src/test/auxiliary/static-methods-crate.rs @@ -36,6 +36,6 @@ impl bool: read { pub fn read(s: ~str) -> T { match read::readMaybe(s) { Some(x) => x, - _ => die!(~"read failed!") + _ => fail!(~"read failed!") } } diff --git a/src/test/bench/graph500-bfs.rs b/src/test/bench/graph500-bfs.rs index 222307bd240..e88cb62db73 100644 --- a/src/test/bench/graph500-bfs.rs +++ b/src/test/bench/graph500-bfs.rs @@ -213,7 +213,7 @@ fn bfs2(graph: graph, key: node_id) -> bfs_result { match *c { white => { -1i64 } black(parent) => { parent } - _ => { die!(~"Found remaining gray nodes in BFS") } + _ => { fail!(~"Found remaining gray nodes in BFS") } } } } @@ -300,7 +300,7 @@ fn pbfs(&&graph: arc::ARC, key: node_id) -> bfs_result { match *c { white => { -1i64 } black(parent) => { parent } - _ => { die!(~"Found remaining gray nodes in BFS") } + _ => { fail!(~"Found remaining gray nodes in BFS") } } } } diff --git a/src/test/bench/pingpong.rs b/src/test/bench/pingpong.rs index 4a6eaad9e14..3d367c54683 100644 --- a/src/test/bench/pingpong.rs +++ b/src/test/bench/pingpong.rs @@ -56,7 +56,7 @@ macro_rules! follow ( $(Some($message($($x,)* move next)) => { let $next = move next; move $e })+ - _ => { die!() } + _ => { fail!() } } ); @@ -67,7 +67,7 @@ macro_rules! follow ( $(Some($message(move next)) => { let $next = move next; move $e })+ - _ => { die!() } + _ => { fail!() } } ) ) diff --git a/src/test/bench/shootout-chameneos-redux.rs b/src/test/bench/shootout-chameneos-redux.rs index 6de8d13529a..27111ff3b6d 100644 --- a/src/test/bench/shootout-chameneos-redux.rs +++ b/src/test/bench/shootout-chameneos-redux.rs @@ -63,7 +63,7 @@ fn show_digit(nn: uint) -> ~str { 7 => {~"seven"} 8 => {~"eight"} 9 => {~"nine"} - _ => {die!(~"expected digits from 0 to 9...")} + _ => {fail!(~"expected digits from 0 to 9...")} } } diff --git a/src/test/bench/shootout-pfib.rs b/src/test/bench/shootout-pfib.rs index 06b46eab759..ac695421059 100644 --- a/src/test/bench/shootout-pfib.rs +++ b/src/test/bench/shootout-pfib.rs @@ -68,7 +68,7 @@ fn parse_opts(argv: ~[~str]) -> Config { Ok(ref m) => { return Config {stress: getopts::opt_present(m, ~"stress")} } - Err(_) => { die!(); } + Err(_) => { fail!(); } } } diff --git a/src/test/bench/sudoku.rs b/src/test/bench/sudoku.rs index 750874e80c3..885eaf01c44 100644 --- a/src/test/bench/sudoku.rs +++ b/src/test/bench/sudoku.rs @@ -118,7 +118,7 @@ pub fn solve_grid(g: grid_t) { ptr = ptr + 1u; } else { // no: redo this field aft recoloring pred; unless there is none - if ptr == 0u { die!(~"No solution found for this sudoku"); } + if ptr == 0u { fail!(~"No solution found for this sudoku"); } ptr = ptr - 1u; } } diff --git a/src/test/bench/task-perf-alloc-unwind.rs b/src/test/bench/task-perf-alloc-unwind.rs index 8e5ab45bae8..c67305bab8f 100644 --- a/src/test/bench/task-perf-alloc-unwind.rs +++ b/src/test/bench/task-perf-alloc-unwind.rs @@ -69,7 +69,7 @@ fn r(l: @nillist) -> r { fn recurse_or_fail(depth: int, st: Option) { if depth == 0 { debug!("unwinding %.4f", precise_time_s()); - die!(); + fail!(); } else { let depth = depth - 1; diff --git a/src/test/bench/task-perf-jargon-metal-smoke.rs b/src/test/bench/task-perf-jargon-metal-smoke.rs index 415df0e9fa8..06f4213ee7b 100644 --- a/src/test/bench/task-perf-jargon-metal-smoke.rs +++ b/src/test/bench/task-perf-jargon-metal-smoke.rs @@ -46,6 +46,6 @@ fn main() { let (p,c) = pipes::stream(); child_generation(uint::from_str(args[1]).get(), move c); if p.try_recv().is_none() { - die!(~"it happened when we slumbered"); + fail!(~"it happened when we slumbered"); } } diff --git a/src/test/bench/task-perf-linked-failure.rs b/src/test/bench/task-perf-linked-failure.rs index 3b1a20136b6..4a6195b1ae8 100644 --- a/src/test/bench/task-perf-linked-failure.rs +++ b/src/test/bench/task-perf-linked-failure.rs @@ -77,7 +77,7 @@ fn main() { } // Grandparent group waits for middle group to be gone, then fails error!("Grandparent group wakes up and fails"); - die!(); + fail!(); }; assert x.is_err(); } diff --git a/src/test/compile-fail/alt-join.rs b/src/test/compile-fail/alt-join.rs index 1cce1dee2f7..a94709c5774 100644 --- a/src/test/compile-fail/alt-join.rs +++ b/src/test/compile-fail/alt-join.rs @@ -11,7 +11,7 @@ // a good test that we merge paths correctly in the presence of a // variable that's used before it's declared -fn my_fail() -> ! { die!(); } +fn my_fail() -> ! { fail!(); } fn main() { match true { false => { my_fail(); } true => { } } diff --git a/src/test/compile-fail/bad-bang-ann.rs b/src/test/compile-fail/bad-bang-ann.rs index d044d9bdc96..2ffb5dd2906 100644 --- a/src/test/compile-fail/bad-bang-ann.rs +++ b/src/test/compile-fail/bad-bang-ann.rs @@ -12,7 +12,7 @@ // Tests that a function with a ! annotation always actually fails fn bad_bang(i: uint) -> ! { - if i < 0u { } else { die!(); } + if i < 0u { } else { fail!(); } //~^ ERROR expected `!` but found `()` } diff --git a/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-1.rs b/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-1.rs index fea31ef1738..1bffb0739e9 100644 --- a/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-1.rs +++ b/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-1.rs @@ -20,6 +20,6 @@ fn main() { let x = Some(X { x: () }); match move x { Some(ref _y @ move _z) => { }, //~ ERROR cannot bind by-move and by-ref in the same pattern - None => die!() + None => fail!() } } diff --git a/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-2.rs b/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-2.rs index b58fe788846..cbf48559909 100644 --- a/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-2.rs +++ b/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-2.rs @@ -20,6 +20,6 @@ fn main() { let x = Some((X { x: () }, X { x: () })); match move x { Some((ref _y, move _z)) => { }, //~ ERROR cannot bind by-move and by-ref in the same pattern - None => die!() + None => fail!() } } diff --git a/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-3.rs b/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-3.rs index 8f9682e662c..9c14a53eba1 100644 --- a/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-3.rs +++ b/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-3.rs @@ -22,6 +22,6 @@ fn main() { let x = some2(X { x: () }, X { x: () }); match move x { some2(ref _y, move _z) => { }, //~ ERROR cannot bind by-move and by-ref in the same pattern - none2 => die!() + none2 => fail!() } } diff --git a/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-4.rs b/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-4.rs index 6c14dd4d141..1d492fdd0f1 100644 --- a/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-4.rs +++ b/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-4.rs @@ -20,6 +20,6 @@ fn main() { let x = Some((X { x: () }, X { x: () })); match move x { Some((move _y, ref _z)) => { }, //~ ERROR cannot bind by-move and by-ref in the same pattern - None => die!() + None => fail!() } } diff --git a/src/test/compile-fail/bind-by-move-no-guards.rs b/src/test/compile-fail/bind-by-move-no-guards.rs index 45b5a896f6b..82f4d57911b 100644 --- a/src/test/compile-fail/bind-by-move-no-guards.rs +++ b/src/test/compile-fail/bind-by-move-no-guards.rs @@ -13,8 +13,8 @@ fn main() { let x = Some(p); c.send(false); match move x { - Some(move z) if z.recv() => { die!() }, //~ ERROR cannot bind by-move into a pattern guard + Some(move z) if z.recv() => { fail!() }, //~ ERROR cannot bind by-move into a pattern guard Some(move z) => { assert !z.recv(); }, - None => die!() + None => fail!() } } diff --git a/src/test/compile-fail/bind-by-move-no-lvalues-1.rs b/src/test/compile-fail/bind-by-move-no-lvalues-1.rs index c8b8ebecce8..e4e8cba4e9c 100644 --- a/src/test/compile-fail/bind-by-move-no-lvalues-1.rs +++ b/src/test/compile-fail/bind-by-move-no-lvalues-1.rs @@ -22,6 +22,6 @@ fn main() { let x = Some(X { x: () }); match x { Some(move _z) => { }, //~ ERROR cannot bind by-move when matching an lvalue - None => die!() + None => fail!() } } diff --git a/src/test/compile-fail/bind-by-move-no-lvalues-2.rs b/src/test/compile-fail/bind-by-move-no-lvalues-2.rs index 889ccb3fd99..45f9415db9b 100644 --- a/src/test/compile-fail/bind-by-move-no-lvalues-2.rs +++ b/src/test/compile-fail/bind-by-move-no-lvalues-2.rs @@ -24,6 +24,6 @@ fn main() { let x = Y { y: Some(X { x: () }) }; match x.y { Some(move _z) => { }, //~ ERROR cannot bind by-move when matching an lvalue - None => die!() + None => fail!() } } diff --git a/src/test/compile-fail/bind-by-move-no-sub-bindings.rs b/src/test/compile-fail/bind-by-move-no-sub-bindings.rs index 40196fe0817..0d845983c6e 100644 --- a/src/test/compile-fail/bind-by-move-no-sub-bindings.rs +++ b/src/test/compile-fail/bind-by-move-no-sub-bindings.rs @@ -20,6 +20,6 @@ fn main() { let x = Some(X { x: () }); match move x { Some(move _y @ ref _z) => { }, //~ ERROR cannot bind by-move with sub-bindings - None => die!() + None => fail!() } } diff --git a/src/test/compile-fail/borrowck-autoref-3261.rs b/src/test/compile-fail/borrowck-autoref-3261.rs index 6ce631c68a3..b3ef5f4d481 100644 --- a/src/test/compile-fail/borrowck-autoref-3261.rs +++ b/src/test/compile-fail/borrowck-autoref-3261.rs @@ -23,7 +23,7 @@ fn main() { x = X(Left((0,0))); //~ ERROR assigning to captured outer mutable variable (*f)() }, - _ => die!() + _ => fail!() } } } diff --git a/src/test/compile-fail/borrowck-loan-local-as-both-mut-and-imm.rs b/src/test/compile-fail/borrowck-loan-local-as-both-mut-and-imm.rs index 9aec4b49ef2..a2ba5ad4891 100644 --- a/src/test/compile-fail/borrowck-loan-local-as-both-mut-and-imm.rs +++ b/src/test/compile-fail/borrowck-loan-local-as-both-mut-and-imm.rs @@ -16,7 +16,7 @@ use core::either::{Either, Left, Right}; *x = Right(1.0); *z } - _ => die!() + _ => fail!() } } diff --git a/src/test/compile-fail/borrowck-ref-into-rvalue.rs b/src/test/compile-fail/borrowck-ref-into-rvalue.rs index 0c2903765fc..37ee747069c 100644 --- a/src/test/compile-fail/borrowck-ref-into-rvalue.rs +++ b/src/test/compile-fail/borrowck-ref-into-rvalue.rs @@ -14,7 +14,7 @@ fn main() { Some(ref m) => { msg = m; }, - None => { die!() } + None => { fail!() } } io::println(*msg); } diff --git a/src/test/compile-fail/borrowck-vec-pattern-element-loan.rs b/src/test/compile-fail/borrowck-vec-pattern-element-loan.rs index 94067700270..deebff5f43a 100644 --- a/src/test/compile-fail/borrowck-vec-pattern-element-loan.rs +++ b/src/test/compile-fail/borrowck-vec-pattern-element-loan.rs @@ -2,7 +2,7 @@ fn a() -> &[int] { let vec = [1, 2, 3, 4]; let tail = match vec { //~ ERROR illegal borrow [_a, ..tail] => tail, - _ => die!(~"foo") + _ => fail!(~"foo") }; move tail } diff --git a/src/test/compile-fail/borrowck-vec-pattern-nesting.rs b/src/test/compile-fail/borrowck-vec-pattern-nesting.rs index 0a200e736ba..05ff85d612c 100644 --- a/src/test/compile-fail/borrowck-vec-pattern-nesting.rs +++ b/src/test/compile-fail/borrowck-vec-pattern-nesting.rs @@ -4,7 +4,7 @@ fn a() { [~ref _a] => { vec[0] = ~4; //~ ERROR prohibited due to outstanding loan } - _ => die!(~"foo") + _ => fail!(~"foo") } } diff --git a/src/test/compile-fail/borrowck-vec-pattern-tail-element-loan.rs b/src/test/compile-fail/borrowck-vec-pattern-tail-element-loan.rs index 64bb571b2dc..e1ed0f0daa1 100644 --- a/src/test/compile-fail/borrowck-vec-pattern-tail-element-loan.rs +++ b/src/test/compile-fail/borrowck-vec-pattern-tail-element-loan.rs @@ -2,7 +2,7 @@ fn a() -> &int { let vec = [1, 2, 3, 4]; let tail = match vec { //~ ERROR illegal borrow [_a, ..tail] => &tail[0], - _ => die!(~"foo") + _ => fail!(~"foo") }; move tail } diff --git a/src/test/compile-fail/closure-that-fails.rs b/src/test/compile-fail/closure-that-fails.rs index a76649fb990..66d4e601ec7 100644 --- a/src/test/compile-fail/closure-that-fails.rs +++ b/src/test/compile-fail/closure-that-fails.rs @@ -2,6 +2,6 @@ fn foo(f: fn() -> !) {} fn main() { // Type inference didn't use to be able to handle this: - foo(|| die!()); + foo(|| fail!()); foo(|| 22); //~ ERROR mismatched types } diff --git a/src/test/compile-fail/deref-non-pointer.rs b/src/test/compile-fail/deref-non-pointer.rs index ef84b11d5fc..5f93faef5fc 100644 --- a/src/test/compile-fail/deref-non-pointer.rs +++ b/src/test/compile-fail/deref-non-pointer.rs @@ -11,6 +11,6 @@ // error-pattern:cannot be dereferenced fn main() { match *1 { - _ => { die!(); } + _ => { fail!(); } } } diff --git a/src/test/compile-fail/die-not-unique.rs b/src/test/compile-fail/die-not-unique.rs index bbda5332c77..29369f081d7 100644 --- a/src/test/compile-fail/die-not-unique.rs +++ b/src/test/compile-fail/die-not-unique.rs @@ -1,5 +1,5 @@ // error-pattern:mismatched types fn main() { - die!("test"); + fail!("test"); } diff --git a/src/test/compile-fail/fail-expr.rs b/src/test/compile-fail/fail-expr.rs index 6d4f5ba2f4c..38a883d44db 100644 --- a/src/test/compile-fail/fail-expr.rs +++ b/src/test/compile-fail/fail-expr.rs @@ -10,4 +10,4 @@ // error-pattern:mismatched types -fn main() { die!(5); } +fn main() { fail!(5); } diff --git a/src/test/compile-fail/fail-simple.rs b/src/test/compile-fail/fail-simple.rs index eab577f713b..7def16770a7 100644 --- a/src/test/compile-fail/fail-simple.rs +++ b/src/test/compile-fail/fail-simple.rs @@ -12,5 +12,5 @@ // error-pattern:unexpected token fn main() { - die!(@); + fail!(@); } diff --git a/src/test/compile-fail/fail-type-err.rs b/src/test/compile-fail/fail-type-err.rs index 8e32c086962..664063b466b 100644 --- a/src/test/compile-fail/fail-type-err.rs +++ b/src/test/compile-fail/fail-type-err.rs @@ -9,4 +9,4 @@ // except according to those terms. // error-pattern:expected `~str` but found `~[int]` -fn main() { die!(~[0i]); } +fn main() { fail!(~[0i]); } diff --git a/src/test/compile-fail/issue-2149.rs b/src/test/compile-fail/issue-2149.rs index 3df9dc8300a..abc6fe50fab 100644 --- a/src/test/compile-fail/issue-2149.rs +++ b/src/test/compile-fail/issue-2149.rs @@ -14,7 +14,7 @@ trait vec_monad { impl ~[A]: vec_monad { fn bind(f: fn(A) -> ~[B]) { - let mut r = die!(); + let mut r = fail!(); for self.each |elt| { r += f(*elt); } //~^ WARNING unreachable expression //~^^ ERROR the type of this value must be known diff --git a/src/test/compile-fail/issue-2150.rs b/src/test/compile-fail/issue-2150.rs index 51883aa9734..3ab8f765ad5 100644 --- a/src/test/compile-fail/issue-2150.rs +++ b/src/test/compile-fail/issue-2150.rs @@ -9,7 +9,7 @@ // except according to those terms. fn fail_len(v: ~[const int]) -> uint { - let mut i = die!(); + let mut i = fail!(); for v.each |x| { i += 1u; } //~^ WARNING unreachable statement //~^^ ERROR the type of this value must be known diff --git a/src/test/compile-fail/issue-2151.rs b/src/test/compile-fail/issue-2151.rs index ef72f7245ac..a9f0ddbe743 100644 --- a/src/test/compile-fail/issue-2151.rs +++ b/src/test/compile-fail/issue-2151.rs @@ -9,7 +9,7 @@ // except according to those terms. fn main() { - for vec::each(die!()) |i| { + for vec::each(fail!()) |i| { log (debug, i * 2); //~^ ERROR the type of this value must be known }; diff --git a/src/test/compile-fail/issue-2330.rs b/src/test/compile-fail/issue-2330.rs index abaeb37e6c2..9ff9676b675 100644 --- a/src/test/compile-fail/issue-2330.rs +++ b/src/test/compile-fail/issue-2330.rs @@ -16,7 +16,7 @@ trait channel { // `chan` is not a trait, it's an enum impl int: chan { //~ ERROR can only implement trait types - fn send(v: int) { die!() } + fn send(v: int) { fail!() } } fn main() { diff --git a/src/test/compile-fail/issue-2354.rs b/src/test/compile-fail/issue-2354.rs index 37945839de4..409e1c1f040 100644 --- a/src/test/compile-fail/issue-2354.rs +++ b/src/test/compile-fail/issue-2354.rs @@ -16,8 +16,8 @@ */ fn foo() { //~ ERROR this open brace is not closed match Some(x) { - Some(y) { die!(); } - None { die!(); } + Some(y) { fail!(); } + None { fail!(); } } fn bar() { diff --git a/src/test/compile-fail/issue-2611-3.rs b/src/test/compile-fail/issue-2611-3.rs index 7624e33e9ad..4bcdf9b299f 100644 --- a/src/test/compile-fail/issue-2611-3.rs +++ b/src/test/compile-fail/issue-2611-3.rs @@ -24,7 +24,7 @@ struct E { } impl E: A { - fn b(_x: F) -> F { die!() } //~ ERROR in method `b`, type parameter 0 has 1 bound, but + fn b(_x: F) -> F { fail!() } //~ ERROR in method `b`, type parameter 0 has 1 bound, but } fn main() {} diff --git a/src/test/compile-fail/issue-2611-4.rs b/src/test/compile-fail/issue-2611-4.rs index 1e923974d33..a20a182d85e 100644 --- a/src/test/compile-fail/issue-2611-4.rs +++ b/src/test/compile-fail/issue-2611-4.rs @@ -21,7 +21,7 @@ struct E { } impl E: A { - fn b(_x: F) -> F { die!() } //~ ERROR in method `b`, type parameter 0 has 2 bounds, but + fn b(_x: F) -> F { fail!() } //~ ERROR in method `b`, type parameter 0 has 2 bounds, but } fn main() {} diff --git a/src/test/compile-fail/issue-2611-5.rs b/src/test/compile-fail/issue-2611-5.rs index e868d022d57..f55feb80c32 100644 --- a/src/test/compile-fail/issue-2611-5.rs +++ b/src/test/compile-fail/issue-2611-5.rs @@ -22,7 +22,7 @@ struct E { impl E: A { // n.b. The error message is awful -- see #3404 - fn b(_x: G) -> G { die!() } //~ ERROR method `b` has an incompatible type + fn b(_x: G) -> G { fail!() } //~ ERROR method `b` has an incompatible type } fn main() {} diff --git a/src/test/compile-fail/issue-2817.rs b/src/test/compile-fail/issue-2817.rs index 45b72634293..8c28fcdc7fc 100644 --- a/src/test/compile-fail/issue-2817.rs +++ b/src/test/compile-fail/issue-2817.rs @@ -8,11 +8,11 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -fn uuid() -> uint { die!(); } +fn uuid() -> uint { fail!(); } -fn from_str(s: ~str) -> uint { die!(); } -fn to_str(u: uint) -> ~str { die!(); } -fn uuid_random() -> uint { die!(); } +fn from_str(s: ~str) -> uint { fail!(); } +fn to_str(u: uint) -> ~str { fail!(); } +fn uuid_random() -> uint { fail!(); } fn main() { do uint::range(0, 100000) |_i| { //~ ERROR Do-block body must return bool, but diff --git a/src/test/compile-fail/issue-3021.rs b/src/test/compile-fail/issue-3021.rs index cde878e122a..fa9c4eb5217 100644 --- a/src/test/compile-fail/issue-3021.rs +++ b/src/test/compile-fail/issue-3021.rs @@ -26,7 +26,7 @@ fn siphash(k0 : u64) -> siphash { //~^ ERROR unresolved name: k0 } } - die!(); + fail!(); } fn main() {} diff --git a/src/test/compile-fail/issue-3601.rs b/src/test/compile-fail/issue-3601.rs index 74136d95573..40d65938795 100644 --- a/src/test/compile-fail/issue-3601.rs +++ b/src/test/compile-fail/issue-3601.rs @@ -37,6 +37,6 @@ fn main() { ~Element(ed) => match ed.kind { ~HTMLImageElement(d) if d.image.is_some() => { true } }, - _ => die!(~"WAT") //~ ERROR wat + _ => fail!(~"WAT") //~ ERROR wat }; } diff --git a/src/test/compile-fail/issue-3668.rs b/src/test/compile-fail/issue-3668.rs index 5fc692ed3ec..364701de2d1 100644 --- a/src/test/compile-fail/issue-3668.rs +++ b/src/test/compile-fail/issue-3668.rs @@ -16,7 +16,7 @@ trait PTrait { impl P: PTrait { fn getChildOption() -> Option<@P> { const childVal: @P = self.child.get(); //~ ERROR attempt to use a non-constant value in a constant - die!(); + fail!(); } } diff --git a/src/test/compile-fail/issue-897-2.rs b/src/test/compile-fail/issue-897-2.rs index e910ea1fa57..253563c1219 100644 --- a/src/test/compile-fail/issue-897-2.rs +++ b/src/test/compile-fail/issue-897-2.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -fn g() -> ! { die!(); } +fn g() -> ! { fail!(); } fn f() -> ! { return 42i; //~ ERROR expected `!` but found `int` g(); //~ WARNING unreachable statement diff --git a/src/test/compile-fail/issue-897.rs b/src/test/compile-fail/issue-897.rs index f5f4b376a99..503574fce87 100644 --- a/src/test/compile-fail/issue-897.rs +++ b/src/test/compile-fail/issue-897.rs @@ -10,6 +10,6 @@ fn f() -> ! { return 42i; //~ ERROR expected `!` but found `int` - die!(); //~ WARNING unreachable statement + fail!(); //~ WARNING unreachable statement } fn main() { } diff --git a/src/test/compile-fail/liveness-use-after-send.rs b/src/test/compile-fail/liveness-use-after-send.rs index fcdf9438e3d..f852fb1d38e 100644 --- a/src/test/compile-fail/liveness-use-after-send.rs +++ b/src/test/compile-fail/liveness-use-after-send.rs @@ -11,7 +11,7 @@ fn send(ch: _chan, -data: T) { log(debug, ch); log(debug, data); - die!(); + fail!(); } enum _chan = int; @@ -23,4 +23,4 @@ fn test00_start(ch: _chan<~int>, message: ~int, _count: ~int) { log(debug, message); //~ ERROR use of moved value: `message` } -fn main() { die!(); } +fn main() { fail!(); } diff --git a/src/test/compile-fail/moves-based-on-type-exprs.rs b/src/test/compile-fail/moves-based-on-type-exprs.rs index be842a4cdd7..7356c227360 100644 --- a/src/test/compile-fail/moves-based-on-type-exprs.rs +++ b/src/test/compile-fail/moves-based-on-type-exprs.rs @@ -2,7 +2,7 @@ // they occur as part of various kinds of expressions. struct Foo { f: A } -fn guard(_s: ~str) -> bool {die!()} +fn guard(_s: ~str) -> bool {fail!()} fn touch(_a: &A) {} fn f10() { diff --git a/src/test/compile-fail/non-exhaustive-match-nested.rs b/src/test/compile-fail/non-exhaustive-match-nested.rs index b8db996ebfa..4d1db362376 100644 --- a/src/test/compile-fail/non-exhaustive-match-nested.rs +++ b/src/test/compile-fail/non-exhaustive-match-nested.rs @@ -16,8 +16,8 @@ enum u { c, d } fn main() { let x = a(c); match x { - a(d) => { die!(~"hello"); } - b => { die!(~"goodbye"); } + a(d) => { fail!(~"hello"); } + b => { fail!(~"goodbye"); } } } diff --git a/src/test/compile-fail/noncopyable-match-pattern.rs b/src/test/compile-fail/noncopyable-match-pattern.rs index a123cf9fc6f..9f21d5a647a 100644 --- a/src/test/compile-fail/noncopyable-match-pattern.rs +++ b/src/test/compile-fail/noncopyable-match-pattern.rs @@ -14,6 +14,6 @@ fn main() { Some(copy z) => { //~ ERROR copying a value of non-copyable type do z.with |b| { assert !*b; } } - None => die!() + None => fail!() } } diff --git a/src/test/compile-fail/not-enough-arguments.rs b/src/test/compile-fail/not-enough-arguments.rs index ef4f0f4fb53..57eca3666ef 100644 --- a/src/test/compile-fail/not-enough-arguments.rs +++ b/src/test/compile-fail/not-enough-arguments.rs @@ -13,7 +13,7 @@ // unrelated errors. fn foo(a: int, b: int, c: int, d:int) { - die!(); + fail!(); } fn main() { diff --git a/src/test/compile-fail/pattern-tyvar-2.rs b/src/test/compile-fail/pattern-tyvar-2.rs index 7942a38caa0..29eb1ec8d0a 100644 --- a/src/test/compile-fail/pattern-tyvar-2.rs +++ b/src/test/compile-fail/pattern-tyvar-2.rs @@ -17,6 +17,6 @@ use option::Some; enum bar { t1((), Option<~[int]>), t2, } -fn foo(t: bar) -> int { match t { t1(_, Some(x)) => { return x * 3; } _ => { die!(); } } } +fn foo(t: bar) -> int { match t { t1(_, Some(x)) => { return x * 3; } _ => { fail!(); } } } fn main() { } diff --git a/src/test/compile-fail/pattern-tyvar.rs b/src/test/compile-fail/pattern-tyvar.rs index 3b4200bb4be..bb4e97f9101 100644 --- a/src/test/compile-fail/pattern-tyvar.rs +++ b/src/test/compile-fail/pattern-tyvar.rs @@ -21,7 +21,7 @@ fn foo(t: bar) { t1(_, Some::(x)) => { log(debug, x); } - _ => { die!(); } + _ => { fail!(); } } } diff --git a/src/test/compile-fail/qquote-1.rs b/src/test/compile-fail/qquote-1.rs index 2fc487d13d2..a9ba7082628 100644 --- a/src/test/compile-fail/qquote-1.rs +++ b/src/test/compile-fail/qquote-1.rs @@ -63,6 +63,6 @@ fn main() { } fn check_pp(expr: T, f: fn(pprust::ps, T), expect: str) { - die!(); + fail!(); } diff --git a/src/test/compile-fail/qquote-2.rs b/src/test/compile-fail/qquote-2.rs index 43b1d287739..fe382badb5c 100644 --- a/src/test/compile-fail/qquote-2.rs +++ b/src/test/compile-fail/qquote-2.rs @@ -58,6 +58,6 @@ fn main() { } fn check_pp(expr: T, f: fn(pprust::ps, T), expect: str) { - die!(); + fail!(); } diff --git a/src/test/compile-fail/regions-fn-bound.rs b/src/test/compile-fail/regions-fn-bound.rs index 95a5222d14c..6deef8cee9e 100644 --- a/src/test/compile-fail/regions-fn-bound.rs +++ b/src/test/compile-fail/regions-fn-bound.rs @@ -8,8 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -fn of() -> @fn(T) { die!(); } -fn subtype(x: @fn(T)) { die!(); } +fn of() -> @fn(T) { fail!(); } +fn subtype(x: @fn(T)) { fail!(); } fn test_fn(_x: &x/T, _y: &y/T, _z: &z/T) { // Here, x, y, and z are free. Other letters diff --git a/src/test/compile-fail/regions-fn-subtyping.rs b/src/test/compile-fail/regions-fn-subtyping.rs index 3ead89b2082..526a5de7fef 100644 --- a/src/test/compile-fail/regions-fn-subtyping.rs +++ b/src/test/compile-fail/regions-fn-subtyping.rs @@ -8,8 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -fn of() -> @fn(T) { die!(); } -fn subtype(x: @fn(T)) { die!(); } +fn of() -> @fn(T) { fail!(); } +fn subtype(x: @fn(T)) { fail!(); } fn test_fn(_x: &x/T, _y: &y/T, _z: &z/T) { // Here, x, y, and z are free. Other letters diff --git a/src/test/compile-fail/tag-that-dare-not-speak-its-name.rs b/src/test/compile-fail/tag-that-dare-not-speak-its-name.rs index c6cd05b7a65..a05d6a324de 100644 --- a/src/test/compile-fail/tag-that-dare-not-speak-its-name.rs +++ b/src/test/compile-fail/tag-that-dare-not-speak-its-name.rs @@ -16,7 +16,7 @@ extern mod core; fn last(v: ~[const &T]) -> core::Option { - die!(); + fail!(); } fn main() { diff --git a/src/test/compile-fail/tag-type-args.rs b/src/test/compile-fail/tag-type-args.rs index ea40d8bd077..4550d95aa5d 100644 --- a/src/test/compile-fail/tag-type-args.rs +++ b/src/test/compile-fail/tag-type-args.rs @@ -14,4 +14,4 @@ enum quux { bar } fn foo(c: quux) { assert (false); } -fn main() { die!(); } +fn main() { fail!(); } diff --git a/src/test/compile-fail/warn-foreign-int-types.rs b/src/test/compile-fail/warn-foreign-int-types.rs index 801e3e71030..bb6d754805b 100644 --- a/src/test/compile-fail/warn-foreign-int-types.rs +++ b/src/test/compile-fail/warn-foreign-int-types.rs @@ -16,5 +16,5 @@ extern mod xx { fn main() { // let it fail to verify warning message - die!() + fail!() } diff --git a/src/test/pretty/issue-929.rs b/src/test/pretty/issue-929.rs index 7b24d256cb0..636fac82b6b 100644 --- a/src/test/pretty/issue-929.rs +++ b/src/test/pretty/issue-929.rs @@ -8,6 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -fn f() { if (1 == die!()) { } else { } } +fn f() { if (1 == fail!()) { } else { } } fn main() { } diff --git a/src/test/run-fail/alt-bot-fail.rs b/src/test/run-fail/alt-bot-fail.rs index ac465d81b7e..2ba78e21374 100644 --- a/src/test/run-fail/alt-bot-fail.rs +++ b/src/test/run-fail/alt-bot-fail.rs @@ -14,6 +14,6 @@ fn foo(s: ~str) { } fn main() { let i = - match Some::(3) { None:: => { die!() } Some::(_) => { die!() } }; + match Some::(3) { None:: => { fail!() } Some::(_) => { fail!() } }; foo(i); } diff --git a/src/test/run-fail/alt-disc-bot.rs b/src/test/run-fail/alt-disc-bot.rs index c74e16f4222..afe2735e67d 100644 --- a/src/test/run-fail/alt-disc-bot.rs +++ b/src/test/run-fail/alt-disc-bot.rs @@ -9,6 +9,6 @@ // except according to those terms. // error-pattern:quux -fn f() -> ! { die!(~"quux") } +fn f() -> ! { fail!(~"quux") } fn g() -> int { match f() { true => { 1 } false => { 0 } } } fn main() { g(); } diff --git a/src/test/run-fail/alt-wildcards.rs b/src/test/run-fail/alt-wildcards.rs index e30a73601c6..4730f1bc560 100644 --- a/src/test/run-fail/alt-wildcards.rs +++ b/src/test/run-fail/alt-wildcards.rs @@ -11,9 +11,9 @@ // error-pattern:squirrelcupcake fn cmp() -> int { match (option::Some('a'), option::None::) { - (option::Some(_), _) => { die!(~"squirrelcupcake"); } - (_, option::Some(_)) => { die!(); } - _ => { die!(~"wat"); } + (option::Some(_), _) => { fail!(~"squirrelcupcake"); } + (_, option::Some(_)) => { fail!(); } + _ => { fail!(~"wat"); } } } diff --git a/src/test/run-fail/args-fail.rs b/src/test/run-fail/args-fail.rs index c3675109948..5cdddb0cda8 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) { die!(~"moop"); } +fn f(a: int, b: int, c: @int) { fail!(~"moop"); } -fn main() { f(1, die!(~"meep"), @42); } +fn main() { f(1, fail!(~"meep"), @42); } diff --git a/src/test/run-fail/binop-fail-2.rs b/src/test/run-fail/binop-fail-2.rs index 1e553d1089d..2f1eb65a43a 100644 --- a/src/test/run-fail/binop-fail-2.rs +++ b/src/test/run-fail/binop-fail-2.rs @@ -9,5 +9,5 @@ // except according to those terms. // error-pattern:quux -fn my_err(s: ~str) -> ! { log(error, s); die!(~"quux"); } +fn my_err(s: ~str) -> ! { log(error, s); fail!(~"quux"); } fn main() { 3u == my_err(~"bye"); } diff --git a/src/test/run-fail/binop-fail.rs b/src/test/run-fail/binop-fail.rs index 1e553d1089d..2f1eb65a43a 100644 --- a/src/test/run-fail/binop-fail.rs +++ b/src/test/run-fail/binop-fail.rs @@ -9,5 +9,5 @@ // except according to those terms. // error-pattern:quux -fn my_err(s: ~str) -> ! { log(error, s); die!(~"quux"); } +fn my_err(s: ~str) -> ! { log(error, s); fail!(~"quux"); } fn main() { 3u == my_err(~"bye"); } diff --git a/src/test/run-fail/bug-811.rs b/src/test/run-fail/bug-811.rs index f16e838aaf5..85e0f3dd398 100644 --- a/src/test/run-fail/bug-811.rs +++ b/src/test/run-fail/bug-811.rs @@ -16,6 +16,6 @@ type port_id = int; enum chan_t = {task: task_id, port: port_id}; -fn send(ch: chan_t, data: T) { die!(); } +fn send(ch: chan_t, data: T) { fail!(); } -fn main() { die!(~"quux"); } +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 3d293fc805d..26d5ea4349d 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 = die!(~"test"); + let i: int = fail!(~"test"); } \ No newline at end of file diff --git a/src/test/run-fail/die-macro-pure.rs b/src/test/run-fail/die-macro-pure.rs index 67eb6e63230..74de57a8a25 100644 --- a/src/test/run-fail/die-macro-pure.rs +++ b/src/test/run-fail/die-macro-pure.rs @@ -1,7 +1,7 @@ // error-pattern:test pure fn f() { - die!(~"test"); + fail!(~"test"); } fn main() { diff --git a/src/test/run-fail/die-macro.rs b/src/test/run-fail/die-macro.rs index 0885c17e121..6eb56a5be4e 100644 --- a/src/test/run-fail/die-macro.rs +++ b/src/test/run-fail/die-macro.rs @@ -1,5 +1,5 @@ // error-pattern:test fn main() { - die!(~"test"); + fail!(~"test"); } \ No newline at end of file diff --git a/src/test/run-fail/doublefail.rs b/src/test/run-fail/doublefail.rs index 38e29d02fdd..ce9678aa5eb 100644 --- a/src/test/run-fail/doublefail.rs +++ b/src/test/run-fail/doublefail.rs @@ -10,6 +10,6 @@ //error-pattern:One fn main() { - die!(~"One"); - die!(~"Two"); + fail!(~"One"); + fail!(~"Two"); } diff --git a/src/test/run-fail/explicit-fail-msg.rs b/src/test/run-fail/explicit-fail-msg.rs index ac5eaefe32b..17fb14881a5 100644 --- a/src/test/run-fail/explicit-fail-msg.rs +++ b/src/test/run-fail/explicit-fail-msg.rs @@ -10,5 +10,5 @@ // error-pattern:wooooo fn main() { - let mut a = 1; if 1 == 1 { a = 2; } die!(~"woooo" + ~"o"); + let mut a = 1; if 1 == 1 { a = 2; } fail!(~"woooo" + ~"o"); } diff --git a/src/test/run-fail/explicit-fail.rs b/src/test/run-fail/explicit-fail.rs index acc5ef91668..8c204b66e36 100644 --- a/src/test/run-fail/explicit-fail.rs +++ b/src/test/run-fail/explicit-fail.rs @@ -12,4 +12,4 @@ // error-pattern:explicit -fn main() { die!(); } +fn main() { fail!(); } diff --git a/src/test/run-fail/expr-alt-fail-fn.rs b/src/test/run-fail/expr-alt-fail-fn.rs index 6cb0f4f3260..6476e57a35b 100644 --- a/src/test/run-fail/expr-alt-fail-fn.rs +++ b/src/test/run-fail/expr-alt-fail-fn.rs @@ -12,7 +12,7 @@ // error-pattern:explicit failure -fn f() -> ! { die!() } +fn f() -> ! { fail!() } fn g() -> int { let x = match true { true => { f() } false => { 10 } }; return x; } diff --git a/src/test/run-fail/expr-alt-fail.rs b/src/test/run-fail/expr-alt-fail.rs index b70382955e3..e2bf6052a10 100644 --- a/src/test/run-fail/expr-alt-fail.rs +++ b/src/test/run-fail/expr-alt-fail.rs @@ -12,4 +12,4 @@ // error-pattern:explicit failure -fn main() { let x = match true { false => { 0 } true => { die!() } }; } +fn main() { let x = match true { false => { 0 } true => { fail!() } }; } diff --git a/src/test/run-fail/expr-fn-fail.rs b/src/test/run-fail/expr-fn-fail.rs index 2b840a71b8b..e645ea34df5 100644 --- a/src/test/run-fail/expr-fn-fail.rs +++ b/src/test/run-fail/expr-fn-fail.rs @@ -12,6 +12,6 @@ // error-pattern:explicit failure -fn f() -> ! { die!() } +fn f() -> ! { fail!() } fn main() { f(); } diff --git a/src/test/run-fail/expr-if-fail-fn.rs b/src/test/run-fail/expr-if-fail-fn.rs index cd6efa7302a..99f798147f2 100644 --- a/src/test/run-fail/expr-if-fail-fn.rs +++ b/src/test/run-fail/expr-if-fail-fn.rs @@ -12,7 +12,7 @@ // error-pattern:explicit failure -fn f() -> ! { die!() } +fn f() -> ! { fail!() } fn g() -> int { let x = if true { f() } else { 10 }; return x; } diff --git a/src/test/run-fail/expr-if-fail.rs b/src/test/run-fail/expr-if-fail.rs index d39a0271e64..c1663866519 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 { die!() } else { 10 }; } +fn main() { let x = if false { 0 } else if true { fail!() } else { 10 }; } diff --git a/src/test/run-fail/extern-fail.rs b/src/test/run-fail/extern-fail.rs index 7f59d499fd3..7227be11e80 100644 --- a/src/test/run-fail/extern-fail.rs +++ b/src/test/run-fail/extern-fail.rs @@ -37,7 +37,7 @@ fn main() { do task::spawn { let result = count(5u); debug!("result = %?", result); - die!(); + fail!(); }; } } diff --git a/src/test/run-fail/fail-arg.rs b/src/test/run-fail/fail-arg.rs index 4ead0db2d42..fc365613cf1 100644 --- a/src/test/run-fail/fail-arg.rs +++ b/src/test/run-fail/fail-arg.rs @@ -11,4 +11,4 @@ // error-pattern:woe fn f(a: int) { log(debug, a); } -fn main() { f(die!(~"woe")); } +fn main() { f(fail!(~"woe")); } diff --git a/src/test/run-fail/fail-main.rs b/src/test/run-fail/fail-main.rs index 2755f8e47a2..50031261bfc 100644 --- a/src/test/run-fail/fail-main.rs +++ b/src/test/run-fail/fail-main.rs @@ -10,4 +10,4 @@ // error-pattern:moop extern mod std; -fn main() { die!(~"moop"); } +fn main() { fail!(~"moop"); } diff --git a/src/test/run-fail/fail-parens.rs b/src/test/run-fail/fail-parens.rs index 144a36bd730..5ba907b0eb6 100644 --- a/src/test/run-fail/fail-parens.rs +++ b/src/test/run-fail/fail-parens.rs @@ -13,8 +13,8 @@ // error-pattern:oops fn bigfail() { - while (die!(~"oops")) { if (die!()) { - match (die!()) { () => { + while (fail!(~"oops")) { if (fail!()) { + match (fail!()) { () => { } } }}; diff --git a/src/test/run-fail/fmt-fail.rs b/src/test/run-fail/fmt-fail.rs index 3e6f8a433c6..10d89038381 100644 --- a/src/test/run-fail/fmt-fail.rs +++ b/src/test/run-fail/fmt-fail.rs @@ -11,4 +11,4 @@ // error-pattern:meh extern mod std; -fn main() { let str_var: ~str = ~"meh"; die!(fmt!("%s", str_var)); } +fn main() { let str_var: ~str = ~"meh"; fail!(fmt!("%s", str_var)); } diff --git a/src/test/run-fail/for-each-loop-fail.rs b/src/test/run-fail/for-each-loop-fail.rs index bbae1b1739d..fa62a9c5c34 100644 --- a/src/test/run-fail/for-each-loop-fail.rs +++ b/src/test/run-fail/for-each-loop-fail.rs @@ -10,4 +10,4 @@ // error-pattern:moop extern mod std; -fn main() { for uint::range(0u, 10u) |_i| { die!(~"moop"); } } +fn main() { for uint::range(0u, 10u) |_i| { fail!(~"moop"); } } diff --git a/src/test/run-fail/if-check-fail.rs b/src/test/run-fail/if-check-fail.rs index f0bc250f1cb..5f9da798ffa 100644 --- a/src/test/run-fail/if-check-fail.rs +++ b/src/test/run-fail/if-check-fail.rs @@ -19,7 +19,7 @@ fn foo(x: uint) { if even(x) { log(debug, x); } else { - die!(~"Number is odd"); + fail!(~"Number is odd"); } } diff --git a/src/test/run-fail/if-cond-bot.rs b/src/test/run-fail/if-cond-bot.rs index 1212b550cfb..d558ff1e3b8 100644 --- a/src/test/run-fail/if-cond-bot.rs +++ b/src/test/run-fail/if-cond-bot.rs @@ -9,5 +9,5 @@ // except according to those terms. // error-pattern:quux -fn my_err(s: ~str) -> ! { log(error, s); die!(~"quux"); } +fn my_err(s: ~str) -> ! { log(error, s); fail!(~"quux"); } fn main() { if my_err(~"bye") { } } diff --git a/src/test/run-fail/issue-1459.rs b/src/test/run-fail/issue-1459.rs index bb97e5b2b6a..7f8cc7459de 100644 --- a/src/test/run-fail/issue-1459.rs +++ b/src/test/run-fail/issue-1459.rs @@ -10,5 +10,5 @@ // error-pattern:roflcopter fn main() { - log (die!(~"roflcopter"), 2); + log (fail!(~"roflcopter"), 2); } diff --git a/src/test/run-fail/issue-2156.rs b/src/test/run-fail/issue-2156.rs index deb8192fc3b..a518816533e 100644 --- a/src/test/run-fail/issue-2156.rs +++ b/src/test/run-fail/issue-2156.rs @@ -15,6 +15,6 @@ use io::ReaderUtil; fn main() { do io::with_str_reader(~"") |rdr| { - match rdr.read_char() { '=' => { } _ => { die!() } } + match rdr.read_char() { '=' => { } _ => { fail!() } } } } diff --git a/src/test/run-fail/issue-2272.rs b/src/test/run-fail/issue-2272.rs index de7475b3303..5ce89bc1814 100644 --- a/src/test/run-fail/issue-2272.rs +++ b/src/test/run-fail/issue-2272.rs @@ -22,5 +22,5 @@ fn main() { }, a: ~0 }; - die!(); + fail!(); } diff --git a/src/test/run-fail/issue-2444.rs b/src/test/run-fail/issue-2444.rs index a4c329a41fc..04a0f47fc06 100644 --- a/src/test/run-fail/issue-2444.rs +++ b/src/test/run-fail/issue-2444.rs @@ -15,7 +15,7 @@ use std::arc; enum e { e(arc::ARC) } -fn foo() -> e {die!();} +fn foo() -> e {fail!();} fn main() { let f = foo(); diff --git a/src/test/run-fail/issue-3029.rs b/src/test/run-fail/issue-3029.rs index ca4774cd53e..3ae6eccd5e2 100644 --- a/src/test/run-fail/issue-3029.rs +++ b/src/test/run-fail/issue-3029.rs @@ -11,7 +11,7 @@ // error-pattern:so long fn main() { let x = ~[], y = ~[3]; - die!(~"so long"); + fail!(~"so long"); x += y; ~"good" + ~"bye"; } diff --git a/src/test/run-fail/issue-948.rs b/src/test/run-fail/issue-948.rs index ddb3eecdbf1..2f9a1e8a058 100644 --- a/src/test/run-fail/issue-948.rs +++ b/src/test/run-fail/issue-948.rs @@ -14,5 +14,5 @@ struct Point { x: int, y: int } fn main() { let origin = Point {x: 0, y: 0}; - let f: Point = Point {x: (die!(~"beep boop")),.. origin}; + let f: Point = Point {x: (fail!(~"beep boop")),.. origin}; } diff --git a/src/test/run-fail/linked-failure2.rs b/src/test/run-fail/linked-failure2.rs index f020cb7eafd..1402020c357 100644 --- a/src/test/run-fail/linked-failure2.rs +++ b/src/test/run-fail/linked-failure2.rs @@ -12,7 +12,7 @@ // error-pattern:fail -fn child() { die!(); } +fn child() { fail!(); } fn main() { let (p, _c) = pipes::stream::<()>(); diff --git a/src/test/run-fail/linked-failure3.rs b/src/test/run-fail/linked-failure3.rs index 78e3798399c..cb03a71aabc 100644 --- a/src/test/run-fail/linked-failure3.rs +++ b/src/test/run-fail/linked-failure3.rs @@ -12,7 +12,7 @@ // error-pattern:fail -fn grandchild() { die!(~"grandchild dies"); } +fn grandchild() { fail!(~"grandchild dies"); } fn child() { let (p, _c) = pipes::stream::(); diff --git a/src/test/run-fail/morestack1.rs b/src/test/run-fail/morestack1.rs index 63a7cc7ed89..f4faac0b2ab 100644 --- a/src/test/run-fail/morestack1.rs +++ b/src/test/run-fail/morestack1.rs @@ -13,7 +13,7 @@ fn getbig(i: int) { if i != 0 { getbig(i - 1); } else { - die!(); + fail!(); } } diff --git a/src/test/run-fail/morestack2.rs b/src/test/run-fail/morestack2.rs index 8236489834d..d5f43838598 100644 --- a/src/test/run-fail/morestack2.rs +++ b/src/test/run-fail/morestack2.rs @@ -27,7 +27,7 @@ fn getbig_call_c_and_fail(i: int) { } else { unsafe { rustrt::rust_get_argc(); - die!(); + fail!(); } } } diff --git a/src/test/run-fail/morestack3.rs b/src/test/run-fail/morestack3.rs index 01296a82969..e97e56ea0f9 100644 --- a/src/test/run-fail/morestack3.rs +++ b/src/test/run-fail/morestack3.rs @@ -19,7 +19,7 @@ fn getbig_and_fail(&&i: int) { if i != 0 { getbig_and_fail(i - 1); } else { - die!(); + fail!(); } } diff --git a/src/test/run-fail/morestack4.rs b/src/test/run-fail/morestack4.rs index e8b6785d1e8..30e9147cff7 100644 --- a/src/test/run-fail/morestack4.rs +++ b/src/test/run-fail/morestack4.rs @@ -19,7 +19,7 @@ fn getbig_and_fail(&&i: int) { if i != 0 { getbig_and_fail(i - 1); } else { - die!(); + fail!(); } } diff --git a/src/test/run-fail/rhs-type.rs b/src/test/run-fail/rhs-type.rs index 32d8f84292b..f432abe85ab 100644 --- a/src/test/run-fail/rhs-type.rs +++ b/src/test/run-fail/rhs-type.rs @@ -14,4 +14,4 @@ struct T { t: ~str } -fn main() { let pth = die!(~"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-log-trunc.rs b/src/test/run-fail/rt-log-trunc.rs index a27404e46fe..07cf24e2feb 100644 --- a/src/test/run-fail/rt-log-trunc.rs +++ b/src/test/run-fail/rt-log-trunc.rs @@ -12,7 +12,7 @@ // error-pattern:[...] fn main() { - die!(~"\ + fail!(~"\ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\ diff --git a/src/test/run-fail/rt-set-exit-status-fail.rs b/src/test/run-fail/rt-set-exit-status-fail.rs index de4b062d700..ed08022f449 100644 --- a/src/test/run-fail/rt-set-exit-status-fail.rs +++ b/src/test/run-fail/rt-set-exit-status-fail.rs @@ -16,5 +16,5 @@ fn main() { // normally. In this case we're going to fail, so instead of of // returning 50 the process will return the typical rt failure code. os::set_exit_status(50); - die!(); + fail!(); } 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 ece9f5fdc51..e936270d4b8 100644 --- a/src/test/run-fail/rt-set-exit-status-fail2.rs +++ b/src/test/run-fail/rt-set-exit-status-fail2.rs @@ -34,5 +34,5 @@ fn main() { do task::spawn { let i = r(5); }; - die!(); + fail!(); } diff --git a/src/test/run-fail/run-unexported-tests.rs b/src/test/run-fail/run-unexported-tests.rs index 48adac55586..fd898e31347 100644 --- a/src/test/run-fail/run-unexported-tests.rs +++ b/src/test/run-fail/run-unexported-tests.rs @@ -17,5 +17,5 @@ mod m { pub fn exported() { } #[test] - fn unexported() { die!(~"runned an unexported test"); } + fn unexported() { fail!(~"runned an unexported test"); } } diff --git a/src/test/run-fail/spawnfail.rs b/src/test/run-fail/spawnfail.rs index e7bfe1b67c5..8431f7bb74d 100644 --- a/src/test/run-fail/spawnfail.rs +++ b/src/test/run-fail/spawnfail.rs @@ -15,7 +15,7 @@ extern mod std; // We don't want to see any invalid reads fn main() { fn f() { - die!(); + fail!(); } task::spawn(|| f() ); } diff --git a/src/test/run-fail/task-comm-recv-block.rs b/src/test/run-fail/task-comm-recv-block.rs index 0b36977d9b5..bd866b9f9e7 100644 --- a/src/test/run-fail/task-comm-recv-block.rs +++ b/src/test/run-fail/task-comm-recv-block.rs @@ -12,7 +12,7 @@ fn goodfail() { task::yield(); - die!(~"goodfail"); + fail!(~"goodfail"); } fn main() { @@ -21,5 +21,5 @@ fn main() { // We shouldn't be able to get past this recv since there's no // message available let i: int = po.recv(); - die!(~"badfail"); + fail!(~"badfail"); } diff --git a/src/test/run-fail/unique-fail.rs b/src/test/run-fail/unique-fail.rs index 0cb37dfd260..86fde5b7f97 100644 --- a/src/test/run-fail/unique-fail.rs +++ b/src/test/run-fail/unique-fail.rs @@ -9,4 +9,4 @@ // except according to those terms. // error-pattern: fail -fn main() { ~die!(); } +fn main() { ~fail!(); } diff --git a/src/test/run-fail/unwind-alt.rs b/src/test/run-fail/unwind-alt.rs index 559c7c2d89d..1b28dd0e8ef 100644 --- a/src/test/run-fail/unwind-alt.rs +++ b/src/test/run-fail/unwind-alt.rs @@ -15,7 +15,7 @@ fn test_box() { } fn test_str() { let res = match false { true => { ~"happy" }, - _ => die!(~"non-exhaustive match failure") }; + _ => fail!(~"non-exhaustive match failure") }; assert res == ~"happy"; } fn main() { diff --git a/src/test/run-fail/unwind-box-fn-unique.rs b/src/test/run-fail/unwind-box-fn-unique.rs index ca6d154f4e6..6128e96d7bc 100644 --- a/src/test/run-fail/unwind-box-fn-unique.rs +++ b/src/test/run-fail/unwind-box-fn-unique.rs @@ -11,7 +11,7 @@ // error-pattern:fail fn failfn() { - die!(); + fail!(); } fn main() { diff --git a/src/test/run-fail/unwind-box-fn.rs b/src/test/run-fail/unwind-box-fn.rs index 94a03142bec..e1d959694e2 100644 --- a/src/test/run-fail/unwind-box-fn.rs +++ b/src/test/run-fail/unwind-box-fn.rs @@ -11,7 +11,7 @@ // error-pattern:fail fn failfn() { - die!(); + fail!(); } fn main() { diff --git a/src/test/run-fail/unwind-box-res.rs b/src/test/run-fail/unwind-box-res.rs index 13b1bc36ba9..920ddbb5bf2 100644 --- a/src/test/run-fail/unwind-box-res.rs +++ b/src/test/run-fail/unwind-box-res.rs @@ -11,7 +11,7 @@ // error-pattern:fail fn failfn() { - die!(); + fail!(); } struct r { diff --git a/src/test/run-fail/unwind-box-str.rs b/src/test/run-fail/unwind-box-str.rs index 1469a56a6d4..aaf714fff9c 100644 --- a/src/test/run-fail/unwind-box-str.rs +++ b/src/test/run-fail/unwind-box-str.rs @@ -11,7 +11,7 @@ // error-pattern:fail fn failfn() { - die!(); + fail!(); } fn main() { diff --git a/src/test/run-fail/unwind-box-trait.rs b/src/test/run-fail/unwind-box-trait.rs index d41e0f19324..1602964b481 100644 --- a/src/test/run-fail/unwind-box-trait.rs +++ b/src/test/run-fail/unwind-box-trait.rs @@ -11,7 +11,7 @@ // error-pattern:fail fn failfn() { - die!(); + fail!(); } trait i { diff --git a/src/test/run-fail/unwind-box-unique-unique.rs b/src/test/run-fail/unwind-box-unique-unique.rs index 8f24d2922f9..22a5c72b68c 100644 --- a/src/test/run-fail/unwind-box-unique-unique.rs +++ b/src/test/run-fail/unwind-box-unique-unique.rs @@ -11,7 +11,7 @@ // error-pattern:fail fn failfn() { - die!(); + fail!(); } fn main() { diff --git a/src/test/run-fail/unwind-box-unique.rs b/src/test/run-fail/unwind-box-unique.rs index 8a1dcef5ca5..3ae4000c2b1 100644 --- a/src/test/run-fail/unwind-box-unique.rs +++ b/src/test/run-fail/unwind-box-unique.rs @@ -11,7 +11,7 @@ // error-pattern:fail fn failfn() { - die!(); + fail!(); } fn main() { diff --git a/src/test/run-fail/unwind-box-vec.rs b/src/test/run-fail/unwind-box-vec.rs index e2559e66eae..d8afdd5a661 100644 --- a/src/test/run-fail/unwind-box-vec.rs +++ b/src/test/run-fail/unwind-box-vec.rs @@ -11,7 +11,7 @@ // error-pattern:fail fn failfn() { - die!(); + fail!(); } fn main() { diff --git a/src/test/run-fail/unwind-box.rs b/src/test/run-fail/unwind-box.rs index 02761fef976..21308945253 100644 --- a/src/test/run-fail/unwind-box.rs +++ b/src/test/run-fail/unwind-box.rs @@ -11,7 +11,7 @@ // error-pattern:fail fn failfn() { - die!(); + fail!(); } fn main() { diff --git a/src/test/run-fail/unwind-closure.rs b/src/test/run-fail/unwind-closure.rs index f6a3fa1ab67..34257b15b7f 100644 --- a/src/test/run-fail/unwind-closure.rs +++ b/src/test/run-fail/unwind-closure.rs @@ -11,7 +11,7 @@ // error-pattern:fail fn f(a: @int) { - die!(); + fail!(); } fn main() { diff --git a/src/test/run-fail/unwind-fail.rs b/src/test/run-fail/unwind-fail.rs index 5c776b5fd7a..4d4bc0d53eb 100644 --- a/src/test/run-fail/unwind-fail.rs +++ b/src/test/run-fail/unwind-fail.rs @@ -12,5 +12,5 @@ fn main() { @0; - die!(); + fail!(); } diff --git a/src/test/run-fail/unwind-initializer-indirect.rs b/src/test/run-fail/unwind-initializer-indirect.rs index 69106602ec8..e7f8a866543 100644 --- a/src/test/run-fail/unwind-initializer-indirect.rs +++ b/src/test/run-fail/unwind-initializer-indirect.rs @@ -10,7 +10,7 @@ // error-pattern:fail -fn f() -> @int { die!(); } +fn f() -> @int { fail!(); } fn main() { let a: @int = f(); diff --git a/src/test/run-fail/unwind-initializer.rs b/src/test/run-fail/unwind-initializer.rs index 7047a77a6e7..0293e5ba07e 100644 --- a/src/test/run-fail/unwind-initializer.rs +++ b/src/test/run-fail/unwind-initializer.rs @@ -12,6 +12,6 @@ fn main() { let a: @int = { - die!(); + fail!(); }; } diff --git a/src/test/run-fail/unwind-interleaved.rs b/src/test/run-fail/unwind-interleaved.rs index 4dac04d379d..142813bcc30 100644 --- a/src/test/run-fail/unwind-interleaved.rs +++ b/src/test/run-fail/unwind-interleaved.rs @@ -12,7 +12,7 @@ fn a() { } -fn b() { die!(); } +fn b() { fail!(); } fn main() { let x = ~[0]; diff --git a/src/test/run-fail/unwind-iter.rs b/src/test/run-fail/unwind-iter.rs index 7c5782a1813..135c5eecc2e 100644 --- a/src/test/run-fail/unwind-iter.rs +++ b/src/test/run-fail/unwind-iter.rs @@ -11,7 +11,7 @@ // error-pattern:fail fn x(it: fn(int)) { - die!(); + fail!(); it(0); } diff --git a/src/test/run-fail/unwind-iter2.rs b/src/test/run-fail/unwind-iter2.rs index 8621209fd5d..f17f9fb9154 100644 --- a/src/test/run-fail/unwind-iter2.rs +++ b/src/test/run-fail/unwind-iter2.rs @@ -16,5 +16,5 @@ fn x(it: fn(int)) { } fn main() { - x(|_x| die!() ); + x(|_x| fail!() ); } diff --git a/src/test/run-fail/unwind-lambda.rs b/src/test/run-fail/unwind-lambda.rs index 89d6dd4970e..1fff98c4338 100644 --- a/src/test/run-fail/unwind-lambda.rs +++ b/src/test/run-fail/unwind-lambda.rs @@ -21,7 +21,7 @@ fn main() { let cheese = copy cheese; let f = fn@() { let chew = mush + cheese; - die!(~"so yummy") + 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 a504e374b95..572d5a90751 100644 --- a/src/test/run-fail/unwind-misc-1.rs +++ b/src/test/run-fail/unwind-misc-1.rs @@ -22,7 +22,7 @@ fn main() { arr += ~[@~"key stuff"]; map.insert(copy arr, arr + ~[@~"value stuff"]); if arr.len() == 5 { - die!(); + fail!(); } } } diff --git a/src/test/run-fail/unwind-move.rs b/src/test/run-fail/unwind-move.rs index 2419edf650c..539896e8313 100644 --- a/src/test/run-fail/unwind-move.rs +++ b/src/test/run-fail/unwind-move.rs @@ -10,7 +10,7 @@ // error-pattern:fail fn f(-_a: @int) { - die!(); + fail!(); } fn main() { diff --git a/src/test/run-fail/unwind-nested.rs b/src/test/run-fail/unwind-nested.rs index 450c982eb3f..ca9a761cfa1 100644 --- a/src/test/run-fail/unwind-nested.rs +++ b/src/test/run-fail/unwind-nested.rs @@ -15,7 +15,7 @@ fn main() { { let b = @0; { - die!(); + fail!(); } } } diff --git a/src/test/run-fail/unwind-partial-box.rs b/src/test/run-fail/unwind-partial-box.rs index 7a5c81eed7a..d1e3b63698b 100644 --- a/src/test/run-fail/unwind-partial-box.rs +++ b/src/test/run-fail/unwind-partial-box.rs @@ -10,7 +10,7 @@ // error-pattern:fail -fn f() -> ~[int] { die!(); } +fn f() -> ~[int] { fail!(); } // Voodoo. In unwind-alt we had to do this to trigger the bug. Might // have been to do with memory allocation patterns. diff --git a/src/test/run-fail/unwind-partial-unique.rs b/src/test/run-fail/unwind-partial-unique.rs index 12f0a7b4785..5976add8800 100644 --- a/src/test/run-fail/unwind-partial-unique.rs +++ b/src/test/run-fail/unwind-partial-unique.rs @@ -10,7 +10,7 @@ // error-pattern:fail -fn f() -> ~[int] { die!(); } +fn f() -> ~[int] { fail!(); } // Voodoo. In unwind-alt we had to do this to trigger the bug. Might // have been to do with memory allocation patterns. diff --git a/src/test/run-fail/unwind-partial-vec.rs b/src/test/run-fail/unwind-partial-vec.rs index 87df161cfd3..d51c83a06d9 100644 --- a/src/test/run-fail/unwind-partial-vec.rs +++ b/src/test/run-fail/unwind-partial-vec.rs @@ -10,7 +10,7 @@ // error-pattern:fail -fn f() -> ~[int] { die!(); } +fn f() -> ~[int] { fail!(); } // Voodoo. In unwind-alt we had to do this to trigger the bug. Might // have been to do with memory allocation patterns. diff --git a/src/test/run-fail/unwind-rec.rs b/src/test/run-fail/unwind-rec.rs index 324783893f9..378816476e4 100644 --- a/src/test/run-fail/unwind-rec.rs +++ b/src/test/run-fail/unwind-rec.rs @@ -11,7 +11,7 @@ // error-pattern:fail fn build() -> ~[int] { - die!(); + fail!(); } struct Blk { node: ~[int] } diff --git a/src/test/run-fail/unwind-rec2.rs b/src/test/run-fail/unwind-rec2.rs index 0e2c279e98a..1abf6d53600 100644 --- a/src/test/run-fail/unwind-rec2.rs +++ b/src/test/run-fail/unwind-rec2.rs @@ -15,7 +15,7 @@ fn build1() -> ~[int] { } fn build2() -> ~[int] { - die!(); + fail!(); } struct Blk { node: ~[int], span: ~[int] } diff --git a/src/test/run-fail/unwind-resource-fail.rs b/src/test/run-fail/unwind-resource-fail.rs index a5ff8302495..8b9d1a66457 100644 --- a/src/test/run-fail/unwind-resource-fail.rs +++ b/src/test/run-fail/unwind-resource-fail.rs @@ -12,7 +12,7 @@ struct r { i: int, - drop { die!(~"squirrel") } + drop { fail!(~"squirrel") } } fn r(i: int) -> r { r { i: i } } diff --git a/src/test/run-fail/unwind-resource-fail2.rs b/src/test/run-fail/unwind-resource-fail2.rs index 69575e6e13a..9c2c1a24a5e 100644 --- a/src/test/run-fail/unwind-resource-fail2.rs +++ b/src/test/run-fail/unwind-resource-fail2.rs @@ -13,7 +13,7 @@ struct r { i: int, - drop { die!(~"wombat") } + drop { fail!(~"wombat") } } fn r(i: int) -> r { r { i: i } } @@ -21,5 +21,5 @@ fn r(i: int) -> r { r { i: i } } fn main() { @0; let r = move r(0); - die!(); + fail!(); } diff --git a/src/test/run-fail/unwind-resource-fail3.rs b/src/test/run-fail/unwind-resource-fail3.rs index 10adfdf1fa3..514c780da09 100644 --- a/src/test/run-fail/unwind-resource-fail3.rs +++ b/src/test/run-fail/unwind-resource-fail3.rs @@ -19,7 +19,7 @@ fn faily_box(i: @int) -> faily_box { faily_box { i: i } } impl faily_box : Drop { fn finalize(&self) { - die!(~"quux"); + fail!(~"quux"); } } diff --git a/src/test/run-fail/unwind-stacked.rs b/src/test/run-fail/unwind-stacked.rs index 42a4a7e376d..a8faa550c8f 100644 --- a/src/test/run-fail/unwind-stacked.rs +++ b/src/test/run-fail/unwind-stacked.rs @@ -12,7 +12,7 @@ fn f() { let a = @0; - die!(); + fail!(); } fn g() { diff --git a/src/test/run-fail/unwind-tup.rs b/src/test/run-fail/unwind-tup.rs index 6cd234ae770..b135b9f609b 100644 --- a/src/test/run-fail/unwind-tup.rs +++ b/src/test/run-fail/unwind-tup.rs @@ -11,7 +11,7 @@ // error-pattern:fail fn fold_local() -> @~[int]{ - die!(); + fail!(); } fn main() { diff --git a/src/test/run-fail/unwind-tup2.rs b/src/test/run-fail/unwind-tup2.rs index 83ed7efcd44..5e299c52a29 100644 --- a/src/test/run-fail/unwind-tup2.rs +++ b/src/test/run-fail/unwind-tup2.rs @@ -15,7 +15,7 @@ fn fold_local() -> @~[int]{ } fn fold_remote() -> @~[int]{ - die!(); + fail!(); } fn main() { diff --git a/src/test/run-fail/unwind-uninitialized.rs b/src/test/run-fail/unwind-uninitialized.rs index 56321e33829..e45c5c94ed4 100644 --- a/src/test/run-fail/unwind-uninitialized.rs +++ b/src/test/run-fail/unwind-uninitialized.rs @@ -11,7 +11,7 @@ // error-pattern:fail fn f() { - die!(); + fail!(); } fn main() { diff --git a/src/test/run-fail/unwind-unique.rs b/src/test/run-fail/unwind-unique.rs index e9de0c4520a..53b2a55602c 100644 --- a/src/test/run-fail/unwind-unique.rs +++ b/src/test/run-fail/unwind-unique.rs @@ -11,7 +11,7 @@ // error-pattern:fail fn failfn() { - die!(); + fail!(); } fn main() { diff --git a/src/test/run-fail/while-body-fails.rs b/src/test/run-fail/while-body-fails.rs index de483d6dc47..73718b0d0b6 100644 --- a/src/test/run-fail/while-body-fails.rs +++ b/src/test/run-fail/while-body-fails.rs @@ -9,4 +9,4 @@ // except according to those terms. // error-pattern:quux -fn main() { let x: int = { while true { die!(~"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 951737aa9b2..22cbf215e9e 100644 --- a/src/test/run-fail/while-fail.rs +++ b/src/test/run-fail/while-fail.rs @@ -10,5 +10,5 @@ // error-pattern:giraffe fn main() { - die!({ while true { die!(~"giraffe")}; ~"clandestine" }); + fail!({ while true { fail!(~"giraffe")}; ~"clandestine" }); } diff --git a/src/test/run-fail/zip-different-lengths.rs b/src/test/run-fail/zip-different-lengths.rs index 2a27be56bec..b50836beaa2 100644 --- a/src/test/run-fail/zip-different-lengths.rs +++ b/src/test/run-fail/zip-different-lengths.rs @@ -37,5 +37,5 @@ fn main() { assert same_length(chars, ints); let ps = zip(chars, ints); - die!(~"the impossible happened"); + fail!(~"the impossible happened"); } diff --git a/src/test/run-pass/alt-bot-2.rs b/src/test/run-pass/alt-bot-2.rs index 2ca1881417e..ba897bd92c0 100644 --- a/src/test/run-pass/alt-bot-2.rs +++ b/src/test/run-pass/alt-bot-2.rs @@ -9,5 +9,5 @@ // except according to those terms. // n.b. This was only ever failing with optimization disabled. -fn a() -> int { match return 1 { 2 => 3, _ => die!() } } +fn a() -> int { match return 1 { 2 => 3, _ => fail!() } } pub fn main() { a(); } diff --git a/src/test/run-pass/alt-bot.rs b/src/test/run-pass/alt-bot.rs index cb30c5e96a0..d4887c4415e 100644 --- a/src/test/run-pass/alt-bot.rs +++ b/src/test/run-pass/alt-bot.rs @@ -11,6 +11,6 @@ pub fn main() { let i: int = - match Some::(3) { None:: => { die!() } Some::(_) => { 5 } }; + match Some::(3) { None:: => { fail!() } Some::(_) => { 5 } }; log(debug, i); } diff --git a/src/test/run-pass/alt-pattern-drop.rs b/src/test/run-pass/alt-pattern-drop.rs index 53ec6e0ed85..647be966df4 100644 --- a/src/test/run-pass/alt-pattern-drop.rs +++ b/src/test/run-pass/alt-pattern-drop.rs @@ -22,7 +22,7 @@ fn foo(s: @int) { log(debug, y); // ref up then down } - _ => { debug!("?"); die!(); } + _ => { debug!("?"); fail!(); } } log(debug, ::core::sys::refcount(s)); assert (::core::sys::refcount(s) == count + 1u); diff --git a/src/test/run-pass/alt-pattern-lit.rs b/src/test/run-pass/alt-pattern-lit.rs index 91e2643dd75..22512a47fe0 100644 --- a/src/test/run-pass/alt-pattern-lit.rs +++ b/src/test/run-pass/alt-pattern-lit.rs @@ -14,7 +14,7 @@ fn altlit(f: int) -> int { match f { 10 => { debug!("case 10"); return 20; } 11 => { debug!("case 11"); return 22; } - _ => die!(~"the impossible happened") + _ => fail!(~"the impossible happened") } } diff --git a/src/test/run-pass/alt-range.rs b/src/test/run-pass/alt-range.rs index b4e40a7b7ab..b3634b498b1 100644 --- a/src/test/run-pass/alt-range.rs +++ b/src/test/run-pass/alt-range.rs @@ -11,31 +11,31 @@ pub fn main() { match 5u { 1u..5u => {} - _ => die!(~"should match range"), + _ => fail!(~"should match range"), } match 5u { - 6u..7u => die!(~"shouldn't match range"), + 6u..7u => fail!(~"shouldn't match range"), _ => {} } match 5u { - 1u => die!(~"should match non-first range"), + 1u => fail!(~"should match non-first range"), 2u..6u => {} - _ => die!(~"math is broken") + _ => fail!(~"math is broken") } match 'c' { 'a'..'z' => {} - _ => die!(~"should suppport char ranges") + _ => fail!(~"should suppport char ranges") } match -3 { -7..5 => {} - _ => die!(~"should match signed range") + _ => fail!(~"should match signed range") } match 3.0 { 1.0..5.0 => {} - _ => die!(~"should match float range") + _ => fail!(~"should match float range") } match -1.5 { -3.6..3.6 => {} - _ => die!(~"should match negative float range") + _ => fail!(~"should match negative float range") } } diff --git a/src/test/run-pass/alt-ref-binding-in-guard-3256.rs b/src/test/run-pass/alt-ref-binding-in-guard-3256.rs index 407d496236f..a04d8d4618a 100644 --- a/src/test/run-pass/alt-ref-binding-in-guard-3256.rs +++ b/src/test/run-pass/alt-ref-binding-in-guard-3256.rs @@ -14,6 +14,6 @@ pub fn main() { Some(ref z) if z.with(|b| *b) => { do z.with |b| { assert *b; } }, - _ => die!() + _ => fail!() } } diff --git a/src/test/run-pass/alt-str.rs b/src/test/run-pass/alt-str.rs index 57e47854ce8..d98dc11801e 100644 --- a/src/test/run-pass/alt-str.rs +++ b/src/test/run-pass/alt-str.rs @@ -11,21 +11,21 @@ // Issue #53 pub fn main() { - match ~"test" { ~"not-test" => die!(), ~"test" => (), _ => die!() } + match ~"test" { ~"not-test" => fail!(), ~"test" => (), _ => fail!() } enum t { tag1(~str), tag2, } match tag1(~"test") { - tag2 => die!(), - tag1(~"not-test") => die!(), + tag2 => fail!(), + tag1(~"not-test") => fail!(), tag1(~"test") => (), - _ => die!() + _ => fail!() } - let x = match ~"a" { ~"a" => 1, ~"b" => 2, _ => die!() }; + let x = match ~"a" { ~"a" => 1, ~"b" => 2, _ => fail!() }; assert (x == 1); - match ~"a" { ~"a" => { } ~"b" => { }, _ => die!() } + match ~"a" { ~"a" => { } ~"b" => { }, _ => fail!() } } diff --git a/src/test/run-pass/attr-main-2.rs b/src/test/run-pass/attr-main-2.rs index b343799e00a..741f7006633 100644 --- a/src/test/run-pass/attr-main-2.rs +++ b/src/test/run-pass/attr-main-2.rs @@ -11,7 +11,7 @@ // xfail-fast pub fn main() { - die!() + fail!() } #[main] diff --git a/src/test/run-pass/binary-minus-without-space.rs b/src/test/run-pass/binary-minus-without-space.rs index 5a7ac1042d3..b7fa7915aa5 100644 --- a/src/test/run-pass/binary-minus-without-space.rs +++ b/src/test/run-pass/binary-minus-without-space.rs @@ -11,6 +11,6 @@ // Check that issue #954 stays fixed pub fn main() { - match -1 { -1 => {}, _ => die!(~"wat") } + match -1 { -1 => {}, _ => fail!(~"wat") } assert 1-1 == 0; } diff --git a/src/test/run-pass/bind-by-move.rs b/src/test/run-pass/bind-by-move.rs index 4c30d1e00d9..bdcc6295664 100644 --- a/src/test/run-pass/bind-by-move.rs +++ b/src/test/run-pass/bind-by-move.rs @@ -19,6 +19,6 @@ pub fn main() { let x = Some(p); match move x { Some(move z) => { dispose(z); }, - None => die!() + None => fail!() } } diff --git a/src/test/run-pass/block-arg.rs b/src/test/run-pass/block-arg.rs index e9c2eec510a..d85a51997e1 100644 --- a/src/test/run-pass/block-arg.rs +++ b/src/test/run-pass/block-arg.rs @@ -35,14 +35,14 @@ pub fn main() { assert false; } match do vec::all(v) |e| { float::is_negative(*e) } { - true => { die!(~"incorrect answer."); } + true => { fail!(~"incorrect answer."); } false => { } } match 3 { _ if do vec::any(v) |e| { float::is_negative(*e) } => { } _ => { - die!(~"wrong answer."); + fail!(~"wrong answer."); } } diff --git a/src/test/run-pass/boxed-class-type-substitution.rs b/src/test/run-pass/boxed-class-type-substitution.rs index 9e6af13dca2..4fe553ec039 100644 --- a/src/test/run-pass/boxed-class-type-substitution.rs +++ b/src/test/run-pass/boxed-class-type-substitution.rs @@ -15,7 +15,7 @@ type Tree = { mut parent: Option, }; -fn empty() -> Tree { die!() } +fn empty() -> Tree { fail!() } struct Box { tree: Tree<@Box> 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 a0230d02981..347f44b2afa 100644 --- a/src/test/run-pass/class-impl-very-parameterized-trait.rs +++ b/src/test/run-pass/class-impl-very-parameterized-trait.rs @@ -108,7 +108,7 @@ impl cat { pure fn get(&self, k: &int) -> &self/T { match self.find(k) { Some(v) => { v } - None => { die!(~"epic fail"); } + None => { fail!(~"epic fail"); } } } diff --git a/src/test/run-pass/cleanup-copy-mode.rs b/src/test/run-pass/cleanup-copy-mode.rs index c7c42c7fcac..74dc2e3a0cf 100644 --- a/src/test/run-pass/cleanup-copy-mode.rs +++ b/src/test/run-pass/cleanup-copy-mode.rs @@ -10,7 +10,7 @@ // xfail-win32 fn adder(+x: @int, +y: @int) -> int { return *x + *y; } -fn failer() -> @int { die!(); } +fn failer() -> @int { fail!(); } pub fn main() { assert(result::is_err(&task::try(|| { adder(@2, failer()); () diff --git a/src/test/run-pass/conditional-compile.rs b/src/test/run-pass/conditional-compile.rs index 33b5d275a45..1c2da8ff3ec 100644 --- a/src/test/run-pass/conditional-compile.rs +++ b/src/test/run-pass/conditional-compile.rs @@ -81,7 +81,7 @@ mod m { // Since the bogus configuration isn't defined main will just be // parsed, but nothing further will be done with it #[cfg(bogus)] -pub fn main() { die!() } +pub fn main() { fail!() } pub fn main() { // Exercise some of the configured items in ways that wouldn't be possible @@ -95,7 +95,7 @@ pub fn main() { fn test_in_fn_ctxt() { #[cfg(bogus)] - fn f() { die!() } + fn f() { fail!() } fn f() { } f(); diff --git a/src/test/run-pass/const-big-enum.rs b/src/test/run-pass/const-big-enum.rs index 1a41efd41d1..6e75758ff77 100644 --- a/src/test/run-pass/const-big-enum.rs +++ b/src/test/run-pass/const-big-enum.rs @@ -19,18 +19,18 @@ const X: Foo = Baz; pub fn main() { match X { Baz => {} - _ => die!() + _ => fail!() } match Y { Bar(s) => assert(s == 2654435769), - _ => die!() + _ => fail!() } match Z { Quux(d,h) => { assert(d == 0x123456789abcdef0); assert(h == 0x1234); } - _ => die!() + _ => fail!() } } diff --git a/src/test/run-pass/const-enum-byref-self.rs b/src/test/run-pass/const-enum-byref-self.rs index 6751a0787e4..19311cb1732 100644 --- a/src/test/run-pass/const-enum-byref-self.rs +++ b/src/test/run-pass/const-enum-byref-self.rs @@ -15,7 +15,7 @@ impl E { fn method(&self) { match *self { V => {} - VV(*) => die!() + VV(*) => fail!() } } } diff --git a/src/test/run-pass/const-enum-byref.rs b/src/test/run-pass/const-enum-byref.rs index f3ea9e08343..a8d24dc300a 100644 --- a/src/test/run-pass/const-enum-byref.rs +++ b/src/test/run-pass/const-enum-byref.rs @@ -14,7 +14,7 @@ const C: E = V; fn f(a: &E) { match *a { V => {} - VV(*) => die!() + VV(*) => fail!() } } diff --git a/src/test/run-pass/const-enum-ptr.rs b/src/test/run-pass/const-enum-ptr.rs index 6ca27fb58b0..92b74902efb 100644 --- a/src/test/run-pass/const-enum-ptr.rs +++ b/src/test/run-pass/const-enum-ptr.rs @@ -14,6 +14,6 @@ const C: &static/E = &V0; fn main() { match *C { V0 => (), - _ => die!() + _ => fail!() } } diff --git a/src/test/run-pass/const-enum-vec-index.rs b/src/test/run-pass/const-enum-vec-index.rs index b386bbf7f5e..ed9075f4932 100644 --- a/src/test/run-pass/const-enum-vec-index.rs +++ b/src/test/run-pass/const-enum-vec-index.rs @@ -16,10 +16,10 @@ const C1: E = C[1]; fn main() { match C0 { V0 => (), - _ => die!() + _ => fail!() } match C1 { V1(n) => assert(n == 0xDEADBEE), - _ => die!() + _ => fail!() } } diff --git a/src/test/run-pass/const-enum-vec-ptr.rs b/src/test/run-pass/const-enum-vec-ptr.rs index a7b03738480..60023889305 100644 --- a/src/test/run-pass/const-enum-vec-ptr.rs +++ b/src/test/run-pass/const-enum-vec-ptr.rs @@ -14,10 +14,10 @@ const C: &static/[E] = &[V0, V1(0xDEADBEE), V0]; fn main() { match C[1] { V1(n) => assert(n == 0xDEADBEE), - _ => die!() + _ => fail!() } match C[2] { V0 => (), - _ => die!() + _ => fail!() } } diff --git a/src/test/run-pass/const-enum-vector.rs b/src/test/run-pass/const-enum-vector.rs index 4925d6c0f07..b95c42fc493 100644 --- a/src/test/run-pass/const-enum-vector.rs +++ b/src/test/run-pass/const-enum-vector.rs @@ -14,10 +14,10 @@ const C: [E * 3] = [V0, V1(0xDEADBEE), V0]; fn main() { match C[1] { V1(n) => assert(n == 0xDEADBEE), - _ => die!() + _ => fail!() } match C[2] { V0 => (), - _ => die!() + _ => fail!() } } diff --git a/src/test/run-pass/const-nullary-enum.rs b/src/test/run-pass/const-nullary-enum.rs index 5a266e4c15a..cbc862185a8 100644 --- a/src/test/run-pass/const-nullary-enum.rs +++ b/src/test/run-pass/const-nullary-enum.rs @@ -19,11 +19,11 @@ const X: Foo = Bar; pub fn main() { match X { Bar => {} - Baz | Boo => die!() + Baz | Boo => fail!() } match Y { Baz => {} - Bar | Boo => die!() + Bar | Boo => fail!() } } diff --git a/src/test/run-pass/die-macro.rs b/src/test/run-pass/die-macro.rs index 1174cb5df92..c4f5e2640ee 100644 --- a/src/test/run-pass/die-macro.rs +++ b/src/test/run-pass/die-macro.rs @@ -1,9 +1,9 @@ -// Just testing that die!() type checks in statement or expr +// Just testing that fail!() type checks in statement or expr fn f() { - die!(); + fail!(); - let x: int = die!(); + let x: int = fail!(); } pub fn main() { diff --git a/src/test/run-pass/expr-alt-box.rs b/src/test/run-pass/expr-alt-box.rs index fd1a5ad4969..004d101dd27 100644 --- a/src/test/run-pass/expr-alt-box.rs +++ b/src/test/run-pass/expr-alt-box.rs @@ -15,13 +15,13 @@ // Tests for match as expressions resulting in boxed types fn test_box() { - let res = match true { true => { @100 } _ => die!(~"wat") }; + let res = match true { true => { @100 } _ => fail!(~"wat") }; assert (*res == 100); } fn test_str() { let res = match true { true => { ~"happy" }, - _ => die!(~"not happy at all") }; + _ => fail!(~"not happy at all") }; assert (res == ~"happy"); } diff --git a/src/test/run-pass/expr-alt-fail-all.rs b/src/test/run-pass/expr-alt-fail-all.rs index e806907129f..5234f58578e 100644 --- a/src/test/run-pass/expr-alt-fail-all.rs +++ b/src/test/run-pass/expr-alt-fail-all.rs @@ -17,6 +17,6 @@ pub fn main() { let x = match true { true => { 10 } - false => { match true { true => { die!() } false => { die!() } } } + false => { match true { true => { fail!() } false => { fail!() } } } }; } diff --git a/src/test/run-pass/expr-alt-fail.rs b/src/test/run-pass/expr-alt-fail.rs index f26f1f1e6f7..7838ea70b42 100644 --- a/src/test/run-pass/expr-alt-fail.rs +++ b/src/test/run-pass/expr-alt-fail.rs @@ -9,12 +9,12 @@ // except according to those terms. fn test_simple() { - let r = match true { true => { true } false => { die!() } }; + let r = match true { true => { true } false => { fail!() } }; assert (r == true); } fn test_box() { - let r = match true { true => { ~[10] } false => { die!() } }; + let r = match true { true => { ~[10] } false => { fail!() } }; assert (r[0] == 10); } diff --git a/src/test/run-pass/expr-alt-generic-box1.rs b/src/test/run-pass/expr-alt-generic-box1.rs index ecb2bf91702..81e14b18638 100644 --- a/src/test/run-pass/expr-alt-generic-box1.rs +++ b/src/test/run-pass/expr-alt-generic-box1.rs @@ -15,7 +15,7 @@ type compare = fn@(@T, @T) -> bool; fn test_generic(expected: @T, eq: compare) { - let actual: @T = match true { true => { expected }, _ => die!() }; + let actual: @T = match true { true => { expected }, _ => fail!() }; assert (eq(expected, actual)); } diff --git a/src/test/run-pass/expr-alt-generic-box2.rs b/src/test/run-pass/expr-alt-generic-box2.rs index 6962f4b5e0f..9176e8672b2 100644 --- a/src/test/run-pass/expr-alt-generic-box2.rs +++ b/src/test/run-pass/expr-alt-generic-box2.rs @@ -16,7 +16,7 @@ type compare = fn@(T, T) -> bool; fn test_generic(expected: T, eq: compare) { - let actual: T = match true { true => { expected }, _ => die!(~"wat") }; + let actual: T = match true { true => { expected }, _ => fail!(~"wat") }; assert (eq(expected, actual)); } diff --git a/src/test/run-pass/expr-alt-generic-unique1.rs b/src/test/run-pass/expr-alt-generic-unique1.rs index b0a5af1cd53..36c591da853 100644 --- a/src/test/run-pass/expr-alt-generic-unique1.rs +++ b/src/test/run-pass/expr-alt-generic-unique1.rs @@ -16,7 +16,7 @@ type compare = fn@(~T, ~T) -> bool; fn test_generic(expected: ~T, eq: compare) { let actual: ~T = match true { true => { copy expected }, - _ => die!(~"wat") + _ => fail!(~"wat") }; assert (eq(expected, actual)); } diff --git a/src/test/run-pass/expr-alt-generic-unique2.rs b/src/test/run-pass/expr-alt-generic-unique2.rs index 02bc248fc4f..2a504c2e2bd 100644 --- a/src/test/run-pass/expr-alt-generic-unique2.rs +++ b/src/test/run-pass/expr-alt-generic-unique2.rs @@ -18,7 +18,7 @@ type compare = fn@(T, T) -> bool; fn test_generic(expected: T, eq: compare) { let actual: T = match true { true => copy expected, - _ => die!(~"wat") + _ => fail!(~"wat") }; assert (eq(expected, actual)); } diff --git a/src/test/run-pass/expr-alt-generic.rs b/src/test/run-pass/expr-alt-generic.rs index a3281ba57f1..d631e4eac5e 100644 --- a/src/test/run-pass/expr-alt-generic.rs +++ b/src/test/run-pass/expr-alt-generic.rs @@ -15,7 +15,7 @@ type compare = fn@(T, T) -> bool; fn test_generic(expected: T, eq: compare) { - let actual: T = match true { true => { expected }, _ => die!(~"wat") }; + let actual: T = match true { true => { expected }, _ => fail!(~"wat") }; assert (eq(expected, actual)); } diff --git a/src/test/run-pass/expr-alt-struct.rs b/src/test/run-pass/expr-alt-struct.rs index bcf07586f24..620881d30e3 100644 --- a/src/test/run-pass/expr-alt-struct.rs +++ b/src/test/run-pass/expr-alt-struct.rs @@ -17,7 +17,7 @@ struct R { i: int } fn test_rec() { - let rs = match true { true => R {i: 100}, _ => die!() }; + let rs = match true { true => R {i: 100}, _ => fail!() }; assert (rs.i == 100); } diff --git a/src/test/run-pass/expr-alt-unique.rs b/src/test/run-pass/expr-alt-unique.rs index 1ce8e2d7624..2865da3dd1f 100644 --- a/src/test/run-pass/expr-alt-unique.rs +++ b/src/test/run-pass/expr-alt-unique.rs @@ -15,7 +15,7 @@ // Tests for match as expressions resulting in boxed types fn test_box() { - let res = match true { true => { ~100 }, _ => die!() }; + let res = match true { true => { ~100 }, _ => fail!() }; assert (*res == 100); } diff --git a/src/test/run-pass/expr-if-fail-all.rs b/src/test/run-pass/expr-if-fail-all.rs index a4c5799f445..19a046fd27e 100644 --- a/src/test/run-pass/expr-if-fail-all.rs +++ b/src/test/run-pass/expr-if-fail-all.rs @@ -10,4 +10,4 @@ // 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 { die!() } else { die!() } }; } +pub fn main() { let x = if true { 10 } else { if true { fail!() } else { fail!() } }; } diff --git a/src/test/run-pass/expr-if-fail.rs b/src/test/run-pass/expr-if-fail.rs index 698db97407c..61f118d1840 100644 --- a/src/test/run-pass/expr-if-fail.rs +++ b/src/test/run-pass/expr-if-fail.rs @@ -8,15 +8,15 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -fn test_if_fail() { let x = if false { die!() } else { 10 }; assert (x == 10); } +fn test_if_fail() { let x = if false { fail!() } else { 10 }; assert (x == 10); } fn test_else_fail() { - let x = if true { 10 } else { die!() }; + let x = if true { 10 } else { fail!() }; assert (x == 10); } fn test_elseif_fail() { - let x = if false { 0 } else if false { die!() } else { 10 }; + let x = if false { 0 } else if false { fail!() } else { 10 }; assert (x == 10); } diff --git a/src/test/run-pass/for-loop-fail.rs b/src/test/run-pass/for-loop-fail.rs index 55ffc3d0258..f885d8120e0 100644 --- a/src/test/run-pass/for-loop-fail.rs +++ b/src/test/run-pass/for-loop-fail.rs @@ -8,4 +8,4 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -pub fn main() { let x: ~[int] = ~[]; for x.each |_i| { die!(~"moop"); } } +pub fn main() { let x: ~[int] = ~[]; for x.each |_i| { fail!(~"moop"); } } diff --git a/src/test/run-pass/getopts_ref.rs b/src/test/run-pass/getopts_ref.rs index baed91df020..ad521276046 100644 --- a/src/test/run-pass/getopts_ref.rs +++ b/src/test/run-pass/getopts_ref.rs @@ -21,7 +21,7 @@ pub fn main() { match getopts(args, opts) { result::Ok(ref m) => assert !opt_present(m, "b"), - result::Err(ref f) => die!(fail_str(copy *f)) + result::Err(ref f) => fail!(fail_str(copy *f)) }; } diff --git a/src/test/run-pass/if-bot.rs b/src/test/run-pass/if-bot.rs index c830ff1e3eb..8c6a82b4144 100644 --- a/src/test/run-pass/if-bot.rs +++ b/src/test/run-pass/if-bot.rs @@ -11,6 +11,6 @@ pub fn main() { - let i: int = if false { die!() } else { 5 }; + let i: int = if false { fail!() } else { 5 }; log(debug, i); } diff --git a/src/test/run-pass/if-check.rs b/src/test/run-pass/if-check.rs index b4170fa6acc..5a516ba9861 100644 --- a/src/test/run-pass/if-check.rs +++ b/src/test/run-pass/if-check.rs @@ -18,7 +18,7 @@ fn foo(x: uint) { if even(x) { log(debug, x); } else { - die!(); + fail!(); } } diff --git a/src/test/run-pass/issue-1516.rs b/src/test/run-pass/issue-1516.rs index d36cb993092..b277b880c76 100644 --- a/src/test/run-pass/issue-1516.rs +++ b/src/test/run-pass/issue-1516.rs @@ -9,5 +9,5 @@ // except according to those terms. // xfail-test -pub fn main() { let early_error: fn@(str) -> ! = {|msg| die!() }; } +pub fn main() { let early_error: fn@(str) -> ! = {|msg| fail!() }; } diff --git a/src/test/run-pass/issue-2311-2.rs b/src/test/run-pass/issue-2311-2.rs index 0e974a8e6a8..8e4036b36be 100644 --- a/src/test/run-pass/issue-2311-2.rs +++ b/src/test/run-pass/issue-2311-2.rs @@ -15,7 +15,7 @@ struct foo { impl foo { fn bar>(c: C) -> B { - die!(); + fail!(); } } diff --git a/src/test/run-pass/issue-2312.rs b/src/test/run-pass/issue-2312.rs index f491d5f86fa..12e9157ba24 100644 --- a/src/test/run-pass/issue-2312.rs +++ b/src/test/run-pass/issue-2312.rs @@ -15,7 +15,7 @@ trait clam { } enum foo = int; impl foo { - fn bar>(c: C) -> B { die!(); } + fn bar>(c: C) -> B { fail!(); } } pub fn main() { } diff --git a/src/test/run-pass/issue-2718.rs b/src/test/run-pass/issue-2718.rs index 0827d280cf7..0cae04b60bc 100644 --- a/src/test/run-pass/issue-2718.rs +++ b/src/test/run-pass/issue-2718.rs @@ -53,9 +53,9 @@ pub mod pipes { #[abi = "rust-intrinsic"] mod rusti { - pub fn atomic_xchg(_dst: &mut int, _src: int) -> int { die!(); } - pub fn atomic_xchg_acq(_dst: &mut int, _src: int) -> int { die!(); } - pub fn atomic_xchg_rel(_dst: &mut int, _src: int) -> int { die!(); } + pub fn atomic_xchg(_dst: &mut int, _src: int) -> int { fail!(); } + pub fn atomic_xchg_acq(_dst: &mut int, _src: int) -> int { fail!(); } + pub fn atomic_xchg_rel(_dst: &mut int, _src: int) -> int { fail!(); } } // We should consider moving this to ::core::unsafe, although I @@ -89,7 +89,7 @@ pub mod pipes { // The receiver will eventually clean this up. unsafe { forget(move p); } } - full => { die!(~"duplicate send") } + full => { fail!(~"duplicate send") } blocked => { // The receiver will eventually clean this up. @@ -132,7 +132,7 @@ pub mod pipes { } full => { // This is impossible - die!(~"you dun goofed") + fail!(~"you dun goofed") } terminated => { // I have to clean up, use drop_glue @@ -149,7 +149,7 @@ pub mod pipes { } blocked => { // this shouldn't happen. - die!(~"terminating a blocked packet") + fail!(~"terminating a blocked packet") } terminated | full => { // I have to clean up, use drop_glue @@ -269,7 +269,7 @@ pub mod pingpong { pub fn do_pong(-c: pong) -> (ping, ()) { let packet = ::pipes::recv(move c); if packet.is_none() { - die!(~"sender closed the connection") + fail!(~"sender closed the connection") } (pingpong::liberate_pong(option::unwrap(move packet)), ()) } @@ -284,7 +284,7 @@ pub mod pingpong { pub fn do_ping(-c: ping) -> (pong, ()) { let packet = ::pipes::recv(move c); if packet.is_none() { - die!(~"sender closed the connection") + fail!(~"sender closed the connection") } (pingpong::liberate_ping(option::unwrap(move packet)), ()) } diff --git a/src/test/run-pass/issue-2904.rs b/src/test/run-pass/issue-2904.rs index 25d460656fd..d6804d83d72 100644 --- a/src/test/run-pass/issue-2904.rs +++ b/src/test/run-pass/issue-2904.rs @@ -54,7 +54,7 @@ fn square_from_char(c: char) -> square { ' ' => { empty } _ => { error!("invalid square: %?", c); - die!() + fail!() } } } diff --git a/src/test/run-pass/issue-3168.rs b/src/test/run-pass/issue-3168.rs index a2c181569ce..02b147e65fc 100644 --- a/src/test/run-pass/issue-3168.rs +++ b/src/test/run-pass/issue-3168.rs @@ -17,7 +17,7 @@ pub fn main() { do task::spawn |move p2| { p2.recv(); error!("sibling fails"); - die!(); + fail!(); } let (p3,c3) = pipes::stream(); c.send(move c3); diff --git a/src/test/run-pass/issue-3176.rs b/src/test/run-pass/issue-3176.rs index 911e50a0ed7..b5f2a1d22a6 100644 --- a/src/test/run-pass/issue-3176.rs +++ b/src/test/run-pass/issue-3176.rs @@ -19,7 +19,7 @@ pub fn main() { do task::spawn |move p2| { p2.recv(); error!("sibling fails"); - die!(); + fail!(); } let (p3,c3) = pipes::stream(); c.send(move c3); diff --git a/src/test/run-pass/issue-3895.rs b/src/test/run-pass/issue-3895.rs index e12d2cbae4d..d3820c1e547 100644 --- a/src/test/run-pass/issue-3895.rs +++ b/src/test/run-pass/issue-3895.rs @@ -14,6 +14,6 @@ pub fn main() { match BadChar { _ if true => BadChar, - BadChar | BadSyntax => die!() , + BadChar | BadSyntax => fail!() , }; } diff --git a/src/test/run-pass/issue-4016.rs b/src/test/run-pass/issue-4016.rs index a8204d56f45..515b342faf3 100644 --- a/src/test/run-pass/issue-4016.rs +++ b/src/test/run-pass/issue-4016.rs @@ -21,7 +21,7 @@ trait JD : Deserializable { } fn exec() { let doc = result::unwrap(json::from_str("")); let _v: T = deserialize(&json::Deserializer(move doc)); - die!() + fail!() } pub fn main() {} diff --git a/src/test/run-pass/iter-eachi.rs b/src/test/run-pass/iter-eachi.rs index b96d017eb9e..f0ae9af1d20 100644 --- a/src/test/run-pass/iter-eachi.rs +++ b/src/test/run-pass/iter-eachi.rs @@ -16,7 +16,7 @@ pub fn main() { } assert c == 5u; - for None::.eachi |i, v| { die!(); } + for None::.eachi |i, v| { fail!(); } let mut c = 0u; for Some(1u).eachi |i, v| { diff --git a/src/test/run-pass/last-use-in-block.rs b/src/test/run-pass/last-use-in-block.rs index 77dfbe237e3..9c04ccdcba0 100644 --- a/src/test/run-pass/last-use-in-block.rs +++ b/src/test/run-pass/last-use-in-block.rs @@ -15,7 +15,7 @@ fn lp(s: ~str, f: fn(~str) -> T) -> T { let r = f(s); return (move r); } - die!(); + fail!(); } fn apply(s: ~str, f: fn(~str) -> T) -> T { diff --git a/src/test/run-pass/lots-a-fail.rs b/src/test/run-pass/lots-a-fail.rs index 41c3516bef2..ed9e6e54030 100644 --- a/src/test/run-pass/lots-a-fail.rs +++ b/src/test/run-pass/lots-a-fail.rs @@ -12,7 +12,7 @@ extern mod std; fn die() { - die!(); + fail!(); } fn iloop() { diff --git a/src/test/run-pass/macro-interpolation.rs b/src/test/run-pass/macro-interpolation.rs index 4bb87ab0cca..ad8f7b9cecf 100644 --- a/src/test/run-pass/macro-interpolation.rs +++ b/src/test/run-pass/macro-interpolation.rs @@ -17,7 +17,7 @@ macro_rules! overly_complicated ( Some($pat) => { $res } - _ => { die!(); } + _ => { fail!(); } } }) diff --git a/src/test/run-pass/negative.rs b/src/test/run-pass/negative.rs index 5b80a746260..d92496c4b7b 100644 --- a/src/test/run-pass/negative.rs +++ b/src/test/run-pass/negative.rs @@ -11,6 +11,6 @@ pub fn main() { match -5 { -5 => {} - _ => { die!() } + _ => { fail!() } } } diff --git a/src/test/run-pass/nested-alts.rs b/src/test/run-pass/nested-alts.rs index f3b667209a0..5ba4e1208c8 100644 --- a/src/test/run-pass/nested-alts.rs +++ b/src/test/run-pass/nested-alts.rs @@ -9,7 +9,7 @@ // except according to those terms. -fn baz() -> ! { die!(); } +fn baz() -> ! { fail!(); } fn foo() { match Some::(5) { diff --git a/src/test/run-pass/nested-class.rs b/src/test/run-pass/nested-class.rs index a753ec4b68b..149e346bb47 100644 --- a/src/test/run-pass/nested-class.rs +++ b/src/test/run-pass/nested-class.rs @@ -24,7 +24,7 @@ pub fn main() { } } - // fn b(x:int) -> int { die!(); } + // fn b(x:int) -> int { fail!(); } let z = b(42); assert(z.i == 42); diff --git a/src/test/run-pass/nested-pattern.rs b/src/test/run-pass/nested-pattern.rs index 470aa43d1ad..eee2d18be8e 100644 --- a/src/test/run-pass/nested-pattern.rs +++ b/src/test/run-pass/nested-pattern.rs @@ -16,7 +16,7 @@ enum t { foo(int, uint), bar(int, Option), } fn nested(o: t) { match o { - bar(i, Some::(_)) => { error!("wrong pattern matched"); die!(); } + 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 c4cc1519735..846136c242c 100644 --- a/src/test/run-pass/nested-patterns.rs +++ b/src/test/run-pass/nested-patterns.rs @@ -16,7 +16,7 @@ struct C { mut 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, _} => { die!(); } + A {b, _} => { fail!(); } } let x@B {b, _} = B {a: 10, b: C {mut c: 20}}; x.b.c = 30; diff --git a/src/test/run-pass/option-unwrap.rs b/src/test/run-pass/option-unwrap.rs index 604edc5e447..c0095b52965 100644 --- a/src/test/run-pass/option-unwrap.rs +++ b/src/test/run-pass/option-unwrap.rs @@ -23,7 +23,7 @@ impl dtor : Drop { fn unwrap(+o: Option) -> T { match move o { Some(move v) => move v, - None => die!() + None => fail!() } } diff --git a/src/test/run-pass/parse-fail.rs b/src/test/run-pass/parse-fail.rs index c280bc0dde5..087926e8da5 100644 --- a/src/test/run-pass/parse-fail.rs +++ b/src/test/run-pass/parse-fail.rs @@ -12,6 +12,6 @@ // -*- rust -*- -fn dont_call_me() { die!(); log(debug, 1); } +fn dont_call_me() { fail!(); log(debug, 1); } pub fn main() { } diff --git a/src/test/run-pass/pipe-bank-proto.rs b/src/test/run-pass/pipe-bank-proto.rs index 995ad4e71c0..d79160a41c4 100644 --- a/src/test/run-pass/pipe-bank-proto.rs +++ b/src/test/run-pass/pipe-bank-proto.rs @@ -62,7 +62,7 @@ macro_rules! follow ( $(Some($message($($($x,)+)* next)) => { let $next = move_it!(next); $e })+ - _ => { die!() } + _ => { fail!() } } ); ) @@ -73,7 +73,7 @@ fn client_follow(+bank: bank::client::login) { let bank = client::login(move bank, ~"theincredibleholk", ~"1234"); let bank = switch(move bank, follow! ( ok -> connected { move connected } - invalid -> _next { die!(~"bank closed the connected") } + invalid -> _next { fail!(~"bank closed the connected") } )); let bank = client::deposit(move bank, 100.00); @@ -83,7 +83,7 @@ fn client_follow(+bank: bank::client::login) { io::println(~"Yay! I got money!"); } insufficient_funds -> _next { - die!(~"someone stole my money") + fail!(~"someone stole my money") } )); } @@ -96,8 +96,8 @@ fn bank_client(+bank: bank::client::login) { Some(ok(connected)) => { move_it!(connected) } - Some(invalid(_)) => { die!(~"login unsuccessful") } - None => { die!(~"bank closed the connection") } + Some(invalid(_)) => { fail!(~"login unsuccessful") } + None => { fail!(~"bank closed the connection") } }; let bank = client::deposit(move bank, 100.00); @@ -107,10 +107,10 @@ fn bank_client(+bank: bank::client::login) { io::println(~"Yay! I got money!"); } Some(insufficient_funds(_)) => { - die!(~"someone stole my money") + fail!(~"someone stole my money") } None => { - die!(~"bank closed the connection") + fail!(~"bank closed the connection") } } } diff --git a/src/test/run-pass/pipe-detect-term.rs b/src/test/run-pass/pipe-detect-term.rs index 0bd06909ebb..6831170734d 100644 --- a/src/test/run-pass/pipe-detect-term.rs +++ b/src/test/run-pass/pipe-detect-term.rs @@ -33,7 +33,7 @@ pub fn main() { pipes::spawn_service(oneshot::init, |p| { match try_recv(move p) { - Some(*) => { die!() } + Some(*) => { fail!() } None => { } } }); @@ -48,7 +48,7 @@ fn failtest() { let (c, p) = oneshot::init(); do task::spawn_with(move c) |_c| { - die!(); + fail!(); } error!("%?", recv(move p)); diff --git a/src/test/run-pass/pipe-presentation-examples.rs b/src/test/run-pass/pipe-presentation-examples.rs index b16f02e78de..401c32b67f9 100644 --- a/src/test/run-pass/pipe-presentation-examples.rs +++ b/src/test/run-pass/pipe-presentation-examples.rs @@ -39,7 +39,7 @@ macro_rules! select_if ( let $next = move next; move $e })+ - _ => die!() + _ => fail!() } } else { select_if!( @@ -57,7 +57,7 @@ macro_rules! select_if ( $index:expr, $count:expr, } => { - die!() + fail!() } ) diff --git a/src/test/run-pass/pipe-select.rs b/src/test/run-pass/pipe-select.rs index 362fe3265f6..62765d71398 100644 --- a/src/test/run-pass/pipe-select.rs +++ b/src/test/run-pass/pipe-select.rs @@ -94,7 +94,7 @@ fn test_select2() { match pipes::select2(move ap, move bp) { either::Left(*) => { } - either::Right(*) => { die!() } + either::Right(*) => { fail!() } } stream::client::send(move bc, ~"abc"); @@ -107,7 +107,7 @@ fn test_select2() { stream::client::send(move bc, ~"abc"); match pipes::select2(move ap, move bp) { - either::Left(*) => { die!() } + either::Left(*) => { fail!() } either::Right(*) => { } } diff --git a/src/test/run-pass/region-dependent-addr-of.rs b/src/test/run-pass/region-dependent-addr-of.rs index ab6d9cd58ea..ca6e48d1518 100644 --- a/src/test/run-pass/region-dependent-addr-of.rs +++ b/src/test/run-pass/region-dependent-addr-of.rs @@ -54,21 +54,21 @@ fn get_v5(a: &v/A, i: uint) -> &v/int { fn get_v6_a(a: &v/A, i: uint) -> &v/int { match a.value.v6 { Some(ref v) => &v.f, - None => die!() + None => fail!() } } fn get_v6_b(a: &v/A, i: uint) -> &v/int { match *a { A { value: B { v6: Some(ref v), _ } } => &v.f, - _ => die!() + _ => fail!() } } fn get_v6_c(a: &v/A, i: uint) -> &v/int { match a { &A { value: B { v6: Some(ref v), _ } } => &v.f, - _ => die!() + _ => fail!() } } diff --git a/src/test/run-pass/region-return-interior-of-option.rs b/src/test/run-pass/region-return-interior-of-option.rs index b71707488e8..249b00e6812 100644 --- a/src/test/run-pass/region-return-interior-of-option.rs +++ b/src/test/run-pass/region-return-interior-of-option.rs @@ -11,7 +11,7 @@ fn get(opt: &r/Option) -> &r/T { match *opt { Some(ref v) => v, - None => die!(~"none") + None => fail!(~"none") } } diff --git a/src/test/run-pass/regions-bot.rs b/src/test/run-pass/regions-bot.rs index 3c7a6dcbb85..3be9d72c690 100644 --- a/src/test/run-pass/regions-bot.rs +++ b/src/test/run-pass/regions-bot.rs @@ -10,7 +10,7 @@ // A very limited test of the "bottom" region -fn produce_static() -> &static/T { die!(); } +fn produce_static() -> &static/T { fail!(); } fn foo(x: &T) -> &uint { produce_static() } diff --git a/src/test/run-pass/ret-bang.rs b/src/test/run-pass/ret-bang.rs index 5086e8af50a..167c4c14a1e 100644 --- a/src/test/run-pass/ret-bang.rs +++ b/src/test/run-pass/ret-bang.rs @@ -12,7 +12,7 @@ // -*- rust -*- -fn my_err(s: ~str) -> ! { log(error, s); die!(); } +fn my_err(s: ~str) -> ! { log(error, s); fail!(); } fn okay(i: uint) -> int { if i == 3u { my_err(~"I don't like three"); } else { return 42; } diff --git a/src/test/run-pass/select-macro.rs b/src/test/run-pass/select-macro.rs index 83746c728e8..45df9cfa610 100644 --- a/src/test/run-pass/select-macro.rs +++ b/src/test/run-pass/select-macro.rs @@ -19,7 +19,7 @@ macro_rules! select_if ( $index:expr, $count:expr } => { - die!() + fail!() }; { @@ -40,7 +40,7 @@ macro_rules! select_if ( let $next = move next; move $e })+ - _ => die!() + _ => fail!() } } else { select_if!( diff --git a/src/test/run-pass/send-iloop.rs b/src/test/run-pass/send-iloop.rs index 848eb64235d..f1b9c85a0ff 100644 --- a/src/test/run-pass/send-iloop.rs +++ b/src/test/run-pass/send-iloop.rs @@ -12,7 +12,7 @@ extern mod std; fn die() { - die!(); + fail!(); } fn iloop() { diff --git a/src/test/run-pass/size-and-align.rs b/src/test/run-pass/size-and-align.rs index b94439e6b9d..89ba351e6e4 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) => { debug!("incorrect"); log(debug, u); die!(); } + a::(ref t, ref u) => { debug!("incorrect"); log(debug, u); fail!(); } b:: => { debug!("correct"); } } } diff --git a/src/test/run-pass/stat.rs b/src/test/run-pass/stat.rs index e71444294dc..21d494e0088 100644 --- a/src/test/run-pass/stat.rs +++ b/src/test/run-pass/stat.rs @@ -20,7 +20,7 @@ pub fn main() { { match io::file_writer(&path, [io::Create, io::Truncate]) { - Err(copy e) => die!(e), + Err(copy e) => fail!(e), Ok(f) => { for uint::range(0, 1000) |_i| { f.write_u8(0); diff --git a/src/test/run-pass/task-killjoin-rsrc.rs b/src/test/run-pass/task-killjoin-rsrc.rs index 65cc8e897d6..3af59a09ad0 100644 --- a/src/test/run-pass/task-killjoin-rsrc.rs +++ b/src/test/run-pass/task-killjoin-rsrc.rs @@ -69,7 +69,7 @@ fn supervised() { // runs first, but I can imagine that changing. error!("supervised task=%?", task::get_task); task::yield(); - die!(); + fail!(); } fn supervisor() { diff --git a/src/test/run-pass/task-killjoin.rs b/src/test/run-pass/task-killjoin.rs index 7ab533bd870..563e35be3d6 100644 --- a/src/test/run-pass/task-killjoin.rs +++ b/src/test/run-pass/task-killjoin.rs @@ -20,7 +20,7 @@ fn supervised() { // currently not needed because the supervisor runs first, but I can // imagine that changing. task::yield(); - die!(); + fail!(); } fn supervisor() { diff --git a/src/test/run-pass/terminate-in-initializer.rs b/src/test/run-pass/terminate-in-initializer.rs index 183db464fe2..cb169c3a638 100644 --- a/src/test/run-pass/terminate-in-initializer.rs +++ b/src/test/run-pass/terminate-in-initializer.rs @@ -21,12 +21,12 @@ 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_fail() { - fn f() { let x: @int = die!(); } + fn f() { let x: @int = fail!(); } task::try(|| f() ); } fn test_fail_indirect() { - fn f() -> ! { die!(); } + fn f() -> ! { fail!(); } fn g() { let x: @int = f(); } task::try(|| g() ); } diff --git a/src/test/run-pass/test-runner-hides-main.rs b/src/test/run-pass/test-runner-hides-main.rs index 0c7710585a9..74b63e4dd27 100644 --- a/src/test/run-pass/test-runner-hides-main.rs +++ b/src/test/run-pass/test-runner-hides-main.rs @@ -15,4 +15,4 @@ extern mod std; // Building as a test runner means that a synthetic main will be run, // not ours -pub fn main() { die!(); } +pub fn main() { fail!(); } diff --git a/src/test/run-pass/unique-containing-tag.rs b/src/test/run-pass/unique-containing-tag.rs index 05d57967340..babba058f52 100644 --- a/src/test/run-pass/unique-containing-tag.rs +++ b/src/test/run-pass/unique-containing-tag.rs @@ -17,13 +17,13 @@ pub fn main() { t1(a) { assert a == 10; } - _ { die!(); } + _ { fail!(); } }*/ /*alt x { ~t1(a) { assert a == 10; } - _ { die!(); } + _ { fail!(); } }*/ } diff --git a/src/test/run-pass/unique-decl.rs b/src/test/run-pass/unique-decl.rs index 2bc95754e08..31c1936b05a 100644 --- a/src/test/run-pass/unique-decl.rs +++ b/src/test/run-pass/unique-decl.rs @@ -13,5 +13,5 @@ pub fn main() { } fn f(i: ~int) -> ~int { - die!(); + fail!(); } diff --git a/src/test/run-pass/unique-pat.rs b/src/test/run-pass/unique-pat.rs index 82e3f6c9486..0b9ad6ee194 100644 --- a/src/test/run-pass/unique-pat.rs +++ b/src/test/run-pass/unique-pat.rs @@ -11,7 +11,7 @@ fn simple() { match ~true { ~true => { } - _ => { die!(); } + _ => { fail!(); } } } diff --git a/src/test/run-pass/unreachable-code-1.rs b/src/test/run-pass/unreachable-code-1.rs index 54cd961dbf6..8e900aa7ff3 100644 --- a/src/test/run-pass/unreachable-code-1.rs +++ b/src/test/run-pass/unreachable-code-1.rs @@ -12,7 +12,7 @@ fn id(x: bool) -> bool { x } fn call_id() { - let c = move die!(); + let c = move fail!(); id(c); //~ WARNING unreachable statement } diff --git a/src/test/run-pass/unreachable-code.rs b/src/test/run-pass/unreachable-code.rs index 5c046ff0d16..75b2bf090ba 100644 --- a/src/test/run-pass/unreachable-code.rs +++ b/src/test/run-pass/unreachable-code.rs @@ -12,7 +12,7 @@ fn id(x: bool) -> bool { x } fn call_id() { - let c = move die!(); + let c = move fail!(); id(c); } @@ -20,7 +20,7 @@ fn call_id_2() { id(true) && id(return); } fn call_id_3() { id(return) && id(return); } -fn log_fail() { log(error, die!()); } +fn log_fail() { log(error, fail!()); } fn log_ret() { log(error, return); } diff --git a/src/test/run-pass/unwind-box.rs b/src/test/run-pass/unwind-box.rs index 80bdc9adf41..90e8d41d26a 100644 --- a/src/test/run-pass/unwind-box.rs +++ b/src/test/run-pass/unwind-box.rs @@ -13,7 +13,7 @@ extern mod std; fn f() { let a = @0; - die!(); + fail!(); } pub fn main() { diff --git a/src/test/run-pass/unwind-resource.rs b/src/test/run-pass/unwind-resource.rs index 5e885f781e2..fbe0e4711e1 100644 --- a/src/test/run-pass/unwind-resource.rs +++ b/src/test/run-pass/unwind-resource.rs @@ -34,7 +34,7 @@ fn complainer(c: SharedChan) -> complainer { fn f(c: SharedChan) { let _c = move complainer(c); - die!(); + fail!(); } pub fn main() { diff --git a/src/test/run-pass/unwind-resource2.rs b/src/test/run-pass/unwind-resource2.rs index 52a64863e72..55b286aee7e 100644 --- a/src/test/run-pass/unwind-resource2.rs +++ b/src/test/run-pass/unwind-resource2.rs @@ -27,7 +27,7 @@ fn complainer(c: @int) -> complainer { fn f() { let c = move complainer(@0); - die!(); + fail!(); } pub fn main() { diff --git a/src/test/run-pass/unwind-unique.rs b/src/test/run-pass/unwind-unique.rs index 5edf4de3be3..8b0850cff77 100644 --- a/src/test/run-pass/unwind-unique.rs +++ b/src/test/run-pass/unwind-unique.rs @@ -13,7 +13,7 @@ extern mod std; fn f() { let a = ~0; - die!(); + fail!(); } pub fn main() { diff --git a/src/test/run-pass/use-uninit-alt2.rs b/src/test/run-pass/use-uninit-alt2.rs index af0c796ca27..37ba2260a08 100644 --- a/src/test/run-pass/use-uninit-alt2.rs +++ b/src/test/run-pass/use-uninit-alt2.rs @@ -12,7 +12,7 @@ fn foo(o: myoption) -> int { let mut x: int; - match o { none:: => { die!(); } some::(t) => { x = 5; } } + match o { none:: => { fail!(); } some::(t) => { x = 5; } } return x; } diff --git a/src/test/run-pass/weird-exprs.rs b/src/test/run-pass/weird-exprs.rs index 5ade8825289..28a5a5ca47b 100644 --- a/src/test/run-pass/weird-exprs.rs +++ b/src/test/run-pass/weird-exprs.rs @@ -69,7 +69,7 @@ fn canttouchthis() -> uint { fn angrydome() { loop { if break { } } let mut i = 0; - loop { i += 1; if i == 1 { match (loop) { 1 => { }, _ => die!(~"wat") } } + loop { i += 1; if i == 1 { match (loop) { 1 => { }, _ => fail!(~"wat") } } break; } }