From b48e37e8eecafe3cfc72062a9369aae245063e19 Mon Sep 17 00:00:00 2001 From: Huon Wilson Date: Tue, 16 Jul 2013 15:05:50 +1000 Subject: [PATCH 1/4] syntax: make a macros-injection pass; conditionally define debug! to a noop based on cfg(debug). Macros can be conditionally defined because stripping occurs before macro expansion, but, the built-in macros were only added as part of the actual expansion process and so couldn't be stripped to have definitions conditional on cfg flags. debug! is defined conditionally in terms of the debug config, expanding to nothing unless the --cfg debug flag is passed (to be precise it expands to `if false { normal_debug!(...) }` so that they are still type checked, and to avoid unused variable lints). --- src/librustc/driver/driver.rs | 6 +- src/librustdoc/astsrv.rs | 2 + src/libsyntax/ext/expand.rs | 101 ++++++++++-------- .../run-pass/conditional-debug-macro-off.rs | 17 +++ .../run-pass/conditional-debug-macro-on.rs | 21 ++++ 5 files changed, 104 insertions(+), 43 deletions(-) create mode 100644 src/test/run-pass/conditional-debug-macro-off.rs create mode 100644 src/test/run-pass/conditional-debug-macro-on.rs diff --git a/src/librustc/driver/driver.rs b/src/librustc/driver/driver.rs index e8ef95b811e87..d41c1167c70ce 100644 --- a/src/librustc/driver/driver.rs +++ b/src/librustc/driver/driver.rs @@ -194,6 +194,10 @@ pub fn compile_rest(sess: Session, // mod bar { macro_rules! baz!(() => {{}}) } // // baz! should not use this definition unless foo is enabled. + crate = time(time_passes, ~"std macros injection", || + syntax::ext::expand::inject_std_macros(sess.parse_sess, copy cfg, + crate)); + crate = time(time_passes, ~"configuration 1", || front::config::strip_unconfigured_items(crate)); @@ -214,7 +218,7 @@ pub fn compile_rest(sess: Session, assert!(phases.from != cu_no_trans); let (llcx, llmod, link_meta) = { - crate = time(time_passes, ~"extra injection", || + crate = time(time_passes, ~"std injection", || front::std_inject::maybe_inject_libstd_ref(sess, crate)); let ast_map = time(time_passes, ~"ast indexing", || diff --git a/src/librustdoc/astsrv.rs b/src/librustdoc/astsrv.rs index 9c586ae95d154..559186d316e76 100644 --- a/src/librustdoc/astsrv.rs +++ b/src/librustdoc/astsrv.rs @@ -113,6 +113,8 @@ fn build_ctxt(sess: Session, use rustc::front::config; + let ast = syntax::ext::expand::inject_std_macros(sess.parse_sess, + copy sess.opts.cfg, ast); let ast = config::strip_unconfigured_items(ast); let ast = syntax::ext::expand::expand_crate(sess.parse_sess, copy sess.opts.cfg, ast); diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs index b45cde6a8e342..d63d914edd396 100644 --- a/src/libsyntax/ext/expand.rs +++ b/src/libsyntax/ext/expand.rs @@ -8,15 +8,14 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use ast::{blk_, attribute_, attr_outer, meta_word}; -use ast::{crate, expr_, expr_mac, mac_invoc_tt}; +use ast::{blk_, crate, expr_, expr_mac, mac_invoc_tt}; use ast::{item_mac, stmt_, stmt_mac, stmt_expr, stmt_semi}; use ast::{illegal_ctxt}; use ast; use ast_util::{new_rename, new_mark, resolve}; use attr; use codemap; -use codemap::{span, ExpnInfo, NameAndSpan, spanned}; +use codemap::{span, ExpnInfo, NameAndSpan}; use ext::base::*; use fold::*; use parse; @@ -452,9 +451,11 @@ pub fn new_span(cx: @ExtCtxt, sp: span) -> span { // the default compilation environment. It would be much nicer to use // a mechanism like syntax_quote to ensure hygiene. -pub fn core_macros() -> @str { +pub fn std_macros() -> @str { return -@"pub mod macros { +@"pub mod __std_macros { + #[macro_escape]; + macro_rules! ignore (($($x:tt)*) => (())) macro_rules! error ( @@ -484,7 +485,9 @@ pub fn core_macros() -> @str { ) ) - macro_rules! debug ( + // conditionally define debug!, but keep it type checking even + // in non-debug builds. + macro_rules! __debug ( ($arg:expr) => ( __log(4u32, fmt!( \"%?\", $arg )) ); @@ -493,6 +496,22 @@ pub fn core_macros() -> @str { ) ) + #[cfg(debug)] + #[macro_escape] + mod debug_macro { + macro_rules! debug (($($arg:expr),*) => { + __debug!($($arg),*) + }) + } + + #[cfg(not(debug))] + #[macro_escape] + mod debug_macro { + macro_rules! debug (($($arg:expr),*) => { + if false { __debug!($($arg),*) } + }) + } + macro_rules! fail( () => ( fail!(\"explicit failure\") @@ -668,6 +687,35 @@ pub fn core_macros() -> @str { }"; } +// add a bunch of macros as though they were placed at the head of the +// program (ick). This should run before cfg stripping. +pub fn inject_std_macros(parse_sess: @mut parse::ParseSess, + cfg: ast::crate_cfg, c: &crate) -> @crate { + let sm = match parse_item_from_source_str(@"", + std_macros(), + copy cfg, + ~[], + parse_sess) { + Some(item) => item, + None => fail!("expected core macros to parse correctly") + }; + + let injecter = @AstFoldFns { + fold_mod: |modd, _| { + // just inject the std macros at the start of the first + // module in the crate (i.e the crate file itself.) + let items = vec::append(~[sm], modd.items); + ast::_mod { + items: items, + // FIXME #2543: Bad copy. + .. copy *modd + } + }, + .. *default_ast_fold() + }; + @make_fold(injecter).fold_crate(c) +} + pub fn expand_crate(parse_sess: @mut parse::ParseSess, cfg: ast::crate_cfg, c: &crate) -> @crate { // adding *another* layer of indirection here so that the block @@ -692,33 +740,6 @@ pub fn expand_crate(parse_sess: @mut parse::ParseSess, new_span: |a| new_span(cx, a), .. *afp}; let f = make_fold(f_pre); - // add a bunch of macros as though they were placed at the - // head of the program (ick). - let attrs = ~[ - spanned { - span: codemap::dummy_sp(), - node: attribute_ { - style: attr_outer, - value: @spanned { - node: meta_word(@"macro_escape"), - span: codemap::dummy_sp(), - }, - is_sugared_doc: false, - } - } - ]; - - let cm = match parse_item_from_source_str(@"", - core_macros(), - copy cfg, - attrs, - parse_sess) { - Some(item) => item, - None => cx.bug("expected core macros to parse correctly") - }; - // This is run for its side-effects on the expander env, - // as it registers all the core macros as expanders. - f.fold_item(cm); @f.fold_crate(c) } @@ -789,6 +810,8 @@ mod test { @"", src, ~[],sess); + let crate_ast = inject_std_macros(sess, ~[], crate_ast); + // don't bother with striping, doesn't affect fail!. expand_crate(sess,~[],crate_ast); } @@ -836,20 +859,14 @@ mod test { expand_crate(sess,~[],crate_ast); } - #[test] fn core_macros_must_parse () { - let src = @" - pub mod macros { - macro_rules! ignore (($($x:tt)*) => (())) - - macro_rules! error ( ($( $arg:expr ),+) => ( - log(::core::error, fmt!( $($arg),+ )) )) -}"; + #[test] fn std_macros_must_parse () { + let src = super::std_macros(); let sess = parse::new_parse_sess(None); let cfg = ~[]; let item_ast = parse::parse_item_from_source_str( @"", src, - cfg,~[make_dummy_attr (@"macro_escape")],sess); + cfg,~[],sess); match item_ast { Some(_) => (), // success None => fail!("expected this to parse") diff --git a/src/test/run-pass/conditional-debug-macro-off.rs b/src/test/run-pass/conditional-debug-macro-off.rs new file mode 100644 index 0000000000000..f40c8112e0bba --- /dev/null +++ b/src/test/run-pass/conditional-debug-macro-off.rs @@ -0,0 +1,17 @@ +// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// xfail-fast exec-env directive doesn't work for check-fast +// exec-env:RUST_LOG=conditional-debug-macro-off=4 + +fn main() { + // only fails if debug! evaluates its argument. + debug!({ if true { fail!() } }); +} \ No newline at end of file diff --git a/src/test/run-pass/conditional-debug-macro-on.rs b/src/test/run-pass/conditional-debug-macro-on.rs new file mode 100644 index 0000000000000..65b751a58264d --- /dev/null +++ b/src/test/run-pass/conditional-debug-macro-on.rs @@ -0,0 +1,21 @@ +// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// xfail-fast compile-flags directive doesn't work for check-fast +// compile-flags: --cfg debug +// exec-env:RUST_LOG=conditional-debug-macro-on=4 + +fn main() { + // exits early if debug! evaluates its arguments, otherwise it + // will hit the fail. + debug!({ if true { return; } }); + + fail!(); +} \ No newline at end of file From e4f7561bcdf3b54dafefd478b86e1f7610e74348 Mon Sep 17 00:00:00 2001 From: Huon Wilson Date: Wed, 17 Jul 2013 03:08:08 +1000 Subject: [PATCH 2/4] Clean-up tests after debug!/std-macros change. The entire testsuite is converted to using info! rather than debug! because some depend on the code within the debug! being trans'd. --- src/librustdoc/astsrv.rs | 3 +- src/librustdoc/attr_pass.rs | 3 +- src/librustdoc/desc_to_brief_pass.rs | 3 +- src/librustdoc/markdown_index_pass.rs | 25 +- src/librustdoc/markdown_pass.rs | 3 + src/librustdoc/markdown_writer.rs | 3 +- src/librustdoc/page_pass.rs | 5 + src/librustdoc/path_pass.rs | 12 +- src/librustdoc/sectionalize_pass.rs | 2 + src/librustdoc/sort_item_name_pass.rs | 5 +- src/librustdoc/sort_item_type_pass.rs | 4 +- src/librustdoc/sort_pass.rs | 18 +- src/librustdoc/trim_pass.rs | 2 + src/libsyntax/ext/expand.rs | 3 +- .../auxiliary/extern-crosscrate-source.rs | 2 +- src/test/bench/core-uint-to-str.rs | 2 +- src/test/bench/msgsend-pipes-shared.rs | 2 +- src/test/bench/msgsend-pipes.rs | 2 +- src/test/bench/shootout-threadring.rs | 2 +- src/test/bench/task-perf-alloc-unwind.rs | 6 +- .../compile-fail/assign-imm-local-twice.rs | 4 +- src/test/compile-fail/assign-to-method.rs | 2 +- src/test/compile-fail/attr-before-ext.rs | 2 +- src/test/compile-fail/autoderef-full-lval.rs | 4 +- src/test/compile-fail/bad-const-type.rs | 2 +- .../block-arg-as-stmt-with-value.rs | 2 +- src/test/compile-fail/bogus-tag.rs | 4 +- .../compile-fail/borrowck-assign-comp-idx.rs | 2 +- .../borrowck-loan-blocks-move-cc.rs | 4 +- .../borrowck-move-out-of-vec-tail.rs | 2 +- .../borrowck-mut-addr-of-imm-var.rs | 2 +- src/test/compile-fail/dead-code-ret.rs | 2 +- src/test/compile-fail/does-nothing.rs | 2 +- src/test/compile-fail/export2.rs | 2 +- .../compile-fail/if-without-else-result.rs | 2 +- src/test/compile-fail/import-glob-0.rs | 8 +- src/test/compile-fail/import-glob-circular.rs | 4 +- src/test/compile-fail/import.rs | 2 +- src/test/compile-fail/import2.rs | 2 +- src/test/compile-fail/import3.rs | 2 +- src/test/compile-fail/import4.rs | 2 +- src/test/compile-fail/issue-1448-2.rs | 2 +- src/test/compile-fail/issue-2281-part1.rs | 2 +- src/test/compile-fail/issue-3038.rs | 2 +- src/test/compile-fail/liveness-and-init.rs | 4 +- src/test/compile-fail/liveness-bad-bang-2.rs | 2 +- src/test/compile-fail/liveness-block-unint.rs | 2 +- .../compile-fail/liveness-break-uninit-2.rs | 4 +- .../compile-fail/liveness-break-uninit.rs | 4 +- .../liveness-closure-require-ret.rs | 2 +- src/test/compile-fail/liveness-if-no-else.rs | 2 +- .../compile-fail/liveness-if-with-else.rs | 4 +- .../compile-fail/liveness-move-in-loop.rs | 2 +- .../compile-fail/liveness-move-in-while.rs | 2 +- src/test/compile-fail/liveness-or-init.rs | 4 +- src/test/compile-fail/liveness-uninit.rs | 2 +- .../compile-fail/liveness-use-after-move.rs | 2 +- .../compile-fail/liveness-use-after-send.rs | 6 +- src/test/compile-fail/liveness-while-break.rs | 2 +- src/test/compile-fail/match-join.rs | 2 +- src/test/compile-fail/nonscalar-cast.rs | 2 +- src/test/compile-fail/oversized-literal.rs | 2 +- .../packed-struct-generic-transmute.rs | 2 +- .../compile-fail/packed-struct-transmute.rs | 2 +- src/test/compile-fail/pattern-tyvar.rs | 2 +- src/test/compile-fail/pinned-deep-copy.rs | 2 +- src/test/compile-fail/regions-addr-of-self.rs | 2 +- src/test/compile-fail/regions-freevar.rs | 2 +- .../compile-fail/regions-ret-borrowed-1.rs | 2 +- src/test/compile-fail/regions-ret-borrowed.rs | 2 +- .../compile-fail/sendfn-is-not-a-lambda.rs | 2 +- src/test/compile-fail/unique-pinned-nocopy.rs | 2 +- src/test/compile-fail/unique-vec-res.rs | 4 +- src/test/compile-fail/unsupported-cast.rs | 2 +- src/test/compile-fail/vec-field.rs | 2 +- src/test/compile-fail/vec-res-add.rs | 2 +- src/test/pretty/block-arg-disambig.rs | 2 +- src/test/run-fail/extern-fail.rs | 2 +- src/test/run-fail/fail-arg.rs | 2 +- src/test/run-fail/if-check-fail.rs | 2 +- src/test/run-pass/alignment-gep-tup-like-1.rs | 2 +- src/test/run-pass/alignment-gep-tup-like-2.rs | 2 +- src/test/run-pass/arith-0.rs | 2 +- src/test/run-pass/arith-1.rs | 2 +- src/test/run-pass/auto-instantiate.rs | 4 +- src/test/run-pass/bitwise.rs | 4 +- .../borrowck-preserve-box-in-discr.rs | 2 +- .../borrowck-preserve-box-in-field.rs | 2 +- .../run-pass/borrowck-preserve-box-in-pat.rs | 2 +- .../run-pass/borrowck-preserve-box-in-uniq.rs | 2 +- src/test/run-pass/borrowck-preserve-box.rs | 2 +- .../run-pass/borrowck-preserve-cond-box.rs | 4 +- .../run-pass/borrowck-preserve-expl-deref.rs | 2 +- src/test/run-pass/box-unbox.rs | 2 +- src/test/run-pass/cast-region-to-uint.rs | 2 +- src/test/run-pass/cci_borrow.rs | 2 +- src/test/run-pass/cci_impl_exe.rs | 4 +- src/test/run-pass/cci_iter_exe.rs | 2 +- src/test/run-pass/cci_no_inline_exe.rs | 4 +- .../class-cast-to-trait-cross-crate-2.rs | 2 +- .../class-cast-to-trait-multiple-types.rs | 6 +- .../class-implements-multiple-traits.rs | 10 +- src/test/run-pass/class-separate-impl.rs | 2 +- .../close-over-big-then-small-data.rs | 2 +- src/test/run-pass/complex.rs | 6 +- src/test/run-pass/const.rs | 2 +- src/test/run-pass/core-rt-smoke.rs | 2 +- src/test/run-pass/dead-code-one-arm-if.rs | 2 +- src/test/run-pass/deref-lval.rs | 2 +- src/test/run-pass/estr-slice.rs | 12 +- src/test/run-pass/evec-slice.rs | 8 +- src/test/run-pass/export-non-interference2.rs | 2 +- src/test/run-pass/export-non-interference3.rs | 2 +- src/test/run-pass/expr-block-generic-box1.rs | 4 +- .../run-pass/expr-block-generic-unique1.rs | 4 +- src/test/run-pass/extern-call-deep.rs | 4 +- src/test/run-pass/extern-call-deep2.rs | 4 +- src/test/run-pass/extern-call-scrub.rs | 4 +- src/test/run-pass/extern-call.rs | 4 +- src/test/run-pass/extern-crosscrate.rs | 4 +- src/test/run-pass/extern-yield.rs | 2 +- src/test/run-pass/fact.rs | 14 +- src/test/run-pass/float-signature.rs | 2 +- src/test/run-pass/float.rs | 4 +- src/test/run-pass/fn-bare-item.rs | 2 +- src/test/run-pass/foreach-put-structured.rs | 4 +- .../run-pass/foreach-simple-outer-slot.rs | 8 +- src/test/run-pass/generic-alias-box.rs | 2 +- src/test/run-pass/generic-alias-unique.rs | 2 +- src/test/run-pass/generic-derived-type.rs | 4 +- src/test/run-pass/generic-fn-box.rs | 2 +- src/test/run-pass/generic-fn-unique.rs | 2 +- src/test/run-pass/generic-fn.rs | 6 +- src/test/run-pass/generic-tag-match.rs | 2 +- src/test/run-pass/generic-tag-values.rs | 6 +- src/test/run-pass/generic-temporary.rs | 2 +- src/test/run-pass/generic-tup.rs | 2 +- src/test/run-pass/if-bot.rs | 2 +- src/test/run-pass/if-check.rs | 2 +- src/test/run-pass/import-glob-0.rs | 12 +- src/test/run-pass/import.rs | 2 +- src/test/run-pass/import2.rs | 2 +- src/test/run-pass/import3.rs | 2 +- src/test/run-pass/import4.rs | 2 +- src/test/run-pass/import5.rs | 2 +- src/test/run-pass/import6.rs | 2 +- src/test/run-pass/import7.rs | 2 +- src/test/run-pass/import8.rs | 2 +- src/test/run-pass/inner-module.rs | 2 +- src/test/run-pass/integral-indexing.rs | 4 +- src/test/run-pass/issue-6344-let.rs | 2 +- src/test/run-pass/issue-6344-match.rs | 2 +- src/test/run-pass/istr.rs | 6 +- src/test/run-pass/iter-range.rs | 2 +- src/test/run-pass/lazy-and-or.rs | 2 +- src/test/run-pass/lazy-init.rs | 2 +- src/test/run-pass/linear-for-loop.rs | 8 +- src/test/run-pass/liveness-loop-break.rs | 2 +- src/test/run-pass/log-poly.rs | 2 +- src/test/run-pass/match-bot.rs | 2 +- src/test/run-pass/match-join.rs | 2 +- src/test/run-pass/match-pattern-drop.rs | 12 +- src/test/run-pass/match-pattern-lit.rs | 4 +- src/test/run-pass/match-unique-bind.rs | 2 +- src/test/run-pass/mutable-alias-vec.rs | 2 +- src/test/run-pass/nested-matchs.rs | 4 +- src/test/run-pass/opeq.rs | 8 +- src/test/run-pass/over-constrained-vregs.rs | 2 +- src/test/run-pass/paren-free.rs | 2 +- src/test/run-pass/parse-fail.rs | 2 +- src/test/run-pass/pass-by-copy.rs | 4 +- src/test/run-pass/pipe-select-macro.rs | 4 +- src/test/run-pass/platform_thread.rs | 2 +- src/test/run-pass/preempt.rs | 14 +- src/test/run-pass/pure-fmt.rs | 14 +- src/test/run-pass/rcvr-borrowed-to-region.rs | 8 +- src/test/run-pass/rcvr-borrowed-to-slice.rs | 6 +- src/test/run-pass/rec-align-u32.rs | 6 +- src/test/run-pass/rec-align-u64.rs | 6 +- src/test/run-pass/rec-auto.rs | 4 +- src/test/run-pass/regions-borrow-at.rs | 2 +- src/test/run-pass/regions-self-impls.rs | 2 +- src/test/run-pass/regions-self-in-enums.rs | 2 +- src/test/run-pass/regions-simple.rs | 2 +- src/test/run-pass/regions-static-closure.rs | 2 +- .../run-pass/resource-assign-is-not-copy.rs | 2 +- src/test/run-pass/resource-cycle.rs | 10 +- src/test/run-pass/sendfn-generic-fn.rs | 4 +- src/test/run-pass/shadow.rs | 2 +- src/test/run-pass/simple-infer.rs | 2 +- src/test/run-pass/simple-match-generic-tag.rs | 2 +- src/test/run-pass/size-and-align.rs | 4 +- src/test/run-pass/spawn-fn.rs | 6 +- src/test/run-pass/str-append.rs | 6 +- src/test/run-pass/str-concat.rs | 2 +- src/test/run-pass/str-idx.rs | 2 +- src/test/run-pass/supported-cast.rs | 464 +++++++++--------- src/test/run-pass/syntax-extension-fmt.rs | 4 +- src/test/run-pass/tag-align-shape.rs | 2 +- src/test/run-pass/tail-cps.rs | 8 +- src/test/run-pass/task-comm-1.rs | 4 +- src/test/run-pass/task-comm-12.rs | 4 +- src/test/run-pass/task-comm-13.rs | 4 +- src/test/run-pass/task-comm-14.rs | 8 +- src/test/run-pass/task-comm-3.rs | 12 +- src/test/run-pass/task-comm-4.rs | 16 +- src/test/run-pass/task-comm-9.rs | 2 +- src/test/run-pass/threads.rs | 4 +- src/test/run-pass/use-uninit-match.rs | 2 +- src/test/run-pass/use-uninit-match2.rs | 2 +- src/test/run-pass/utf8.rs | 6 +- src/test/run-pass/vec-concat.rs | 2 +- src/test/run-pass/vec-late-init.rs | 2 +- src/test/run-pass/weird-exprs.rs | 4 +- src/test/run-pass/while-cont.rs | 2 +- src/test/run-pass/while-loop-constraints-2.rs | 2 +- src/test/run-pass/while-with-break.rs | 4 +- src/test/run-pass/while.rs | 6 +- 218 files changed, 640 insertions(+), 613 deletions(-) diff --git a/src/librustdoc/astsrv.rs b/src/librustdoc/astsrv.rs index 559186d316e76..6d7d7911468f3 100644 --- a/src/librustdoc/astsrv.rs +++ b/src/librustdoc/astsrv.rs @@ -140,7 +140,8 @@ fn should_prune_unconfigured_items() { let source = ~"#[cfg(shut_up_and_leave_me_alone)]fn a() { }"; do from_str(source) |srv| { do exec(srv) |ctxt| { - assert!(ctxt.ast.node.module.items.is_empty()); + // one item: the __std_macros secret module + assert_eq!(ctxt.ast.node.module.items.len(), 1); } } } diff --git a/src/librustdoc/attr_pass.rs b/src/librustdoc/attr_pass.rs index 2a9442fbe525b..3c7d509117232 100644 --- a/src/librustdoc/attr_pass.rs +++ b/src/librustdoc/attr_pass.rs @@ -255,7 +255,8 @@ mod test { #[test] fn should_should_extract_mod_attributes() { let doc = mk_doc(~"#[doc = \"test\"] mod a { }"); - assert!(doc.cratemod().mods()[0].desc() == Some(~"test")); + // hidden __std_macros module at the start. + assert!(doc.cratemod().mods()[1].desc() == Some(~"test")); } #[test] diff --git a/src/librustdoc/desc_to_brief_pass.rs b/src/librustdoc/desc_to_brief_pass.rs index 3fd6ad1699876..9554db85e27de 100644 --- a/src/librustdoc/desc_to_brief_pass.rs +++ b/src/librustdoc/desc_to_brief_pass.rs @@ -190,7 +190,8 @@ mod test { #[test] fn should_promote_desc() { let doc = mk_doc(~"#[doc = \"desc\"] mod m { }"); - assert_eq!(doc.cratemod().mods()[0].brief(), Some(~"desc")); + // hidden __std_macros module at the start. + assert_eq!(doc.cratemod().mods()[1].brief(), Some(~"desc")); } #[test] diff --git a/src/librustdoc/markdown_index_pass.rs b/src/librustdoc/markdown_index_pass.rs index 1e67f900822cd..0c2ea5f138073 100644 --- a/src/librustdoc/markdown_index_pass.rs +++ b/src/librustdoc/markdown_index_pass.rs @@ -172,6 +172,7 @@ mod test { use extract; use markdown_index_pass::run; use path_pass; + use prune_hidden_pass; use super::pandoc_header_id; fn mk_doc(output_style: config::OutputStyle, source: ~str) @@ -183,8 +184,10 @@ mod test { }; let doc = extract::from_srv(srv.clone(), ~""); let doc = (attr_pass::mk_pass().f)(srv.clone(), doc); + let doc = (prune_hidden_pass::mk_pass().f)(srv.clone(), doc); let doc = (desc_to_brief_pass::mk_pass().f)(srv.clone(), doc); let doc = (path_pass::mk_pass().f)(srv.clone(), doc); + run(srv.clone(), doc, config) } } @@ -240,13 +243,13 @@ mod test { config::DocPerMod, ~"mod a { } fn b() { }" ); - assert!(doc.cratemod().index.get().entries[0] == doc::IndexEntry { + assert_eq!(doc.cratemod().index.get().entries[0], doc::IndexEntry { kind: ~"Module", name: ~"a", brief: None, link: ~"a.html" }); - assert!(doc.cratemod().index.get().entries[1] == doc::IndexEntry { + assert_eq!(doc.cratemod().index.get().entries[1], doc::IndexEntry { kind: ~"Function", name: ~"b", brief: None, @@ -260,8 +263,7 @@ mod test { config::DocPerMod, ~"#[doc = \"test\"] mod a { }" ); - assert!(doc.cratemod().index.get().entries[0].brief - == Some(~"test")); + assert_eq!(doc.cratemod().index.get().entries[0].brief, Some(~"test")); } #[test] @@ -270,12 +272,13 @@ mod test { config::DocPerCrate, ~"extern { fn b(); }" ); - assert!(doc.cratemod().nmods()[0].index.get().entries[0] - == doc::IndexEntry { - kind: ~"Function", - name: ~"b", - brief: None, - link: ~"#function-b" - }); + // hidden __std_macros module at the start. + assert_eq!(doc.cratemod().nmods()[0].index.get().entries[0], + doc::IndexEntry { + kind: ~"Function", + name: ~"b", + brief: None, + link: ~"#function-b" + }); } } diff --git a/src/librustdoc/markdown_pass.rs b/src/librustdoc/markdown_pass.rs index f800a8ab946fe..f9ac8beb97457 100644 --- a/src/librustdoc/markdown_pass.rs +++ b/src/librustdoc/markdown_pass.rs @@ -529,6 +529,7 @@ mod test { use markdown_writer; use path_pass; use page_pass; + use prune_hidden_pass; use sectionalize_pass; use trim_pass; use tystr_pass; @@ -557,6 +558,8 @@ mod test { debug!("doc (path): %?", doc); let doc = (attr_pass::mk_pass().f)(srv.clone(), doc); debug!("doc (attr): %?", doc); + let doc = (prune_hidden_pass::mk_pass().f)(srv.clone(), doc); + debug!("doc (prune_hidden): %?", doc); let doc = (desc_to_brief_pass::mk_pass().f)(srv.clone(), doc); debug!("doc (desc_to_brief): %?", doc); let doc = (unindent_pass::mk_pass().f)(srv.clone(), doc); diff --git a/src/librustdoc/markdown_writer.rs b/src/librustdoc/markdown_writer.rs index d757547d8f76f..3dc9f1799a4b1 100644 --- a/src/librustdoc/markdown_writer.rs +++ b/src/librustdoc/markdown_writer.rs @@ -277,7 +277,8 @@ mod test { .. config::default_config(&Path("input/test.rc")) }; let doc = mk_doc(~"", ~"mod a { mod b { } }"); - let modb = copy doc.cratemod().mods()[0].mods()[0]; + // hidden __std_macros module at the start. + let modb = copy doc.cratemod().mods()[1].mods()[0]; let page = doc::ItemPage(doc::ModTag(modb)); let filename = make_local_filename(&config, page); assert_eq!(filename, Path("output/dir/a_b.html")); diff --git a/src/librustdoc/page_pass.rs b/src/librustdoc/page_pass.rs index 83a0d44978ec4..7abbc0e823a47 100644 --- a/src/librustdoc/page_pass.rs +++ b/src/librustdoc/page_pass.rs @@ -152,8 +152,10 @@ fn fold_nmod( mod test { use astsrv; use config; + use attr_pass; use doc; use extract; + use prune_hidden_pass; use page_pass::run; fn mk_doc_( @@ -162,6 +164,8 @@ mod test { ) -> doc::Doc { do astsrv::from_str(copy source) |srv| { let doc = extract::from_srv(srv.clone(), ~""); + let doc = (attr_pass::mk_pass().f)(srv.clone(), doc); + let doc = (prune_hidden_pass::mk_pass().f)(srv.clone(), doc); run(srv.clone(), doc, output_style) } } @@ -182,6 +186,7 @@ mod test { #[test] fn should_make_a_page_for_every_mod() { let doc = mk_doc(~"mod a { }"); + // hidden __std_macros module at the start. assert_eq!(doc.pages.mods()[0].name(), ~"a"); } diff --git a/src/librustdoc/path_pass.rs b/src/librustdoc/path_pass.rs index 55ce135f2777a..d26c3f8da6edb 100644 --- a/src/librustdoc/path_pass.rs +++ b/src/librustdoc/path_pass.rs @@ -97,10 +97,11 @@ fn should_record_mod_paths() { do astsrv::from_str(source) |srv| { let doc = extract::from_srv(srv.clone(), ~""); let doc = run(srv.clone(), doc); - assert!(doc.cratemod().mods()[0].mods()[0].mods()[0].path() - == ~[~"a", ~"b"]); - assert!(doc.cratemod().mods()[0].mods()[1].mods()[0].path() - == ~[~"a", ~"d"]); + // hidden __std_macros module at the start. + assert_eq!(doc.cratemod().mods()[1].mods()[0].mods()[0].path(), + ~[~"a", ~"b"]); + assert_eq!(doc.cratemod().mods()[1].mods()[1].mods()[0].path(), + ~[~"a", ~"d"]); } } @@ -110,6 +111,7 @@ fn should_record_fn_paths() { do astsrv::from_str(source) |srv| { let doc = extract::from_srv(srv.clone(), ~""); let doc = run(srv.clone(), doc); - assert_eq!(doc.cratemod().mods()[0].fns()[0].path(), ~[~"a"]); + // hidden __std_macros module at the start. + assert_eq!(doc.cratemod().mods()[1].fns()[0].path(), ~[~"a"]); } } diff --git a/src/librustdoc/sectionalize_pass.rs b/src/librustdoc/sectionalize_pass.rs index 4e297c36dd46d..9b7374eb71c7a 100644 --- a/src/librustdoc/sectionalize_pass.rs +++ b/src/librustdoc/sectionalize_pass.rs @@ -166,12 +166,14 @@ mod test { use attr_pass; use doc; use extract; + use prune_hidden_pass; use sectionalize_pass::run; fn mk_doc(source: ~str) -> doc::Doc { do astsrv::from_str(copy source) |srv| { let doc = extract::from_srv(srv.clone(), ~""); let doc = (attr_pass::mk_pass().f)(srv.clone(), doc); + let doc = (prune_hidden_pass::mk_pass().f)(srv.clone(), doc); run(srv.clone(), doc) } } diff --git a/src/librustdoc/sort_item_name_pass.rs b/src/librustdoc/sort_item_name_pass.rs index 572cb7db926e3..5ad0c5606d98c 100644 --- a/src/librustdoc/sort_item_name_pass.rs +++ b/src/librustdoc/sort_item_name_pass.rs @@ -31,7 +31,8 @@ fn test() { do astsrv::from_str(source) |srv| { let doc = extract::from_srv(srv.clone(), ~""); let doc = (mk_pass().f)(srv.clone(), doc); - assert_eq!(doc.cratemod().items[0].name(), ~"y"); - assert_eq!(doc.cratemod().items[1].name(), ~"z"); + // hidden __std_macros module at the start. + assert_eq!(doc.cratemod().items[1].name(), ~"y"); + assert_eq!(doc.cratemod().items[2].name(), ~"z"); } } diff --git a/src/librustdoc/sort_item_type_pass.rs b/src/librustdoc/sort_item_type_pass.rs index bf4c7027ce21b..b37be5482ac6e 100644 --- a/src/librustdoc/sort_item_type_pass.rs +++ b/src/librustdoc/sort_item_type_pass.rs @@ -53,6 +53,7 @@ fn test() { do astsrv::from_str(source) |srv| { let doc = extract::from_srv(srv.clone(), ~""); let doc = (mk_pass().f)(srv.clone(), doc); + // hidden __std_macros module at the start. assert_eq!(doc.cratemod().items[0].name(), ~"iconst"); assert_eq!(doc.cratemod().items[1].name(), ~"itype"); assert_eq!(doc.cratemod().items[2].name(), ~"ienum"); @@ -60,6 +61,7 @@ fn test() { assert_eq!(doc.cratemod().items[4].name(), ~"itrait"); assert_eq!(doc.cratemod().items[5].name(), ~"__extensions__"); assert_eq!(doc.cratemod().items[6].name(), ~"ifn"); - assert_eq!(doc.cratemod().items[7].name(), ~"imod"); + // hidden __std_macros module fits here. + assert_eq!(doc.cratemod().items[8].name(), ~"imod"); } } diff --git a/src/librustdoc/sort_pass.rs b/src/librustdoc/sort_pass.rs index 2c545f7d2be07..9b125f16afe60 100644 --- a/src/librustdoc/sort_pass.rs +++ b/src/librustdoc/sort_pass.rs @@ -67,10 +67,11 @@ fn test() { do astsrv::from_str(source) |srv| { let doc = extract::from_srv(srv.clone(), ~""); let doc = (mk_pass(~"", name_lteq).f)(srv.clone(), doc); - assert_eq!(doc.cratemod().mods()[0].name(), ~"w"); - assert_eq!(doc.cratemod().mods()[1].items[0].name(), ~"x"); - assert_eq!(doc.cratemod().mods()[1].items[1].name(), ~"y"); - assert_eq!(doc.cratemod().mods()[1].name(), ~"z"); + // hidden __std_macros module at the start. + assert_eq!(doc.cratemod().mods()[1].name(), ~"w"); + assert_eq!(doc.cratemod().mods()[2].items[0].name(), ~"x"); + assert_eq!(doc.cratemod().mods()[2].items[1].name(), ~"y"); + assert_eq!(doc.cratemod().mods()[2].name(), ~"z"); } } @@ -84,10 +85,11 @@ fn should_be_stable() { do astsrv::from_str(source) |srv| { let doc = extract::from_srv(srv.clone(), ~""); let doc = (mk_pass(~"", always_eq).f)(srv.clone(), doc); - assert_eq!(doc.cratemod().mods()[0].items[0].name(), ~"b"); - assert_eq!(doc.cratemod().mods()[1].items[0].name(), ~"d"); + // hidden __std_macros module at the start. + assert_eq!(doc.cratemod().mods()[1].items[0].name(), ~"b"); + assert_eq!(doc.cratemod().mods()[2].items[0].name(), ~"d"); let doc = (mk_pass(~"", always_eq).f)(srv.clone(), doc); - assert_eq!(doc.cratemod().mods()[0].items[0].name(), ~"b"); - assert_eq!(doc.cratemod().mods()[1].items[0].name(), ~"d"); + assert_eq!(doc.cratemod().mods()[1].items[0].name(), ~"b"); + assert_eq!(doc.cratemod().mods()[2].items[0].name(), ~"d"); } } diff --git a/src/librustdoc/trim_pass.rs b/src/librustdoc/trim_pass.rs index 281a59c8cb7af..0d284fb48e264 100644 --- a/src/librustdoc/trim_pass.rs +++ b/src/librustdoc/trim_pass.rs @@ -28,12 +28,14 @@ mod test { use attr_pass; use doc; use extract; + use prune_hidden_pass; use trim_pass::mk_pass; fn mk_doc(source: ~str) -> doc::Doc { do astsrv::from_str(copy source) |srv| { let doc = extract::from_srv(srv.clone(), ~""); let doc = (attr_pass::mk_pass().f)(srv.clone(), doc); + let doc = (prune_hidden_pass::mk_pass().f)(srv.clone(), doc); (mk_pass().f)(srv.clone(), doc) } } diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs index d63d914edd396..c421da067951c 100644 --- a/src/libsyntax/ext/expand.rs +++ b/src/libsyntax/ext/expand.rs @@ -453,8 +453,9 @@ pub fn new_span(cx: @ExtCtxt, sp: span) -> span { pub fn std_macros() -> @str { return -@"pub mod __std_macros { +@"mod __std_macros { #[macro_escape]; + #[doc(hidden)]; macro_rules! ignore (($($x:tt)*) => (())) diff --git a/src/test/auxiliary/extern-crosscrate-source.rs b/src/test/auxiliary/extern-crosscrate-source.rs index ba9091ce0e5bf..fc62e50b9bd6e 100644 --- a/src/test/auxiliary/extern-crosscrate-source.rs +++ b/src/test/auxiliary/extern-crosscrate-source.rs @@ -26,7 +26,7 @@ pub mod rustrt { pub fn fact(n: uint) -> uint { unsafe { - debug!("n = %?", n); + info!("n = %?", n); rustrt::rust_dbg_call(cb, n) } } diff --git a/src/test/bench/core-uint-to-str.rs b/src/test/bench/core-uint-to-str.rs index cbf73d5c0594f..f960363766dfd 100644 --- a/src/test/bench/core-uint-to-str.rs +++ b/src/test/bench/core-uint-to-str.rs @@ -25,6 +25,6 @@ fn main() { for uint::range(0u, n) |i| { let x = uint::to_str(i); - debug!(x); + info!(x); } } diff --git a/src/test/bench/msgsend-pipes-shared.rs b/src/test/bench/msgsend-pipes-shared.rs index 102f7f1706592..91576bad73d96 100644 --- a/src/test/bench/msgsend-pipes-shared.rs +++ b/src/test/bench/msgsend-pipes-shared.rs @@ -110,6 +110,6 @@ fn main() { copy args }; - debug!("%?", args); + info!("%?", args); run(args); } diff --git a/src/test/bench/msgsend-pipes.rs b/src/test/bench/msgsend-pipes.rs index b8d91bb93e2e3..12c0871566c93 100644 --- a/src/test/bench/msgsend-pipes.rs +++ b/src/test/bench/msgsend-pipes.rs @@ -106,6 +106,6 @@ fn main() { copy args }; - debug!("%?", args); + info!("%?", args); run(args); } diff --git a/src/test/bench/shootout-threadring.rs b/src/test/bench/shootout-threadring.rs index 97168de5d43ec..d30c129443525 100644 --- a/src/test/bench/shootout-threadring.rs +++ b/src/test/bench/shootout-threadring.rs @@ -44,7 +44,7 @@ fn roundtrip(id: int, n_tasks: int, p: &Port, ch: &Chan) { return; } token => { - debug!("thread: %d got token: %d", id, token); + info!("thread: %d got token: %d", id, token); ch.send(token - 1); if token <= n_tasks { return; diff --git a/src/test/bench/task-perf-alloc-unwind.rs b/src/test/bench/task-perf-alloc-unwind.rs index abc44dfbc9bb7..f397f954623b0 100644 --- a/src/test/bench/task-perf-alloc-unwind.rs +++ b/src/test/bench/task-perf-alloc-unwind.rs @@ -33,11 +33,11 @@ fn main() { fn run(repeat: int, depth: int) { for (repeat as uint).times { - debug!("starting %.4f", precise_time_s()); + info!("starting %.4f", precise_time_s()); do task::try { recurse_or_fail(depth, None) }; - debug!("stopping %.4f", precise_time_s()); + info!("stopping %.4f", precise_time_s()); } } @@ -71,7 +71,7 @@ fn r(l: @nillist) -> r { fn recurse_or_fail(depth: int, st: Option) { if depth == 0 { - debug!("unwinding %.4f", precise_time_s()); + info!("unwinding %.4f", precise_time_s()); fail!(); } else { let depth = depth - 1; diff --git a/src/test/compile-fail/assign-imm-local-twice.rs b/src/test/compile-fail/assign-imm-local-twice.rs index 95246616f716f..7eeaa9435deff 100644 --- a/src/test/compile-fail/assign-imm-local-twice.rs +++ b/src/test/compile-fail/assign-imm-local-twice.rs @@ -11,9 +11,9 @@ fn test() { let v: int; v = 1; //~ NOTE prior assignment occurs here - debug!("v=%d", v); + info!("v=%d", v); v = 2; //~ ERROR re-assignment of immutable variable - debug!("v=%d", v); + info!("v=%d", v); } fn main() { diff --git a/src/test/compile-fail/assign-to-method.rs b/src/test/compile-fail/assign-to-method.rs index 85bb60e05853e..f300bd51b24ec 100644 --- a/src/test/compile-fail/assign-to-method.rs +++ b/src/test/compile-fail/assign-to-method.rs @@ -27,5 +27,5 @@ fn cat(in_x : uint, in_y : int) -> cat { fn main() { let nyan : cat = cat(52u, 99); - nyan.speak = || debug!("meow"); //~ ERROR attempted to take value of method + nyan.speak = || info!("meow"); //~ ERROR attempted to take value of method } diff --git a/src/test/compile-fail/attr-before-ext.rs b/src/test/compile-fail/attr-before-ext.rs index cf0f4a6240e2b..3102a1a9d9948 100644 --- a/src/test/compile-fail/attr-before-ext.rs +++ b/src/test/compile-fail/attr-before-ext.rs @@ -10,5 +10,5 @@ fn main() { #[attr] //~ ERROR expected item after attributes - debug!("hi"); + info!("hi"); } diff --git a/src/test/compile-fail/autoderef-full-lval.rs b/src/test/compile-fail/autoderef-full-lval.rs index e38c22004ed13..e1ad19e32bddc 100644 --- a/src/test/compile-fail/autoderef-full-lval.rs +++ b/src/test/compile-fail/autoderef-full-lval.rs @@ -21,11 +21,11 @@ fn main() { let a: clam = clam{x: @1, y: @2}; let b: clam = clam{x: @10, y: @20}; let z: int = a.x + b.y; //~ ERROR binary operation + cannot be applied to type `@int` - debug!(z); + info!(z); assert_eq!(z, 21); let forty: fish = fish{a: @40}; let two: fish = fish{a: @2}; let answer: int = forty.a + two.a; //~ ERROR binary operation + cannot be applied to type `@int` - debug!(answer); + info!(answer); assert_eq!(answer, 42); } diff --git a/src/test/compile-fail/bad-const-type.rs b/src/test/compile-fail/bad-const-type.rs index a66c00d5411b4..5045c87c2f3a8 100644 --- a/src/test/compile-fail/bad-const-type.rs +++ b/src/test/compile-fail/bad-const-type.rs @@ -11,4 +11,4 @@ // error-pattern:expected `~str` but found `int` static i: ~str = 10i; -fn main() { debug!(i); } +fn main() { info!(i); } diff --git a/src/test/compile-fail/block-arg-as-stmt-with-value.rs b/src/test/compile-fail/block-arg-as-stmt-with-value.rs index c5fa8795a0b57..d2366c2b5bc5d 100644 --- a/src/test/compile-fail/block-arg-as-stmt-with-value.rs +++ b/src/test/compile-fail/block-arg-as-stmt-with-value.rs @@ -17,6 +17,6 @@ fn compute1() -> float { fn main() { let x = compute1(); - debug!(x); + info!(x); assert_eq!(x, -4f); } diff --git a/src/test/compile-fail/bogus-tag.rs b/src/test/compile-fail/bogus-tag.rs index 89ad7b4245a07..63d12b72cc635 100644 --- a/src/test/compile-fail/bogus-tag.rs +++ b/src/test/compile-fail/bogus-tag.rs @@ -17,7 +17,7 @@ enum color { rgb(int, int, int), rgba(int, int, int, int), } fn main() { let red: color = rgb(255, 0, 0); match red { - rgb(r, g, b) => { debug!("rgb"); } - hsl(h, s, l) => { debug!("hsl"); } + rgb(r, g, b) => { info!("rgb"); } + hsl(h, s, l) => { info!("hsl"); } } } diff --git a/src/test/compile-fail/borrowck-assign-comp-idx.rs b/src/test/compile-fail/borrowck-assign-comp-idx.rs index 9b21cbf9768f7..0256c88b01d5d 100644 --- a/src/test/compile-fail/borrowck-assign-comp-idx.rs +++ b/src/test/compile-fail/borrowck-assign-comp-idx.rs @@ -21,7 +21,7 @@ fn a() { p[0] = 5; //~ ERROR cannot assign - debug!("%d", *q); + info!("%d", *q); } fn borrow(_x: &[int], _f: &fn()) {} diff --git a/src/test/compile-fail/borrowck-loan-blocks-move-cc.rs b/src/test/compile-fail/borrowck-loan-blocks-move-cc.rs index 1e74e91a82196..87ab36348c6a6 100644 --- a/src/test/compile-fail/borrowck-loan-blocks-move-cc.rs +++ b/src/test/compile-fail/borrowck-loan-blocks-move-cc.rs @@ -18,14 +18,14 @@ fn box_imm() { let v = ~3; let _w = &v; do task::spawn { - debug!("v=%d", *v); + info!("v=%d", *v); //~^ ERROR cannot move `v` into closure } let v = ~3; let _w = &v; task::spawn(|| { - debug!("v=%d", *v); + info!("v=%d", *v); //~^ ERROR cannot move }); } diff --git a/src/test/compile-fail/borrowck-move-out-of-vec-tail.rs b/src/test/compile-fail/borrowck-move-out-of-vec-tail.rs index 91a3d843cd4ac..0b9897f23fc06 100644 --- a/src/test/compile-fail/borrowck-move-out-of-vec-tail.rs +++ b/src/test/compile-fail/borrowck-move-out-of-vec-tail.rs @@ -22,7 +22,7 @@ pub fn main() { } } let z = copy tail[0]; - debug!(fmt!("%?", z)); + info!(fmt!("%?", z)); } _ => { ::std::util::unreachable(); diff --git a/src/test/compile-fail/borrowck-mut-addr-of-imm-var.rs b/src/test/compile-fail/borrowck-mut-addr-of-imm-var.rs index e4e449822768b..f69036ff9d913 100644 --- a/src/test/compile-fail/borrowck-mut-addr-of-imm-var.rs +++ b/src/test/compile-fail/borrowck-mut-addr-of-imm-var.rs @@ -12,5 +12,5 @@ fn main() { let x: int = 3; let y: &mut int = &mut x; //~ ERROR cannot borrow *y = 5; - debug!(*y); + info!(*y); } diff --git a/src/test/compile-fail/dead-code-ret.rs b/src/test/compile-fail/dead-code-ret.rs index 91b89a67ee348..2e4ae7f8544af 100644 --- a/src/test/compile-fail/dead-code-ret.rs +++ b/src/test/compile-fail/dead-code-ret.rs @@ -13,5 +13,5 @@ fn main() { return; - debug!("Paul is dead"); //~ ERROR: unreachable + info!("Paul is dead"); //~ ERROR: unreachable } diff --git a/src/test/compile-fail/does-nothing.rs b/src/test/compile-fail/does-nothing.rs index 1dacbe9a1994c..9d2b68ddb81ef 100644 --- a/src/test/compile-fail/does-nothing.rs +++ b/src/test/compile-fail/does-nothing.rs @@ -1,2 +1,2 @@ // error-pattern: unresolved name `this_does_nothing_what_the`. -fn main() { debug!("doing"); this_does_nothing_what_the; debug!("boing"); } +fn main() { info!("doing"); this_does_nothing_what_the; info!("boing"); } diff --git a/src/test/compile-fail/export2.rs b/src/test/compile-fail/export2.rs index 61d623cf99a8c..22762eb4a7eb5 100644 --- a/src/test/compile-fail/export2.rs +++ b/src/test/compile-fail/export2.rs @@ -15,7 +15,7 @@ mod foo { } mod bar { - fn x() { debug!("x"); } + fn x() { info!("x"); } pub fn y() { } } diff --git a/src/test/compile-fail/if-without-else-result.rs b/src/test/compile-fail/if-without-else-result.rs index e822be759458f..8e3318f6945ac 100644 --- a/src/test/compile-fail/if-without-else-result.rs +++ b/src/test/compile-fail/if-without-else-result.rs @@ -12,5 +12,5 @@ fn main() { let a = if true { true }; - debug!(a); + info!(a); } diff --git a/src/test/compile-fail/import-glob-0.rs b/src/test/compile-fail/import-glob-0.rs index 250f998974070..805aace081d02 100644 --- a/src/test/compile-fail/import-glob-0.rs +++ b/src/test/compile-fail/import-glob-0.rs @@ -13,10 +13,10 @@ use module_of_many_things::*; mod module_of_many_things { - pub fn f1() { debug!("f1"); } - pub fn f2() { debug!("f2"); } - fn f3() { debug!("f3"); } - pub fn f4() { debug!("f4"); } + pub fn f1() { info!("f1"); } + pub fn f2() { info!("f2"); } + fn f3() { info!("f3"); } + pub fn f4() { info!("f4"); } } diff --git a/src/test/compile-fail/import-glob-circular.rs b/src/test/compile-fail/import-glob-circular.rs index a6a173422451c..49ee1ad55c0ca 100644 --- a/src/test/compile-fail/import-glob-circular.rs +++ b/src/test/compile-fail/import-glob-circular.rs @@ -12,13 +12,13 @@ mod circ1 { pub use circ2::f2; - pub fn f1() { debug!("f1"); } + pub fn f1() { info!("f1"); } pub fn common() -> uint { return 0u; } } mod circ2 { pub use circ1::f1; - pub fn f2() { debug!("f2"); } + pub fn f2() { info!("f2"); } pub fn common() -> uint { return 1u; } } diff --git a/src/test/compile-fail/import.rs b/src/test/compile-fail/import.rs index 7a332868051d2..5177dc4e47570 100644 --- a/src/test/compile-fail/import.rs +++ b/src/test/compile-fail/import.rs @@ -12,6 +12,6 @@ use zed::bar; use zed::baz; mod zed { - pub fn bar() { debug!("bar"); } + pub fn bar() { info!("bar"); } } fn main(args: ~[str]) { bar(); } diff --git a/src/test/compile-fail/import2.rs b/src/test/compile-fail/import2.rs index 7cb017091e0c6..e67a79130b1f9 100644 --- a/src/test/compile-fail/import2.rs +++ b/src/test/compile-fail/import2.rs @@ -13,6 +13,6 @@ use baz::zed::bar; //~ ERROR unresolved import mod baz {} mod zed { - pub fn bar() { debug!("bar3"); } + pub fn bar() { info!("bar3"); } } fn main(args: ~[str]) { bar(); } diff --git a/src/test/compile-fail/import3.rs b/src/test/compile-fail/import3.rs index e88c1ce9a9399..7a7f4f20aea07 100644 --- a/src/test/compile-fail/import3.rs +++ b/src/test/compile-fail/import3.rs @@ -11,4 +11,4 @@ // error-pattern: unresolved use main::bar; -fn main(args: ~[str]) { debug!("foo"); } +fn main(args: ~[str]) { info!("foo"); } diff --git a/src/test/compile-fail/import4.rs b/src/test/compile-fail/import4.rs index 3029d24af8a61..087842d78c709 100644 --- a/src/test/compile-fail/import4.rs +++ b/src/test/compile-fail/import4.rs @@ -13,4 +13,4 @@ mod a { pub use b::foo; } mod b { pub use a::foo; } -fn main(args: ~[str]) { debug!("loop"); } +fn main(args: ~[str]) { info!("loop"); } diff --git a/src/test/compile-fail/issue-1448-2.rs b/src/test/compile-fail/issue-1448-2.rs index e329ed4d6710d..ba0a2cbab5022 100644 --- a/src/test/compile-fail/issue-1448-2.rs +++ b/src/test/compile-fail/issue-1448-2.rs @@ -11,5 +11,5 @@ // Regression test for issue #1448 and #1386 fn main() { - debug!("%u", 10i); //~ ERROR mismatched types + info!("%u", 10i); //~ ERROR mismatched types } diff --git a/src/test/compile-fail/issue-2281-part1.rs b/src/test/compile-fail/issue-2281-part1.rs index 60c80c1a3158b..0d94e378a4ca8 100644 --- a/src/test/compile-fail/issue-2281-part1.rs +++ b/src/test/compile-fail/issue-2281-part1.rs @@ -10,4 +10,4 @@ // error-pattern: unresolved name `foobar`. -fn main(args: ~[str]) { debug!(foobar); } +fn main(args: ~[str]) { info!(foobar); } diff --git a/src/test/compile-fail/issue-3038.rs b/src/test/compile-fail/issue-3038.rs index 1cdb226e39e5d..e16b9f933f79d 100644 --- a/src/test/compile-fail/issue-3038.rs +++ b/src/test/compile-fail/issue-3038.rs @@ -19,7 +19,7 @@ fn main() { let _z = match g(1, 2) { - g(x, x) => { debug!(x + x); } + g(x, x) => { info!(x + x); } //~^ ERROR Identifier `x` is bound more than once in the same pattern }; diff --git a/src/test/compile-fail/liveness-and-init.rs b/src/test/compile-fail/liveness-and-init.rs index 4fd2427799f76..64618bb2f7a53 100644 --- a/src/test/compile-fail/liveness-and-init.rs +++ b/src/test/compile-fail/liveness-and-init.rs @@ -11,6 +11,6 @@ fn main() { let i: int; - debug!(false && { i = 5; true }); - debug!(i); //~ ERROR use of possibly uninitialized variable: `i` + info!(false && { i = 5; true }); + info!(i); //~ ERROR use of possibly uninitialized variable: `i` } diff --git a/src/test/compile-fail/liveness-bad-bang-2.rs b/src/test/compile-fail/liveness-bad-bang-2.rs index 496b0f7042f31..e9ab87f09e26d 100644 --- a/src/test/compile-fail/liveness-bad-bang-2.rs +++ b/src/test/compile-fail/liveness-bad-bang-2.rs @@ -12,6 +12,6 @@ // Tests that a function with a ! annotation always actually fails // error-pattern: some control paths may return -fn bad_bang(i: uint) -> ! { debug!(3); } +fn bad_bang(i: uint) -> ! { info!(3); } fn main() { bad_bang(5u); } diff --git a/src/test/compile-fail/liveness-block-unint.rs b/src/test/compile-fail/liveness-block-unint.rs index 61610ca0ad102..159c945f3c219 100644 --- a/src/test/compile-fail/liveness-block-unint.rs +++ b/src/test/compile-fail/liveness-block-unint.rs @@ -12,6 +12,6 @@ fn force(f: &fn()) { f(); } fn main() { let x: int; force(|| { - debug!(x); //~ ERROR capture of possibly uninitialized variable: `x` + info!(x); //~ ERROR capture of possibly uninitialized variable: `x` }); } diff --git a/src/test/compile-fail/liveness-break-uninit-2.rs b/src/test/compile-fail/liveness-break-uninit-2.rs index 2ed02e2cdd7db..2c3004056eae0 100644 --- a/src/test/compile-fail/liveness-break-uninit-2.rs +++ b/src/test/compile-fail/liveness-break-uninit-2.rs @@ -16,9 +16,9 @@ fn foo() -> int { x = 0; } - debug!(x); //~ ERROR use of possibly uninitialized variable: `x` + info!(x); //~ ERROR use of possibly uninitialized variable: `x` return 17; } -fn main() { debug!(foo()); } +fn main() { info!(foo()); } diff --git a/src/test/compile-fail/liveness-break-uninit.rs b/src/test/compile-fail/liveness-break-uninit.rs index 2dcbad2804c16..9e8a1e8a4d350 100644 --- a/src/test/compile-fail/liveness-break-uninit.rs +++ b/src/test/compile-fail/liveness-break-uninit.rs @@ -16,9 +16,9 @@ fn foo() -> int { x = 0; } - debug!(x); //~ ERROR use of possibly uninitialized variable: `x` + info!(x); //~ ERROR use of possibly uninitialized variable: `x` return 17; } -fn main() { debug!(foo()); } +fn main() { info!(foo()); } diff --git a/src/test/compile-fail/liveness-closure-require-ret.rs b/src/test/compile-fail/liveness-closure-require-ret.rs index 22d321ffc0918..f624bfe800f5f 100644 --- a/src/test/compile-fail/liveness-closure-require-ret.rs +++ b/src/test/compile-fail/liveness-closure-require-ret.rs @@ -9,4 +9,4 @@ // except according to those terms. fn force(f: &fn() -> int) -> int { f() } -fn main() { debug!(force(|| {})); } //~ ERROR mismatched types +fn main() { info!(force(|| {})); } //~ ERROR mismatched types diff --git a/src/test/compile-fail/liveness-if-no-else.rs b/src/test/compile-fail/liveness-if-no-else.rs index 22b1b5edbac70..e9f831219e0c7 100644 --- a/src/test/compile-fail/liveness-if-no-else.rs +++ b/src/test/compile-fail/liveness-if-no-else.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -fn foo(x: int) { debug!(x); } +fn foo(x: int) { info!(x); } fn main() { let x: int; if 1 > 2 { x = 10; } diff --git a/src/test/compile-fail/liveness-if-with-else.rs b/src/test/compile-fail/liveness-if-with-else.rs index 6a436df6728e4..e2cf820f1911a 100644 --- a/src/test/compile-fail/liveness-if-with-else.rs +++ b/src/test/compile-fail/liveness-if-with-else.rs @@ -8,12 +8,12 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -fn foo(x: int) { debug!(x); } +fn foo(x: int) { info!(x); } fn main() { let x: int; if 1 > 2 { - debug!("whoops"); + info!("whoops"); } else { x = 10; } diff --git a/src/test/compile-fail/liveness-move-in-loop.rs b/src/test/compile-fail/liveness-move-in-loop.rs index 6fe59f0ca52d1..605233d3da0ae 100644 --- a/src/test/compile-fail/liveness-move-in-loop.rs +++ b/src/test/compile-fail/liveness-move-in-loop.rs @@ -12,7 +12,7 @@ fn main() { let y: ~int = ~42; let mut x: ~int; loop { - debug!(y); + info!(y); loop { loop { loop { diff --git a/src/test/compile-fail/liveness-move-in-while.rs b/src/test/compile-fail/liveness-move-in-while.rs index 26e82dd367343..c501607aee6ce 100644 --- a/src/test/compile-fail/liveness-move-in-while.rs +++ b/src/test/compile-fail/liveness-move-in-while.rs @@ -13,7 +13,7 @@ fn main() { let y: ~int = ~42; let mut x: ~int; loop { - debug!(y); //~ ERROR use of moved value: `y` + info!(y); //~ ERROR use of moved value: `y` while true { while true { while true { x = y; copy x; } } } //~^ ERROR use of moved value: `y` } diff --git a/src/test/compile-fail/liveness-or-init.rs b/src/test/compile-fail/liveness-or-init.rs index 2c1aadc8bbf16..ee2a550d98370 100644 --- a/src/test/compile-fail/liveness-or-init.rs +++ b/src/test/compile-fail/liveness-or-init.rs @@ -11,6 +11,6 @@ fn main() { let i: int; - debug!(false || { i = 5; true }); - debug!(i); //~ ERROR use of possibly uninitialized variable: `i` + info!(false || { i = 5; true }); + info!(i); //~ ERROR use of possibly uninitialized variable: `i` } diff --git a/src/test/compile-fail/liveness-uninit.rs b/src/test/compile-fail/liveness-uninit.rs index a360f8e85a67d..015f824f6891b 100644 --- a/src/test/compile-fail/liveness-uninit.rs +++ b/src/test/compile-fail/liveness-uninit.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -fn foo(x: int) { debug!(x); } +fn foo(x: int) { info!(x); } fn main() { let x: int; diff --git a/src/test/compile-fail/liveness-use-after-move.rs b/src/test/compile-fail/liveness-use-after-move.rs index b7401db2a551b..662514e133b5f 100644 --- a/src/test/compile-fail/liveness-use-after-move.rs +++ b/src/test/compile-fail/liveness-use-after-move.rs @@ -11,6 +11,6 @@ fn main() { let x = ~5; let y = x; - debug!(*x); //~ ERROR use of moved value: `x` + info!(*x); //~ ERROR use of moved value: `x` copy y; } diff --git a/src/test/compile-fail/liveness-use-after-send.rs b/src/test/compile-fail/liveness-use-after-send.rs index 72555d7e85119..5a748fbc81c9e 100644 --- a/src/test/compile-fail/liveness-use-after-send.rs +++ b/src/test/compile-fail/liveness-use-after-send.rs @@ -9,8 +9,8 @@ // except according to those terms. fn send(ch: _chan, data: T) { - debug!(ch); - debug!(data); + info!(ch); + info!(data); fail!(); } @@ -20,7 +20,7 @@ struct _chan(int); // message after the send deinitializes it fn test00_start(ch: _chan<~int>, message: ~int, _count: ~int) { send(ch, message); - debug!(message); //~ ERROR use of moved value: `message` + info!(message); //~ ERROR use of moved value: `message` } fn main() { fail!(); } diff --git a/src/test/compile-fail/liveness-while-break.rs b/src/test/compile-fail/liveness-while-break.rs index 173b6d39936ac..712d586852af4 100644 --- a/src/test/compile-fail/liveness-while-break.rs +++ b/src/test/compile-fail/liveness-while-break.rs @@ -14,7 +14,7 @@ fn test(cond: bool) { v = 3; break; } - debug!("%d", v); //~ ERROR use of possibly uninitialized variable: `v` + info!("%d", v); //~ ERROR use of possibly uninitialized variable: `v` } fn main() { diff --git a/src/test/compile-fail/match-join.rs b/src/test/compile-fail/match-join.rs index 3caac6dbcfee0..818671e113322 100644 --- a/src/test/compile-fail/match-join.rs +++ b/src/test/compile-fail/match-join.rs @@ -16,6 +16,6 @@ fn my_fail() -> ! { fail!(); } fn main() { match true { false => { my_fail(); } true => { } } - debug!(x); //~ ERROR unresolved name `x`. + info!(x); //~ ERROR unresolved name `x`. let x: int; } diff --git a/src/test/compile-fail/nonscalar-cast.rs b/src/test/compile-fail/nonscalar-cast.rs index 999d96669ea5a..9cfd63dd51fdb 100644 --- a/src/test/compile-fail/nonscalar-cast.rs +++ b/src/test/compile-fail/nonscalar-cast.rs @@ -15,5 +15,5 @@ struct foo { } fn main() { - debug!(foo{ x: 1 } as int); + info!(foo{ x: 1 } as int); } diff --git a/src/test/compile-fail/oversized-literal.rs b/src/test/compile-fail/oversized-literal.rs index ce7b505cf09df..f46ef0563164e 100644 --- a/src/test/compile-fail/oversized-literal.rs +++ b/src/test/compile-fail/oversized-literal.rs @@ -10,4 +10,4 @@ // error-pattern:literal out of range -fn main() { debug!(300u8); } +fn main() { info!(300u8); } diff --git a/src/test/compile-fail/packed-struct-generic-transmute.rs b/src/test/compile-fail/packed-struct-generic-transmute.rs index 3b9b17e051d6f..8e15f11231e97 100644 --- a/src/test/compile-fail/packed-struct-generic-transmute.rs +++ b/src/test/compile-fail/packed-struct-generic-transmute.rs @@ -32,6 +32,6 @@ fn main() { let foo = Foo { bar: [1u8, 2, 3, 4, 5], baz: 10i32 }; unsafe { let oof: Oof<[u8, .. 5], i32> = cast::transmute(foo); - debug!(oof); + info!(oof); } } diff --git a/src/test/compile-fail/packed-struct-transmute.rs b/src/test/compile-fail/packed-struct-transmute.rs index bf62bab8b408f..38419b8df88a2 100644 --- a/src/test/compile-fail/packed-struct-transmute.rs +++ b/src/test/compile-fail/packed-struct-transmute.rs @@ -32,6 +32,6 @@ fn main() { let foo = Foo { bar: 1, baz: 10 }; unsafe { let oof: Oof = cast::transmute(foo); - debug!(oof); + info!(oof); } } diff --git a/src/test/compile-fail/pattern-tyvar.rs b/src/test/compile-fail/pattern-tyvar.rs index 4ca0aac35ee66..49ad8f87de339 100644 --- a/src/test/compile-fail/pattern-tyvar.rs +++ b/src/test/compile-fail/pattern-tyvar.rs @@ -18,7 +18,7 @@ enum bar { t1((), Option<~[int]>), t2, } fn foo(t: bar) { match t { t1(_, Some::(x)) => { - debug!(x); + info!(x); } _ => { fail!(); } } diff --git a/src/test/compile-fail/pinned-deep-copy.rs b/src/test/compile-fail/pinned-deep-copy.rs index 2e48992e81e8a..b7fc2a64669f9 100644 --- a/src/test/compile-fail/pinned-deep-copy.rs +++ b/src/test/compile-fail/pinned-deep-copy.rs @@ -34,7 +34,7 @@ fn main() { // Can't do this copy let x = ~~~A {y: r(i)}; let _z = copy x; //~ ERROR copying a value of non-copyable type - debug!(x); + info!(x); } error!(*i); } diff --git a/src/test/compile-fail/regions-addr-of-self.rs b/src/test/compile-fail/regions-addr-of-self.rs index 0516264d45797..4565d897c72ba 100644 --- a/src/test/compile-fail/regions-addr-of-self.rs +++ b/src/test/compile-fail/regions-addr-of-self.rs @@ -33,5 +33,5 @@ fn dog() -> dog { fn main() { let mut d = dog(); d.chase_cat(); - debug!("cats_chased: %u", d.cats_chased); + info!("cats_chased: %u", d.cats_chased); } diff --git a/src/test/compile-fail/regions-freevar.rs b/src/test/compile-fail/regions-freevar.rs index f89c5eaa9c1f6..6bc93e3af7c74 100644 --- a/src/test/compile-fail/regions-freevar.rs +++ b/src/test/compile-fail/regions-freevar.rs @@ -13,6 +13,6 @@ fn wants_static_fn(_x: &'static fn()) {} fn main() { let i = 3; do wants_static_fn { //~ ERROR cannot infer an appropriate lifetime due to conflicting requirements - debug!("i=%d", i); + info!("i=%d", i); } } diff --git a/src/test/compile-fail/regions-ret-borrowed-1.rs b/src/test/compile-fail/regions-ret-borrowed-1.rs index 542711687190e..de4a05c9895c3 100644 --- a/src/test/compile-fail/regions-ret-borrowed-1.rs +++ b/src/test/compile-fail/regions-ret-borrowed-1.rs @@ -24,5 +24,5 @@ fn return_it<'a>() -> &'a int { fn main() { let x = return_it(); - debug!("foo=%d", *x); + info!("foo=%d", *x); } diff --git a/src/test/compile-fail/regions-ret-borrowed.rs b/src/test/compile-fail/regions-ret-borrowed.rs index 4d646aa364a40..1aa2329aaec61 100644 --- a/src/test/compile-fail/regions-ret-borrowed.rs +++ b/src/test/compile-fail/regions-ret-borrowed.rs @@ -27,5 +27,5 @@ fn return_it() -> &int { fn main() { let x = return_it(); - debug!("foo=%d", *x); + info!("foo=%d", *x); } diff --git a/src/test/compile-fail/sendfn-is-not-a-lambda.rs b/src/test/compile-fail/sendfn-is-not-a-lambda.rs index 847f85feb72f3..609439d7b8e2b 100644 --- a/src/test/compile-fail/sendfn-is-not-a-lambda.rs +++ b/src/test/compile-fail/sendfn-is-not-a-lambda.rs @@ -14,5 +14,5 @@ fn test(f: @fn(uint) -> uint) -> uint { fn main() { let f: ~fn(x: uint) -> uint = |x| 4u; - debug!(test(f)); //~ ERROR expected @ closure, found ~ closure + info!(test(f)); //~ ERROR expected @ closure, found ~ closure } diff --git a/src/test/compile-fail/unique-pinned-nocopy.rs b/src/test/compile-fail/unique-pinned-nocopy.rs index 1deb850741e99..30848a18af7dd 100644 --- a/src/test/compile-fail/unique-pinned-nocopy.rs +++ b/src/test/compile-fail/unique-pinned-nocopy.rs @@ -19,5 +19,5 @@ impl Drop for r { fn main() { let i = ~r { b: true }; let _j = copy i; //~ ERROR copying a value of non-copyable type - debug!(i); + info!(i); } diff --git a/src/test/compile-fail/unique-vec-res.rs b/src/test/compile-fail/unique-vec-res.rs index e231e5e503774..cfb517938225f 100644 --- a/src/test/compile-fail/unique-vec-res.rs +++ b/src/test/compile-fail/unique-vec-res.rs @@ -32,6 +32,6 @@ fn main() { f(copy r1, copy r2); //~^ ERROR copying a value of non-copyable type //~^^ ERROR copying a value of non-copyable type - debug!((r2, *i1)); - debug!((r1, *i2)); + info!((r2, *i1)); + info!((r1, *i2)); } diff --git a/src/test/compile-fail/unsupported-cast.rs b/src/test/compile-fail/unsupported-cast.rs index da8f69d7eae2d..faa0069a1136a 100644 --- a/src/test/compile-fail/unsupported-cast.rs +++ b/src/test/compile-fail/unsupported-cast.rs @@ -13,5 +13,5 @@ use std::libc; fn main() { - debug!(1.0 as *libc::FILE); // Can't cast float to foreign. + info!(1.0 as *libc::FILE); // Can't cast float to foreign. } diff --git a/src/test/compile-fail/vec-field.rs b/src/test/compile-fail/vec-field.rs index b6d478aa3ec20..bc2786b2c19a8 100644 --- a/src/test/compile-fail/vec-field.rs +++ b/src/test/compile-fail/vec-field.rs @@ -13,7 +13,7 @@ fn f() { let v = ~[1i]; - debug!(v.some_field_name); //type error + info!(v.some_field_name); //type error } fn main() { } diff --git a/src/test/compile-fail/vec-res-add.rs b/src/test/compile-fail/vec-res-add.rs index d881750bd3c24..e0fc3357d7bd0 100644 --- a/src/test/compile-fail/vec-res-add.rs +++ b/src/test/compile-fail/vec-res-add.rs @@ -25,5 +25,5 @@ fn main() { let i = ~[r(0)]; let j = ~[r(1)]; let k = i + j; - debug!(j); + info!(j); } diff --git a/src/test/pretty/block-arg-disambig.rs b/src/test/pretty/block-arg-disambig.rs index 67fdfffe1d3b6..9e6f053e4c2b9 100644 --- a/src/test/pretty/block-arg-disambig.rs +++ b/src/test/pretty/block-arg-disambig.rs @@ -9,4 +9,4 @@ // except according to those terms. fn blk1(b: &fn()) -> @fn() { return || { }; } -fn test1() { (do blk1 { debug!("hi"); })(); } +fn test1() { (do blk1 { info!("hi"); })(); } diff --git a/src/test/run-fail/extern-fail.rs b/src/test/run-fail/extern-fail.rs index 3d15ea16241f9..022a879eca496 100644 --- a/src/test/run-fail/extern-fail.rs +++ b/src/test/run-fail/extern-fail.rs @@ -43,7 +43,7 @@ fn main() { for 10u.times { do task::spawn { let result = count(5u); - debug!("result = %?", result); + info!("result = %?", result); fail!(); }; } diff --git a/src/test/run-fail/fail-arg.rs b/src/test/run-fail/fail-arg.rs index f0d9b5a3178fe..844bac9d3d037 100644 --- a/src/test/run-fail/fail-arg.rs +++ b/src/test/run-fail/fail-arg.rs @@ -9,6 +9,6 @@ // except according to those terms. // error-pattern:woe -fn f(a: int) { debug!(a); } +fn f(a: int) { info!(a); } fn main() { f(fail!("woe")); } diff --git a/src/test/run-fail/if-check-fail.rs b/src/test/run-fail/if-check-fail.rs index 72a89c22dc5fe..f7d37d1532973 100644 --- a/src/test/run-fail/if-check-fail.rs +++ b/src/test/run-fail/if-check-fail.rs @@ -17,7 +17,7 @@ fn even(x: uint) -> bool { fn foo(x: uint) { if even(x) { - debug!(x); + info!(x); } else { fail!("Number is odd"); } diff --git a/src/test/run-pass/alignment-gep-tup-like-1.rs b/src/test/run-pass/alignment-gep-tup-like-1.rs index 6f1b4b815213b..c48fbbca2b740 100644 --- a/src/test/run-pass/alignment-gep-tup-like-1.rs +++ b/src/test/run-pass/alignment-gep-tup-like-1.rs @@ -19,7 +19,7 @@ fn f(a: A, b: u16) -> @fn() -> (A, u16) { pub fn main() { let (a, b) = f(22_u64, 44u16)(); - debug!("a=%? b=%?", a, b); + info!("a=%? b=%?", a, b); assert_eq!(a, 22u64); assert_eq!(b, 44u16); } diff --git a/src/test/run-pass/alignment-gep-tup-like-2.rs b/src/test/run-pass/alignment-gep-tup-like-2.rs index 24709fb297400..f0f86222a2501 100644 --- a/src/test/run-pass/alignment-gep-tup-like-2.rs +++ b/src/test/run-pass/alignment-gep-tup-like-2.rs @@ -34,7 +34,7 @@ pub fn main() { let z = f(~x, y); make_cycle(z); let (a, b) = z(); - debug!("a=%u b=%u", *a as uint, b as uint); + info!("a=%u b=%u", *a as uint, b as uint); assert_eq!(*a, x); assert_eq!(b, y); } diff --git a/src/test/run-pass/arith-0.rs b/src/test/run-pass/arith-0.rs index 308a5c2721c3d..ca01e1e10c302 100644 --- a/src/test/run-pass/arith-0.rs +++ b/src/test/run-pass/arith-0.rs @@ -12,6 +12,6 @@ pub fn main() { let a: int = 10; - debug!(a); + info!(a); assert_eq!(a * (a - 1), 90); } diff --git a/src/test/run-pass/arith-1.rs b/src/test/run-pass/arith-1.rs index a6321439db943..8cde06ab4284f 100644 --- a/src/test/run-pass/arith-1.rs +++ b/src/test/run-pass/arith-1.rs @@ -28,6 +28,6 @@ pub fn main() { assert_eq!(i32_b << 1, i32_b << 1); assert_eq!(i32_b >> 1, i32_b >> 1); assert_eq!(i32_b & i32_b << 1, 0); - debug!(i32_b | i32_b << 1); + info!(i32_b | i32_b << 1); assert_eq!(i32_b | i32_b << 1, 0x30303030); } diff --git a/src/test/run-pass/auto-instantiate.rs b/src/test/run-pass/auto-instantiate.rs index 973f1dedea22a..184fef52c8c14 100644 --- a/src/test/run-pass/auto-instantiate.rs +++ b/src/test/run-pass/auto-instantiate.rs @@ -19,6 +19,6 @@ struct Triple { x: int, y: int, z: int } fn f(x: T, y: U) -> Pair { return Pair {a: x, b: y}; } pub fn main() { - debug!("%?", f(Triple {x: 3, y: 4, z: 5}, 4).a.x); - debug!("%?", f(5, 6).a); + info!("%?", f(Triple {x: 3, y: 4, z: 5}, 4).a.x); + info!("%?", f(5, 6).a); } diff --git a/src/test/run-pass/bitwise.rs b/src/test/run-pass/bitwise.rs index d3d1a1d12b269..49ff17317c8b0 100644 --- a/src/test/run-pass/bitwise.rs +++ b/src/test/run-pass/bitwise.rs @@ -27,8 +27,8 @@ fn general() { a ^= b; b ^= a; a = a ^ b; - debug!(a); - debug!(b); + info!(a); + info!(b); assert_eq!(b, 1); assert_eq!(a, 2); assert_eq!(!0xf0 & 0xff, 0xf); diff --git a/src/test/run-pass/borrowck-preserve-box-in-discr.rs b/src/test/run-pass/borrowck-preserve-box-in-discr.rs index 8434651dbbf9b..219e57a3e8ccb 100644 --- a/src/test/run-pass/borrowck-preserve-box-in-discr.rs +++ b/src/test/run-pass/borrowck-preserve-box-in-discr.rs @@ -23,7 +23,7 @@ pub fn main() { x = @F {f: ~4}; - debug!("ptr::to_unsafe_ptr(*b_x) = %x", + info!("ptr::to_unsafe_ptr(*b_x) = %x", ptr::to_unsafe_ptr(&(**b_x)) as uint); assert_eq!(**b_x, 3); assert!(ptr::to_unsafe_ptr(&(*x.f)) != ptr::to_unsafe_ptr(&(**b_x))); diff --git a/src/test/run-pass/borrowck-preserve-box-in-field.rs b/src/test/run-pass/borrowck-preserve-box-in-field.rs index 93ceeef37b375..a85ab027f2c92 100644 --- a/src/test/run-pass/borrowck-preserve-box-in-field.rs +++ b/src/test/run-pass/borrowck-preserve-box-in-field.rs @@ -28,7 +28,7 @@ pub fn main() { assert_eq!(ptr::to_unsafe_ptr(&(*x.f)), ptr::to_unsafe_ptr(&(*b_x))); x = @F {f: ~4}; - debug!("ptr::to_unsafe_ptr(*b_x) = %x", + info!("ptr::to_unsafe_ptr(*b_x) = %x", ptr::to_unsafe_ptr(&(*b_x)) as uint); assert_eq!(*b_x, 3); assert!(ptr::to_unsafe_ptr(&(*x.f)) != ptr::to_unsafe_ptr(&(*b_x))); diff --git a/src/test/run-pass/borrowck-preserve-box-in-pat.rs b/src/test/run-pass/borrowck-preserve-box-in-pat.rs index 1323ac0df5eab..8fad933281118 100644 --- a/src/test/run-pass/borrowck-preserve-box-in-pat.rs +++ b/src/test/run-pass/borrowck-preserve-box-in-pat.rs @@ -23,7 +23,7 @@ pub fn main() { *x = @F {f: ~4}; - debug!("ptr::to_unsafe_ptr(*b_x) = %x", + info!("ptr::to_unsafe_ptr(*b_x) = %x", ptr::to_unsafe_ptr(&(**b_x)) as uint); assert_eq!(**b_x, 3); assert!(ptr::to_unsafe_ptr(&(*x.f)) != ptr::to_unsafe_ptr(&(**b_x))); diff --git a/src/test/run-pass/borrowck-preserve-box-in-uniq.rs b/src/test/run-pass/borrowck-preserve-box-in-uniq.rs index dcecf77335a14..b25d731680133 100644 --- a/src/test/run-pass/borrowck-preserve-box-in-uniq.rs +++ b/src/test/run-pass/borrowck-preserve-box-in-uniq.rs @@ -28,7 +28,7 @@ pub fn main() { assert_eq!(ptr::to_unsafe_ptr(&(*x.f)), ptr::to_unsafe_ptr(&(*b_x))); *x = @F{f: ~4}; - debug!("ptr::to_unsafe_ptr(*b_x) = %x", + info!("ptr::to_unsafe_ptr(*b_x) = %x", ptr::to_unsafe_ptr(&(*b_x)) as uint); assert_eq!(*b_x, 3); assert!(ptr::to_unsafe_ptr(&(*x.f)) != ptr::to_unsafe_ptr(&(*b_x))); diff --git a/src/test/run-pass/borrowck-preserve-box.rs b/src/test/run-pass/borrowck-preserve-box.rs index 8bd8049ea1dac..ec57194cb4390 100644 --- a/src/test/run-pass/borrowck-preserve-box.rs +++ b/src/test/run-pass/borrowck-preserve-box.rs @@ -26,7 +26,7 @@ pub fn main() { assert_eq!(ptr::to_unsafe_ptr(&(*x)), ptr::to_unsafe_ptr(&(*b_x))); x = @22; - debug!("ptr::to_unsafe_ptr(*b_x) = %x", + info!("ptr::to_unsafe_ptr(*b_x) = %x", ptr::to_unsafe_ptr(&(*b_x)) as uint); assert_eq!(*b_x, 3); assert!(ptr::to_unsafe_ptr(&(*x)) != ptr::to_unsafe_ptr(&(*b_x))); diff --git a/src/test/run-pass/borrowck-preserve-cond-box.rs b/src/test/run-pass/borrowck-preserve-cond-box.rs index 4483c7fa4e9c5..e5cef1dbc0599 100644 --- a/src/test/run-pass/borrowck-preserve-cond-box.rs +++ b/src/test/run-pass/borrowck-preserve-cond-box.rs @@ -25,13 +25,13 @@ fn testfn(cond: bool) { exp = 4; } - debug!("*r = %d, exp = %d", *r, exp); + info!("*r = %d, exp = %d", *r, exp); assert_eq!(*r, exp); x = @5; y = @6; - debug!("*r = %d, exp = %d", *r, exp); + info!("*r = %d, exp = %d", *r, exp); assert_eq!(*r, exp); } diff --git a/src/test/run-pass/borrowck-preserve-expl-deref.rs b/src/test/run-pass/borrowck-preserve-expl-deref.rs index 6e683c79875d7..94b8f70b759fb 100644 --- a/src/test/run-pass/borrowck-preserve-expl-deref.rs +++ b/src/test/run-pass/borrowck-preserve-expl-deref.rs @@ -28,7 +28,7 @@ pub fn main() { assert_eq!(ptr::to_unsafe_ptr(&(*x.f)), ptr::to_unsafe_ptr(&(*b_x))); x = @F {f: ~4}; - debug!("ptr::to_unsafe_ptr(*b_x) = %x", + info!("ptr::to_unsafe_ptr(*b_x) = %x", ptr::to_unsafe_ptr(&(*b_x)) as uint); assert_eq!(*b_x, 3); assert!(ptr::to_unsafe_ptr(&(*x.f)) != ptr::to_unsafe_ptr(&(*b_x))); diff --git a/src/test/run-pass/box-unbox.rs b/src/test/run-pass/box-unbox.rs index f4fb10fea7248..2c45ec83d0030 100644 --- a/src/test/run-pass/box-unbox.rs +++ b/src/test/run-pass/box-unbox.rs @@ -17,6 +17,6 @@ fn unbox(b: Box) -> T { return copy *b.c; } pub fn main() { let foo: int = 17; let bfoo: Box = Box {c: @foo}; - debug!("see what's in our box"); + info!("see what's in our box"); assert_eq!(unbox::(bfoo), foo); } diff --git a/src/test/run-pass/cast-region-to-uint.rs b/src/test/run-pass/cast-region-to-uint.rs index 6a3424535b90c..7472e0ca73a6c 100644 --- a/src/test/run-pass/cast-region-to-uint.rs +++ b/src/test/run-pass/cast-region-to-uint.rs @@ -12,5 +12,5 @@ use std::borrow; pub fn main() { let x = 3; - debug!("&x=%x", borrow::to_uint(&x)); + info!("&x=%x", borrow::to_uint(&x)); } diff --git a/src/test/run-pass/cci_borrow.rs b/src/test/run-pass/cci_borrow.rs index 460d6136cafe0..c5fa8bba1a5de 100644 --- a/src/test/run-pass/cci_borrow.rs +++ b/src/test/run-pass/cci_borrow.rs @@ -17,6 +17,6 @@ use cci_borrow_lib::foo; pub fn main() { let p = @22u; let r = foo(p); - debug!("r=%u", r); + info!("r=%u", r); assert_eq!(r, 22u); } diff --git a/src/test/run-pass/cci_impl_exe.rs b/src/test/run-pass/cci_impl_exe.rs index 43d9db391d9eb..097184540fdfc 100644 --- a/src/test/run-pass/cci_impl_exe.rs +++ b/src/test/run-pass/cci_impl_exe.rs @@ -16,13 +16,13 @@ use cci_impl_lib::uint_helpers; pub fn main() { //let bt0 = sys::frame_address(); - //debug!("%?", bt0); + //info!("%?", bt0); do 3u.to(10u) |i| { print(fmt!("%u\n", i)); //let bt1 = sys::frame_address(); - //debug!("%?", bt1); + //info!("%?", bt1); //assert!(bt0 == bt1); } } diff --git a/src/test/run-pass/cci_iter_exe.rs b/src/test/run-pass/cci_iter_exe.rs index f9a2d78692998..a8c0583701380 100644 --- a/src/test/run-pass/cci_iter_exe.rs +++ b/src/test/run-pass/cci_iter_exe.rs @@ -15,7 +15,7 @@ extern mod cci_iter_lib; pub fn main() { //let bt0 = sys::rusti::frame_address(1u32); - //debug!("%?", bt0); + //info!("%?", bt0); do cci_iter_lib::iter(~[1, 2, 3]) |i| { print(fmt!("%d", *i)); //assert!(bt0 == sys::rusti::frame_address(2u32)); diff --git a/src/test/run-pass/cci_no_inline_exe.rs b/src/test/run-pass/cci_no_inline_exe.rs index 92d0e23589bc0..83a77ad987736 100644 --- a/src/test/run-pass/cci_no_inline_exe.rs +++ b/src/test/run-pass/cci_no_inline_exe.rs @@ -21,12 +21,12 @@ pub fn main() { // sys::frame_address() to determine if we are inlining is // actually working. //let bt0 = sys::frame_address(); - //debug!("%?", bt0); + //info!("%?", bt0); do iter(~[1u, 2u, 3u]) |i| { print(fmt!("%u\n", i)); //let bt1 = sys::frame_address(); - //debug!("%?", bt1); + //info!("%?", bt1); //assert!(bt0 != bt1); } diff --git a/src/test/run-pass/class-cast-to-trait-cross-crate-2.rs b/src/test/run-pass/class-cast-to-trait-cross-crate-2.rs index 393c9e2ece0f5..d81e6fc687811 100644 --- a/src/test/run-pass/class-cast-to-trait-cross-crate-2.rs +++ b/src/test/run-pass/class-cast-to-trait-cross-crate-2.rs @@ -16,7 +16,7 @@ use cci_class_cast::kitty::*; fn print_out(thing: @ToStr, expected: ~str) { let actual = thing.to_str(); - debug!("%s", actual); + info!("%s", actual); assert_eq!(actual, expected); } diff --git a/src/test/run-pass/class-cast-to-trait-multiple-types.rs b/src/test/run-pass/class-cast-to-trait-multiple-types.rs index 361cafc40a962..475915cf96425 100644 --- a/src/test/run-pass/class-cast-to-trait-multiple-types.rs +++ b/src/test/run-pass/class-cast-to-trait-multiple-types.rs @@ -22,7 +22,7 @@ struct dog { impl dog { priv fn bark(&self) -> int { - debug!("Woof %u %d", *self.barks, *self.volume); + info!("Woof %u %d", *self.barks, *self.volume); *self.barks += 1u; if *self.barks % 3u == 0u { *self.volume += 1; @@ -30,7 +30,7 @@ impl dog { if *self.barks % 10u == 0u { *self.volume -= 2; } - debug!("Grrr %u %d", *self.barks, *self.volume); + info!("Grrr %u %d", *self.barks, *self.volume); *self.volume } } @@ -63,7 +63,7 @@ impl cat { impl cat { fn meow(&self) -> uint { - debug!("Meow"); + info!("Meow"); *self.meows += 1u; if *self.meows % 5u == 0u { *self.how_hungry += 1; diff --git a/src/test/run-pass/class-implements-multiple-traits.rs b/src/test/run-pass/class-implements-multiple-traits.rs index 8565ab038413c..f7f1039d1b786 100644 --- a/src/test/run-pass/class-implements-multiple-traits.rs +++ b/src/test/run-pass/class-implements-multiple-traits.rs @@ -43,7 +43,7 @@ class cat : noisy, scratchy, bitey { let bite_counts : hashmap; fn meow() -> uint { - debug!("Meow: %u", *self.meows); + info!("Meow: %u", *self.meows); *self.meows += 1u; if *self.meows % 5u == 0u { *self.how_hungry += 1; @@ -84,12 +84,12 @@ class cat : noisy, scratchy, bitey { let all = ~[toe, nose, ear]; let mut min = finger; do iter(all) |next| { - debug!("min = %?", min); + info!("min = %?", min); if self.bite_counts.get(next) < self.bite_counts.get(min) { min = next; }}; self.bite_counts.insert(min, self.bite_counts.get(min) + 1u); - debug!("Bit %?", min); + info!("Bit %?", min); min } } @@ -97,7 +97,7 @@ class cat : noisy, scratchy, bitey { fn annoy_neighbors(critter: T) { for uint::range(0u, 10u) |i| { let what = critter.speak(); - debug!("%u %d", i, what); + info!("%u %d", i, what); } } @@ -105,7 +105,7 @@ fn bite_everything(critter: T) -> bool { let mut left : ~[body_part] = ~[finger, toe, nose, ear]; while left.len() > 0u { let part = critter.bite(); - debug!("%? %?", left, part); + info!("%? %?", left, part); if vec_includes(left, part) { left = vec::filter(left, |p| p != part ); } diff --git a/src/test/run-pass/class-separate-impl.rs b/src/test/run-pass/class-separate-impl.rs index f31b702519349..fcce5a73cf853 100644 --- a/src/test/run-pass/class-separate-impl.rs +++ b/src/test/run-pass/class-separate-impl.rs @@ -61,7 +61,7 @@ impl ToStr for cat { fn print_out(thing: @ToStr, expected: ~str) { let actual = thing.to_str(); - debug!("%s", actual); + info!("%s", actual); assert_eq!(actual, expected); } diff --git a/src/test/run-pass/close-over-big-then-small-data.rs b/src/test/run-pass/close-over-big-then-small-data.rs index 69da3c8d9862b..1fa102225436f 100644 --- a/src/test/run-pass/close-over-big-then-small-data.rs +++ b/src/test/run-pass/close-over-big-then-small-data.rs @@ -23,7 +23,7 @@ fn f(a: A, b: u16) -> @fn() -> (A, u16) { pub fn main() { let (a, b) = f(22_u64, 44u16)(); - debug!("a=%? b=%?", a, b); + info!("a=%? b=%?", a, b); assert_eq!(a, 22u64); assert_eq!(b, 44u16); } diff --git a/src/test/run-pass/complex.rs b/src/test/run-pass/complex.rs index 733e8466154fa..e01c7d32f85c6 100644 --- a/src/test/run-pass/complex.rs +++ b/src/test/run-pass/complex.rs @@ -37,7 +37,7 @@ fn foo(x: int) -> int { pub fn main() { let x: int = 2 + 2; - debug!("%?", x); - debug!("hello, world"); - debug!("%?", 10); + info!("%?", x); + info!("hello, world"); + info!("%?", 10); } diff --git a/src/test/run-pass/const.rs b/src/test/run-pass/const.rs index d9d84c3fd5048..402277c19b3c1 100644 --- a/src/test/run-pass/const.rs +++ b/src/test/run-pass/const.rs @@ -12,4 +12,4 @@ static i: int = 10; -pub fn main() { debug!("%i", i); } +pub fn main() { info!("%i", i); } diff --git a/src/test/run-pass/core-rt-smoke.rs b/src/test/run-pass/core-rt-smoke.rs index 5873e7c746028..10bd013b618bc 100644 --- a/src/test/run-pass/core-rt-smoke.rs +++ b/src/test/run-pass/core-rt-smoke.rs @@ -15,6 +15,6 @@ #[start] fn start(argc: int, argv: **u8, crate_map: *u8) -> int { do std::rt::start(argc, argv, crate_map) { - debug!("creating my own runtime is joy"); + info!("creating my own runtime is joy"); } } diff --git a/src/test/run-pass/dead-code-one-arm-if.rs b/src/test/run-pass/dead-code-one-arm-if.rs index eb30b36e48a3d..2749fc31ceab7 100644 --- a/src/test/run-pass/dead-code-one-arm-if.rs +++ b/src/test/run-pass/dead-code-one-arm-if.rs @@ -12,4 +12,4 @@ // -*- rust -*- -pub fn main() { if 1 == 1 { return; } debug!("Paul is dead"); } +pub fn main() { if 1 == 1 { return; } info!("Paul is dead"); } diff --git a/src/test/run-pass/deref-lval.rs b/src/test/run-pass/deref-lval.rs index 6841c4d7f631b..e2f615b3ed2b5 100644 --- a/src/test/run-pass/deref-lval.rs +++ b/src/test/run-pass/deref-lval.rs @@ -10,4 +10,4 @@ -pub fn main() { let x = @mut 5; *x = 1000; debug!("%?", *x); } +pub fn main() { let x = @mut 5; *x = 1000; info!("%?", *x); } diff --git a/src/test/run-pass/estr-slice.rs b/src/test/run-pass/estr-slice.rs index a851141322f00..268b6974d7f6c 100644 --- a/src/test/run-pass/estr-slice.rs +++ b/src/test/run-pass/estr-slice.rs @@ -14,8 +14,8 @@ pub fn main() { let v = &"hello"; let mut y : &str = &"there"; - debug!(x); - debug!(y); + info!(x); + info!(y); assert_eq!(x[0], 'h' as u8); assert_eq!(x[4], 'o' as u8); @@ -30,7 +30,7 @@ pub fn main() { let c = &"cccc"; let cc = &"ccccc"; - debug!(a); + info!(a); assert!(a < b); assert!(a <= b); @@ -38,7 +38,7 @@ pub fn main() { assert!(b >= a); assert!(b > a); - debug!(b); + info!(b); assert!(a < c); assert!(a <= c); @@ -46,7 +46,7 @@ pub fn main() { assert!(c >= a); assert!(c > a); - debug!(c); + info!(c); assert!(c < cc); assert!(c <= cc); @@ -54,5 +54,5 @@ pub fn main() { assert!(cc >= c); assert!(cc > c); - debug!(cc); + info!(cc); } diff --git a/src/test/run-pass/evec-slice.rs b/src/test/run-pass/evec-slice.rs index 194560ab127b1..38891d35e8e6c 100644 --- a/src/test/run-pass/evec-slice.rs +++ b/src/test/run-pass/evec-slice.rs @@ -20,7 +20,7 @@ pub fn main() { let c : &[int] = &[2,2,2,2,3]; let cc : &[int] = &[2,2,2,2,2,2]; - debug!(a); + info!(a); assert!(a < b); assert!(a <= b); @@ -28,7 +28,7 @@ pub fn main() { assert!(b >= a); assert!(b > a); - debug!(b); + info!(b); assert!(b < c); assert!(b <= c); @@ -42,7 +42,7 @@ pub fn main() { assert!(c >= a); assert!(c > a); - debug!(c); + info!(c); assert!(a < cc); assert!(a <= cc); @@ -50,5 +50,5 @@ pub fn main() { assert!(cc >= a); assert!(cc > a); - debug!(cc); + info!(cc); } diff --git a/src/test/run-pass/export-non-interference2.rs b/src/test/run-pass/export-non-interference2.rs index 9889b559bcab4..95d61e08eb89c 100644 --- a/src/test/run-pass/export-non-interference2.rs +++ b/src/test/run-pass/export-non-interference2.rs @@ -13,7 +13,7 @@ mod foo { pub fn y() { super::super::foo::x(); } } - pub fn x() { debug!("x"); } + pub fn x() { info!("x"); } } pub fn main() { self::foo::bar::y(); } diff --git a/src/test/run-pass/export-non-interference3.rs b/src/test/run-pass/export-non-interference3.rs index 36c9fe6cf42aa..e2af3121f16e1 100644 --- a/src/test/run-pass/export-non-interference3.rs +++ b/src/test/run-pass/export-non-interference3.rs @@ -15,7 +15,7 @@ pub mod foo { } pub mod bar { - pub fn x() { debug!("x"); } + pub fn x() { info!("x"); } } pub fn main() { foo::x(); } diff --git a/src/test/run-pass/expr-block-generic-box1.rs b/src/test/run-pass/expr-block-generic-box1.rs index 5cd8d649e99a2..2c9021818105f 100644 --- a/src/test/run-pass/expr-block-generic-box1.rs +++ b/src/test/run-pass/expr-block-generic-box1.rs @@ -21,8 +21,8 @@ fn test_generic(expected: @T, eq: compare) { fn test_box() { fn compare_box(b1: @bool, b2: @bool) -> bool { - debug!(*b1); - debug!(*b2); + info!(*b1); + info!(*b2); return *b1 == *b2; } test_generic::(@true, compare_box); diff --git a/src/test/run-pass/expr-block-generic-unique1.rs b/src/test/run-pass/expr-block-generic-unique1.rs index d00e9b7a78db2..679210351bd1f 100644 --- a/src/test/run-pass/expr-block-generic-unique1.rs +++ b/src/test/run-pass/expr-block-generic-unique1.rs @@ -20,8 +20,8 @@ fn test_generic(expected: ~T, eq: compare) { fn test_box() { fn compare_box(b1: ~bool, b2: ~bool) -> bool { - debug!(*b1); - debug!(*b2); + info!(*b1); + info!(*b2); return *b1 == *b2; } test_generic::(~true, compare_box); diff --git a/src/test/run-pass/extern-call-deep.rs b/src/test/run-pass/extern-call-deep.rs index 9a50c2ceb02c2..63d616d43495b 100644 --- a/src/test/run-pass/extern-call-deep.rs +++ b/src/test/run-pass/extern-call-deep.rs @@ -29,13 +29,13 @@ extern fn cb(data: libc::uintptr_t) -> libc::uintptr_t { fn count(n: uint) -> uint { unsafe { - debug!("n = %?", n); + info!("n = %?", n); rustrt::rust_dbg_call(cb, n) } } pub fn main() { let result = count(1000u); - debug!("result = %?", result); + info!("result = %?", result); assert_eq!(result, 1000u); } diff --git a/src/test/run-pass/extern-call-deep2.rs b/src/test/run-pass/extern-call-deep2.rs index c4ccf645be4f4..58ad044dfa3ce 100644 --- a/src/test/run-pass/extern-call-deep2.rs +++ b/src/test/run-pass/extern-call-deep2.rs @@ -30,7 +30,7 @@ extern fn cb(data: libc::uintptr_t) -> libc::uintptr_t { fn count(n: uint) -> uint { unsafe { - debug!("n = %?", n); + info!("n = %?", n); rustrt::rust_dbg_call(cb, n) } } @@ -40,7 +40,7 @@ pub fn main() { // has a large stack) do task::spawn { let result = count(1000u); - debug!("result = %?", result); + info!("result = %?", result); assert_eq!(result, 1000u); }; } diff --git a/src/test/run-pass/extern-call-scrub.rs b/src/test/run-pass/extern-call-scrub.rs index e0f352a81efa0..cde0006afce5b 100644 --- a/src/test/run-pass/extern-call-scrub.rs +++ b/src/test/run-pass/extern-call-scrub.rs @@ -34,7 +34,7 @@ extern fn cb(data: libc::uintptr_t) -> libc::uintptr_t { fn count(n: uint) -> uint { unsafe { - debug!("n = %?", n); + info!("n = %?", n); rustrt::rust_dbg_call(cb, n) } } @@ -44,7 +44,7 @@ pub fn main() { // has a large stack) do task::spawn { let result = count(12u); - debug!("result = %?", result); + info!("result = %?", result); assert_eq!(result, 2048u); }; } diff --git a/src/test/run-pass/extern-call.rs b/src/test/run-pass/extern-call.rs index 4c36090015b89..1d2ee22b89f51 100644 --- a/src/test/run-pass/extern-call.rs +++ b/src/test/run-pass/extern-call.rs @@ -29,13 +29,13 @@ extern fn cb(data: libc::uintptr_t) -> libc::uintptr_t { fn fact(n: uint) -> uint { unsafe { - debug!("n = %?", n); + info!("n = %?", n); rustrt::rust_dbg_call(cb, n) } } pub fn main() { let result = fact(10u); - debug!("result = %?", result); + info!("result = %?", result); assert_eq!(result, 3628800u); } diff --git a/src/test/run-pass/extern-crosscrate.rs b/src/test/run-pass/extern-crosscrate.rs index eb21e19954962..97bbd3478a1a5 100644 --- a/src/test/run-pass/extern-crosscrate.rs +++ b/src/test/run-pass/extern-crosscrate.rs @@ -15,13 +15,13 @@ extern mod externcallback(vers = "0.1"); fn fact(n: uint) -> uint { unsafe { - debug!("n = %?", n); + info!("n = %?", n); externcallback::rustrt::rust_dbg_call(externcallback::cb, n) } } pub fn main() { let result = fact(10u); - debug!("result = %?", result); + info!("result = %?", result); assert_eq!(result, 3628800u); } diff --git a/src/test/run-pass/extern-yield.rs b/src/test/run-pass/extern-yield.rs index 75e259a38c130..cdf236fcb9ef3 100644 --- a/src/test/run-pass/extern-yield.rs +++ b/src/test/run-pass/extern-yield.rs @@ -39,7 +39,7 @@ pub fn main() { for 10u.times { do task::spawn { let result = count(5u); - debug!("result = %?", result); + info!("result = %?", result); assert_eq!(result, 16u); }; } diff --git a/src/test/run-pass/fact.rs b/src/test/run-pass/fact.rs index cbcf9a6bef4fa..ff651effc8d4d 100644 --- a/src/test/run-pass/fact.rs +++ b/src/test/run-pass/fact.rs @@ -13,26 +13,26 @@ // -*- rust -*- fn f(x: int) -> int { - // debug!("in f:"); + // info!("in f:"); - debug!(x); + info!(x); if x == 1 { - // debug!("bottoming out"); + // info!("bottoming out"); return 1; } else { - // debug!("recurring"); + // info!("recurring"); let y: int = x * f(x - 1); - // debug!("returned"); + // info!("returned"); - debug!(y); + info!(y); return y; } } pub fn main() { assert_eq!(f(5), 120); - // debug!("all done"); + // info!("all done"); } diff --git a/src/test/run-pass/float-signature.rs b/src/test/run-pass/float-signature.rs index 7d4c3db242da7..f6a9e05d81803 100644 --- a/src/test/run-pass/float-signature.rs +++ b/src/test/run-pass/float-signature.rs @@ -14,5 +14,5 @@ pub fn main() { fn foo(n: float) -> float { return n + 0.12345; } let n: float = 0.1; let m: float = foo(n); - debug!(m); + info!(m); } diff --git a/src/test/run-pass/float.rs b/src/test/run-pass/float.rs index 1c2d7f42264a5..a9f1555ade419 100644 --- a/src/test/run-pass/float.rs +++ b/src/test/run-pass/float.rs @@ -12,9 +12,9 @@ pub fn main() { let pi = 3.1415927; - debug!(-pi * (pi + 2.0 / pi) - pi * 5.0); + info!(-pi * (pi + 2.0 / pi) - pi * 5.0); if pi == 5.0 || pi < 10.0 || pi <= 2.0 || pi != 22.0 / 7.0 || pi >= 10.0 || pi > 1.0 { - debug!("yes"); + info!("yes"); } } diff --git a/src/test/run-pass/fn-bare-item.rs b/src/test/run-pass/fn-bare-item.rs index 85203c185443e..e01c7ee998c31 100644 --- a/src/test/run-pass/fn-bare-item.rs +++ b/src/test/run-pass/fn-bare-item.rs @@ -9,7 +9,7 @@ // except according to those terms. fn f() { - debug!("This is a bare function"); + info!("This is a bare function"); } pub fn main() { diff --git a/src/test/run-pass/foreach-put-structured.rs b/src/test/run-pass/foreach-put-structured.rs index d52842b4101ee..bd3799e47e1e5 100644 --- a/src/test/run-pass/foreach-put-structured.rs +++ b/src/test/run-pass/foreach-put-structured.rs @@ -21,8 +21,8 @@ pub fn main() { let mut j: int = 0; do pairs() |p| { let (_0, _1) = p; - debug!(_0); - debug!(_1); + info!(_0); + info!(_1); assert_eq!(_0 + 10, i); i += 1; j = _1; diff --git a/src/test/run-pass/foreach-simple-outer-slot.rs b/src/test/run-pass/foreach-simple-outer-slot.rs index c3120c44c3715..9292c11570587 100644 --- a/src/test/run-pass/foreach-simple-outer-slot.rs +++ b/src/test/run-pass/foreach-simple-outer-slot.rs @@ -14,13 +14,13 @@ // -*- rust -*- pub fn main() { let mut sum: int = 0; - do first_ten |i| { debug!("main"); debug!(i); sum = sum + i; } - debug!("sum"); - debug!(sum); + do first_ten |i| { info!("main"); info!(i); sum = sum + i; } + info!("sum"); + info!(sum); assert_eq!(sum, 45); } fn first_ten(it: &fn(int)) { let mut i: int = 0; - while i < 10 { debug!("first_ten"); it(i); i = i + 1; } + while i < 10 { info!("first_ten"); it(i); i = i + 1; } } diff --git a/src/test/run-pass/generic-alias-box.rs b/src/test/run-pass/generic-alias-box.rs index bce65161921b6..efb514caba95b 100644 --- a/src/test/run-pass/generic-alias-box.rs +++ b/src/test/run-pass/generic-alias-box.rs @@ -15,6 +15,6 @@ fn id(t: T) -> T { return t; } pub fn main() { let expected = @100; let actual = id::<@int>(expected); - debug!(*actual); + info!(*actual); assert_eq!(*expected, *actual); } diff --git a/src/test/run-pass/generic-alias-unique.rs b/src/test/run-pass/generic-alias-unique.rs index 815cc1bc79bcd..203adf81cecd1 100644 --- a/src/test/run-pass/generic-alias-unique.rs +++ b/src/test/run-pass/generic-alias-unique.rs @@ -15,6 +15,6 @@ fn id(t: T) -> T { return t; } pub fn main() { let expected = ~100; let actual = id::<~int>(expected.clone()); - debug!(*actual); + info!(*actual); assert_eq!(*expected, *actual); } diff --git a/src/test/run-pass/generic-derived-type.rs b/src/test/run-pass/generic-derived-type.rs index 649fe3433b46c..8d31c3d2481b3 100644 --- a/src/test/run-pass/generic-derived-type.rs +++ b/src/test/run-pass/generic-derived-type.rs @@ -21,8 +21,8 @@ fn f(t: T) -> Pair { pub fn main() { let b = f::(10); - debug!(b.a); - debug!(b.b); + info!(b.a); + info!(b.b); assert_eq!(b.a, 10); assert_eq!(b.b, 10); } diff --git a/src/test/run-pass/generic-fn-box.rs b/src/test/run-pass/generic-fn-box.rs index 85d8198049f1d..97905449fbef0 100644 --- a/src/test/run-pass/generic-fn-box.rs +++ b/src/test/run-pass/generic-fn-box.rs @@ -12,4 +12,4 @@ fn f(x: @T) -> @T { return x; } -pub fn main() { let x = f(@3); debug!(*x); } +pub fn main() { let x = f(@3); info!(*x); } diff --git a/src/test/run-pass/generic-fn-unique.rs b/src/test/run-pass/generic-fn-unique.rs index 9892c935658e2..bf4729a058944 100644 --- a/src/test/run-pass/generic-fn-unique.rs +++ b/src/test/run-pass/generic-fn-unique.rs @@ -11,4 +11,4 @@ fn f(x: ~T) -> ~T { return x; } -pub fn main() { let x = f(~3); debug!(*x); } +pub fn main() { let x = f(~3); info!(*x); } diff --git a/src/test/run-pass/generic-fn.rs b/src/test/run-pass/generic-fn.rs index bcacccee820be..e5e6beb8c706e 100644 --- a/src/test/run-pass/generic-fn.rs +++ b/src/test/run-pass/generic-fn.rs @@ -24,14 +24,14 @@ pub fn main() { let p: Triple = Triple {x: 65, y: 66, z: 67}; let mut q: Triple = Triple {x: 68, y: 69, z: 70}; y = id::(x); - debug!(y); + info!(y); assert_eq!(x, y); b = id::(a); - debug!(b); + info!(b); assert_eq!(a, b); q = id::(p); x = p.z; y = q.z; - debug!(y); + info!(y); assert_eq!(x, y); } diff --git a/src/test/run-pass/generic-tag-match.rs b/src/test/run-pass/generic-tag-match.rs index 752dded83c44c..55b527989de53 100644 --- a/src/test/run-pass/generic-tag-match.rs +++ b/src/test/run-pass/generic-tag-match.rs @@ -14,7 +14,7 @@ enum foo { arm(T), } fn altfoo(f: foo) { let mut hit = false; - match f { arm::(x) => { debug!("in arm"); hit = true; } } + match f { arm::(x) => { info!("in arm"); hit = true; } } assert!((hit)); } diff --git a/src/test/run-pass/generic-tag-values.rs b/src/test/run-pass/generic-tag-values.rs index eced9a7074298..d132eb5d5a96d 100644 --- a/src/test/run-pass/generic-tag-values.rs +++ b/src/test/run-pass/generic-tag-values.rs @@ -18,12 +18,12 @@ struct Pair { x: int, y: int } pub fn main() { let nop: noption = some::(5); - match nop { some::(n) => { debug!(n); assert!((n == 5)); } } + match nop { some::(n) => { info!(n); assert!((n == 5)); } } let nop2: noption = some(Pair{x: 17, y: 42}); match nop2 { some(t) => { - debug!(t.x); - debug!(t.y); + info!(t.x); + info!(t.y); assert_eq!(t.x, 17); assert_eq!(t.y, 42); } diff --git a/src/test/run-pass/generic-temporary.rs b/src/test/run-pass/generic-temporary.rs index cd5944ca0f10d..82c8a3e85c689 100644 --- a/src/test/run-pass/generic-temporary.rs +++ b/src/test/run-pass/generic-temporary.rs @@ -12,7 +12,7 @@ fn mk() -> int { return 1; } -fn chk(a: int) { debug!(a); assert!((a == 1)); } +fn chk(a: int) { info!(a); assert!((a == 1)); } fn apply(produce: extern fn() -> T, consume: extern fn(T)) { diff --git a/src/test/run-pass/generic-tup.rs b/src/test/run-pass/generic-tup.rs index 485b9a78488e4..d09996cc2dae5 100644 --- a/src/test/run-pass/generic-tup.rs +++ b/src/test/run-pass/generic-tup.rs @@ -11,7 +11,7 @@ fn get_third(t: (T, T, T)) -> T { let (_, _, x) = t; return x; } pub fn main() { - debug!(get_third((1, 2, 3))); + info!(get_third((1, 2, 3))); assert_eq!(get_third((1, 2, 3)), 3); assert_eq!(get_third((5u8, 6u8, 7u8)), 7u8); } diff --git a/src/test/run-pass/if-bot.rs b/src/test/run-pass/if-bot.rs index 8f00b16ccd9f5..125ea295e65aa 100644 --- a/src/test/run-pass/if-bot.rs +++ b/src/test/run-pass/if-bot.rs @@ -12,5 +12,5 @@ pub fn main() { let i: int = if false { fail!() } else { 5 }; - debug!(i); + info!(i); } diff --git a/src/test/run-pass/if-check.rs b/src/test/run-pass/if-check.rs index 5c72de87ccbef..3fb45f82f57dc 100644 --- a/src/test/run-pass/if-check.rs +++ b/src/test/run-pass/if-check.rs @@ -16,7 +16,7 @@ fn even(x: uint) -> bool { fn foo(x: uint) { if even(x) { - debug!(x); + info!(x); } else { fail!(); } diff --git a/src/test/run-pass/import-glob-0.rs b/src/test/run-pass/import-glob-0.rs index 5576824e13a64..378bc25eaf6ad 100644 --- a/src/test/run-pass/import-glob-0.rs +++ b/src/test/run-pass/import-glob-0.rs @@ -14,10 +14,10 @@ use module_of_many_things::*; use dug::too::greedily::and::too::deep::*; mod module_of_many_things { - pub fn f1() { debug!("f1"); } - pub fn f2() { debug!("f2"); } - fn f3() { debug!("f3"); } - pub fn f4() { debug!("f4"); } + pub fn f1() { info!("f1"); } + pub fn f2() { info!("f2"); } + fn f3() { info!("f3"); } + pub fn f4() { info!("f4"); } } mod dug { @@ -26,8 +26,8 @@ mod dug { pub mod and { pub mod too { pub mod deep { - pub fn nameless_fear() { debug!("Boo!"); } - pub fn also_redstone() { debug!("Whatever."); } + pub fn nameless_fear() { info!("Boo!"); } + pub fn also_redstone() { info!("Whatever."); } } } } diff --git a/src/test/run-pass/import.rs b/src/test/run-pass/import.rs index 317082b1d820d..dcbe038c65af4 100644 --- a/src/test/run-pass/import.rs +++ b/src/test/run-pass/import.rs @@ -11,7 +11,7 @@ // except according to those terms. mod foo { - pub fn x(y: int) { debug!(y); } + pub fn x(y: int) { info!(y); } } mod bar { diff --git a/src/test/run-pass/import2.rs b/src/test/run-pass/import2.rs index 7383d818ee704..9cda55f508408 100644 --- a/src/test/run-pass/import2.rs +++ b/src/test/run-pass/import2.rs @@ -14,7 +14,7 @@ use zed::bar; mod zed { - pub fn bar() { debug!("bar"); } + pub fn bar() { info!("bar"); } } pub fn main() { bar(); } diff --git a/src/test/run-pass/import3.rs b/src/test/run-pass/import3.rs index 972a366973171..8e53affd2dd36 100644 --- a/src/test/run-pass/import3.rs +++ b/src/test/run-pass/import3.rs @@ -16,7 +16,7 @@ use baz::zed::bar; mod baz { pub mod zed { - pub fn bar() { debug!("bar2"); } + pub fn bar() { info!("bar2"); } } } diff --git a/src/test/run-pass/import4.rs b/src/test/run-pass/import4.rs index 41ed3549684f5..d52877fa11db9 100644 --- a/src/test/run-pass/import4.rs +++ b/src/test/run-pass/import4.rs @@ -14,7 +14,7 @@ use zed::bar; mod zed { - pub fn bar() { debug!("bar"); } + pub fn bar() { info!("bar"); } } pub fn main() { let zed = 42; bar(); } diff --git a/src/test/run-pass/import5.rs b/src/test/run-pass/import5.rs index 14061edc166a4..e9539b290ae1d 100644 --- a/src/test/run-pass/import5.rs +++ b/src/test/run-pass/import5.rs @@ -14,7 +14,7 @@ use foo::bar; mod foo { pub use foo::zed::bar; pub mod zed { - pub fn bar() { debug!("foo"); } + pub fn bar() { info!("foo"); } } } diff --git a/src/test/run-pass/import6.rs b/src/test/run-pass/import6.rs index bbdbdd54f91f6..296b0c605d625 100644 --- a/src/test/run-pass/import6.rs +++ b/src/test/run-pass/import6.rs @@ -14,7 +14,7 @@ use foo::zed; use bar::baz; mod foo { pub mod zed { - pub fn baz() { debug!("baz"); } + pub fn baz() { info!("baz"); } } } mod bar { diff --git a/src/test/run-pass/import7.rs b/src/test/run-pass/import7.rs index 4c6cc3458c43b..969d2b176cfb2 100644 --- a/src/test/run-pass/import7.rs +++ b/src/test/run-pass/import7.rs @@ -14,7 +14,7 @@ use foo::zed; use bar::baz; mod foo { pub mod zed { - pub fn baz() { debug!("baz"); } + pub fn baz() { info!("baz"); } } } mod bar { diff --git a/src/test/run-pass/import8.rs b/src/test/run-pass/import8.rs index 869e61d0d4cd0..849522ab6e599 100644 --- a/src/test/run-pass/import8.rs +++ b/src/test/run-pass/import8.rs @@ -15,7 +15,7 @@ use foo::x; use z = foo::x; mod foo { - pub fn x(y: int) { debug!(y); } + pub fn x(y: int) { info!(y); } } pub fn main() { x(10); z(10); } diff --git a/src/test/run-pass/inner-module.rs b/src/test/run-pass/inner-module.rs index 042988c916f18..1e53dd849fc8f 100644 --- a/src/test/run-pass/inner-module.rs +++ b/src/test/run-pass/inner-module.rs @@ -14,7 +14,7 @@ // -*- rust -*- mod inner { pub mod inner2 { - pub fn hello() { debug!("hello, modular world"); } + pub fn hello() { info!("hello, modular world"); } } pub fn hello() { inner2::hello(); } } diff --git a/src/test/run-pass/integral-indexing.rs b/src/test/run-pass/integral-indexing.rs index b985ed0f6cb6a..1915e8ac800a7 100644 --- a/src/test/run-pass/integral-indexing.rs +++ b/src/test/run-pass/integral-indexing.rs @@ -20,11 +20,11 @@ pub fn main() { assert_eq!(v[3i8], 3); assert_eq!(v[3u32], 3); assert_eq!(v[3i32], 3); - debug!(v[3u8]); + info!(v[3u8]); assert_eq!(s[3u], 'd' as u8); assert_eq!(s[3u8], 'd' as u8); assert_eq!(s[3i8], 'd' as u8); assert_eq!(s[3u32], 'd' as u8); assert_eq!(s[3i32], 'd' as u8); - debug!(s[3u8]); + info!(s[3u8]); } diff --git a/src/test/run-pass/issue-6344-let.rs b/src/test/run-pass/issue-6344-let.rs index bb0c71d6d55c5..ef1349c234452 100644 --- a/src/test/run-pass/issue-6344-let.rs +++ b/src/test/run-pass/issue-6344-let.rs @@ -18,5 +18,5 @@ fn main() { let a = A { x: 0 }; let A { x: ref x } = a; - debug!("%?", x) + info!("%?", x) } diff --git a/src/test/run-pass/issue-6344-match.rs b/src/test/run-pass/issue-6344-match.rs index 7987f9689faeb..4b1d274c40df9 100644 --- a/src/test/run-pass/issue-6344-match.rs +++ b/src/test/run-pass/issue-6344-match.rs @@ -18,7 +18,7 @@ fn main() { match a { A { x : ref x } => { - debug!("%?", x) + info!("%?", x) } } } diff --git a/src/test/run-pass/istr.rs b/src/test/run-pass/istr.rs index ab89a357d349c..66ad233866afa 100644 --- a/src/test/run-pass/istr.rs +++ b/src/test/run-pass/istr.rs @@ -10,7 +10,7 @@ fn test_stack_assign() { let s: ~str = ~"a"; - debug!(s.clone()); + info!(s.clone()); let t: ~str = ~"a"; assert!(s == t); let u: ~str = ~"b"; @@ -27,7 +27,7 @@ fn test_heap_assign() { assert!((s != u)); } -fn test_heap_log() { let s = ~"a big ol' string"; debug!(s); } +fn test_heap_log() { let s = ~"a big ol' string"; info!(s); } fn test_stack_add() { assert_eq!(~"a" + ~"b", ~"ab"); @@ -49,7 +49,7 @@ fn test_append() { let mut s = ~"a"; s.push_str(~"b"); - debug!(s.clone()); + info!(s.clone()); assert_eq!(s, ~"ab"); let mut s = ~"c"; diff --git a/src/test/run-pass/iter-range.rs b/src/test/run-pass/iter-range.rs index 0fbca65e6fb23..51499e85590e5 100644 --- a/src/test/run-pass/iter-range.rs +++ b/src/test/run-pass/iter-range.rs @@ -19,5 +19,5 @@ fn range(a: int, b: int, it: &fn(int)) { pub fn main() { let mut sum: int = 0; range(0, 100, |x| sum += x ); - debug!(sum); + info!(sum); } diff --git a/src/test/run-pass/lazy-and-or.rs b/src/test/run-pass/lazy-and-or.rs index 74febe6ff7dcd..6dc1063aed8c2 100644 --- a/src/test/run-pass/lazy-and-or.rs +++ b/src/test/run-pass/lazy-and-or.rs @@ -16,7 +16,7 @@ pub fn main() { let x = 1 == 2 || 3 == 3; assert!((x)); let mut y: int = 10; - debug!(x || incr(&mut y)); + info!(x || incr(&mut y)); assert_eq!(y, 10); if true && x { assert!((true)); } else { assert!((false)); } } diff --git a/src/test/run-pass/lazy-init.rs b/src/test/run-pass/lazy-init.rs index 37208bf145ba0..33cccacaf9090 100644 --- a/src/test/run-pass/lazy-init.rs +++ b/src/test/run-pass/lazy-init.rs @@ -10,6 +10,6 @@ -fn foo(x: int) { debug!(x); } +fn foo(x: int) { info!(x); } pub fn main() { let mut x: int; if 1 > 2 { x = 12; } else { x = 10; } foo(x); } diff --git a/src/test/run-pass/linear-for-loop.rs b/src/test/run-pass/linear-for-loop.rs index 71b87b3311baa..95d5483a72ade 100644 --- a/src/test/run-pass/linear-for-loop.rs +++ b/src/test/run-pass/linear-for-loop.rs @@ -11,8 +11,8 @@ pub fn main() { let x = ~[1, 2, 3]; let mut y = 0; - for x.iter().advance |i| { debug!(*i); y += *i; } - debug!(y); + for x.iter().advance |i| { info!(*i); y += *i; } + info!(y); assert_eq!(y, 6); let s = ~"hello there"; let mut i: int = 0; @@ -25,8 +25,8 @@ pub fn main() { // ... i += 1; - debug!(i); - debug!(c); + info!(i); + info!(c); } assert_eq!(i, 11); } diff --git a/src/test/run-pass/liveness-loop-break.rs b/src/test/run-pass/liveness-loop-break.rs index 7a379d10ff993..b539429b07971 100644 --- a/src/test/run-pass/liveness-loop-break.rs +++ b/src/test/run-pass/liveness-loop-break.rs @@ -14,7 +14,7 @@ fn test() { v = 3; break; } - debug!("%d", v); + info!("%d", v); } pub fn main() { diff --git a/src/test/run-pass/log-poly.rs b/src/test/run-pass/log-poly.rs index 0ae1edeed5007..08ff87df1b97b 100644 --- a/src/test/run-pass/log-poly.rs +++ b/src/test/run-pass/log-poly.rs @@ -13,7 +13,7 @@ enum Numbers { } pub fn main() { - debug!(1); + info!(1); info!(2.0); warn!(Three); error!(~[4]); diff --git a/src/test/run-pass/match-bot.rs b/src/test/run-pass/match-bot.rs index 78892a1e4b849..29087be8af6e9 100644 --- a/src/test/run-pass/match-bot.rs +++ b/src/test/run-pass/match-bot.rs @@ -12,5 +12,5 @@ pub fn main() { let i: int = match Some::(3) { None:: => { fail!() } Some::(_) => { 5 } }; - debug!("%?", i); + info!("%?", i); } diff --git a/src/test/run-pass/match-join.rs b/src/test/run-pass/match-join.rs index 5ac62bae39224..0f01985f274ad 100644 --- a/src/test/run-pass/match-join.rs +++ b/src/test/run-pass/match-join.rs @@ -28,4 +28,4 @@ fn foo(y: Option) { return; } -pub fn main() { debug!("hello"); foo::(Some::(5)); } +pub fn main() { info!("hello"); foo::(Some::(5)); } diff --git a/src/test/run-pass/match-pattern-drop.rs b/src/test/run-pass/match-pattern-drop.rs index 3ce4ef8a94cd5..b8fa09ca63f03 100644 --- a/src/test/run-pass/match-pattern-drop.rs +++ b/src/test/run-pass/match-pattern-drop.rs @@ -14,20 +14,20 @@ enum t { make_t(@int), clam, } fn foo(s: @int) { - debug!(::std::sys::refcount(s)); + info!(::std::sys::refcount(s)); let count = ::std::sys::refcount(s); let x: t = make_t(s); // ref up assert_eq!(::std::sys::refcount(s), count + 1u); - debug!(::std::sys::refcount(s)); + info!(::std::sys::refcount(s)); match x { make_t(y) => { - debug!("%?", y); // ref up then down + info!("%?", y); // ref up then down } - _ => { debug!("?"); fail!(); } + _ => { info!("?"); fail!(); } } - debug!(::std::sys::refcount(s)); + info!(::std::sys::refcount(s)); assert_eq!(::std::sys::refcount(s), count + 1u); let _ = ::std::sys::refcount(s); // don't get bitten by last-use. } @@ -39,7 +39,7 @@ pub fn main() { foo(s); // ref up then down - debug!("%u", ::std::sys::refcount(s)); + info!("%u", ::std::sys::refcount(s)); let count2 = ::std::sys::refcount(s); assert_eq!(count, count2); } diff --git a/src/test/run-pass/match-pattern-lit.rs b/src/test/run-pass/match-pattern-lit.rs index 3e01253094b07..84e9012be4e24 100644 --- a/src/test/run-pass/match-pattern-lit.rs +++ b/src/test/run-pass/match-pattern-lit.rs @@ -12,8 +12,8 @@ fn altlit(f: int) -> int { match f { - 10 => { debug!("case 10"); return 20; } - 11 => { debug!("case 11"); return 22; } + 10 => { info!("case 10"); return 20; } + 11 => { info!("case 11"); return 22; } _ => fail!("the impossible happened") } } diff --git a/src/test/run-pass/match-unique-bind.rs b/src/test/run-pass/match-unique-bind.rs index 997cc1ee9ff9d..9d62bc57ace92 100644 --- a/src/test/run-pass/match-unique-bind.rs +++ b/src/test/run-pass/match-unique-bind.rs @@ -11,7 +11,7 @@ pub fn main() { match ~100 { ~x => { - debug!("%?", x); + info!("%?", x); assert_eq!(x, 100); } } diff --git a/src/test/run-pass/mutable-alias-vec.rs b/src/test/run-pass/mutable-alias-vec.rs index 538aedcf7c887..da96e14695246 100644 --- a/src/test/run-pass/mutable-alias-vec.rs +++ b/src/test/run-pass/mutable-alias-vec.rs @@ -23,6 +23,6 @@ pub fn main() { grow(&mut v); grow(&mut v); let len = v.len(); - debug!(len); + info!(len); assert_eq!(len, 3 as uint); } diff --git a/src/test/run-pass/nested-matchs.rs b/src/test/run-pass/nested-matchs.rs index dfbd583f16e06..181ec238b0e71 100644 --- a/src/test/run-pass/nested-matchs.rs +++ b/src/test/run-pass/nested-matchs.rs @@ -16,9 +16,9 @@ fn foo() { Some::(x) => { let mut bar; match None:: { None:: => { bar = 5; } _ => { baz(); } } - debug!(bar); + info!(bar); } - None:: => { debug!("hello"); } + None:: => { info!("hello"); } } } diff --git a/src/test/run-pass/opeq.rs b/src/test/run-pass/opeq.rs index 652ac24d35d5b..f384740f5f28f 100644 --- a/src/test/run-pass/opeq.rs +++ b/src/test/run-pass/opeq.rs @@ -15,15 +15,15 @@ pub fn main() { let mut x: int = 1; x *= 2; - debug!(x); + info!(x); assert_eq!(x, 2); x += 3; - debug!(x); + info!(x); assert_eq!(x, 5); x *= x; - debug!(x); + info!(x); assert_eq!(x, 25); x /= 5; - debug!(x); + info!(x); assert_eq!(x, 5); } diff --git a/src/test/run-pass/over-constrained-vregs.rs b/src/test/run-pass/over-constrained-vregs.rs index 5f7ae2f755c63..a41b79115230a 100644 --- a/src/test/run-pass/over-constrained-vregs.rs +++ b/src/test/run-pass/over-constrained-vregs.rs @@ -17,6 +17,6 @@ pub fn main() { while b <= 32u { 0u << b; b <<= 1u; - debug!(b); + info!(b); } } diff --git a/src/test/run-pass/paren-free.rs b/src/test/run-pass/paren-free.rs index b4d34d0c902d3..751ba78b2820f 100644 --- a/src/test/run-pass/paren-free.rs +++ b/src/test/run-pass/paren-free.rs @@ -11,5 +11,5 @@ pub fn main() { let x = true; if x { let mut i = 10; while i > 0 { i -= 1; } } - match x { true => { debug!("right"); } false => { debug!("wrong"); } } + match x { true => { info!("right"); } false => { info!("wrong"); } } } diff --git a/src/test/run-pass/parse-fail.rs b/src/test/run-pass/parse-fail.rs index 0ac899d5e3158..4a2ff74d064de 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() { fail!(); debug!(1); } +fn dont_call_me() { fail!(); info!(1); } pub fn main() { } diff --git a/src/test/run-pass/pass-by-copy.rs b/src/test/run-pass/pass-by-copy.rs index 63196128ba5b6..716725899ab1c 100644 --- a/src/test/run-pass/pass-by-copy.rs +++ b/src/test/run-pass/pass-by-copy.rs @@ -8,8 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -fn magic(x: A) { debug!(x); } -fn magic2(x: @int) { debug!(x); } +fn magic(x: A) { info!(x); } +fn magic2(x: @int) { info!(x); } struct A { a: @int } diff --git a/src/test/run-pass/pipe-select-macro.rs b/src/test/run-pass/pipe-select-macro.rs index 2db6605414506..cb126017247bc 100644 --- a/src/test/run-pass/pipe-select-macro.rs +++ b/src/test/run-pass/pipe-select-macro.rs @@ -48,11 +48,11 @@ fn test(+foo: foo::client::foo, +bar: bar::client::bar) { bar => { bar::do_bar(x) -> _next { - debug!("%?", x) + info!("%?", x) }, do_baz(b) -> _next { - if b { debug!("true") } else { debug!("false") } + if b { info!("true") } else { info!("false") } } } ) diff --git a/src/test/run-pass/platform_thread.rs b/src/test/run-pass/platform_thread.rs index ea39d00edf716..8569cd30cf513 100644 --- a/src/test/run-pass/platform_thread.rs +++ b/src/test/run-pass/platform_thread.rs @@ -20,7 +20,7 @@ pub fn main() { fn run(i: int) { - debug!(i); + info!(i); if i == 0 { return; diff --git a/src/test/run-pass/preempt.rs b/src/test/run-pass/preempt.rs index aa750c21d4588..f34cc268a0c25 100644 --- a/src/test/run-pass/preempt.rs +++ b/src/test/run-pass/preempt.rs @@ -18,9 +18,9 @@ use std::comm; use extra::comm; fn starve_main(alive: Port) { - debug!("signalling main"); + info!("signalling main"); alive.recv(); - debug!("starving main"); + info!("starving main"); let mut i: int = 0; loop { i += 1; } } @@ -28,14 +28,14 @@ fn starve_main(alive: Port) { pub fn main() { let (port, chan) = stream(); - debug!("main started"); + info!("main started"); do spawn { starve_main(port); }; let mut i: int = 0; - debug!("main waiting for alive signal"); + info!("main waiting for alive signal"); chan.send(i); - debug!("main got alive signal"); - while i < 50 { debug!("main iterated"); i += 1; } - debug!("main completed"); + info!("main got alive signal"); + while i < 50 { info!("main iterated"); i += 1; } + info!("main completed"); } diff --git a/src/test/run-pass/pure-fmt.rs b/src/test/run-pass/pure-fmt.rs index 424a5e4e8efa6..c16b10da5de40 100644 --- a/src/test/run-pass/pure-fmt.rs +++ b/src/test/run-pass/pure-fmt.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// Testing that calling fmt! (via debug!) doesn't complain about impure borrows +// Testing that calling fmt! (via info!) doesn't complain about impure borrows struct Big { b: @~str, c: uint, d: int, e: char, f: float, g: bool } @@ -22,12 +22,12 @@ fn foo() { f: 0.0, g: true }; - debug!("test %?", a.b); - debug!("test %u", a.c); - debug!("test %i", a.d); - debug!("test %c", a.e); - debug!("test %f", a.f); - debug!("test %b", a.g); + info!("test %?", a.b); + info!("test %u", a.c); + info!("test %i", a.d); + info!("test %c", a.e); + info!("test %f", a.f); + info!("test %b", a.g); } pub fn main() { diff --git a/src/test/run-pass/rcvr-borrowed-to-region.rs b/src/test/run-pass/rcvr-borrowed-to-region.rs index c8e87af9ec0a3..28396119596b0 100644 --- a/src/test/run-pass/rcvr-borrowed-to-region.rs +++ b/src/test/run-pass/rcvr-borrowed-to-region.rs @@ -26,21 +26,21 @@ pub fn main() { let x = @6; let y = x.get(); - debug!("y=%d", y); + info!("y=%d", y); assert_eq!(y, 6); let x = ~6; let y = x.get(); - debug!("y=%d", y); + info!("y=%d", y); assert_eq!(y, 6); let x = ~6; let y = x.get(); - debug!("y=%d", y); + info!("y=%d", y); assert_eq!(y, 6); let x = &6; let y = x.get(); - debug!("y=%d", y); + info!("y=%d", y); assert_eq!(y, 6); } diff --git a/src/test/run-pass/rcvr-borrowed-to-slice.rs b/src/test/run-pass/rcvr-borrowed-to-slice.rs index 3df60762dea02..5ea94020a22f0 100644 --- a/src/test/run-pass/rcvr-borrowed-to-slice.rs +++ b/src/test/run-pass/rcvr-borrowed-to-slice.rs @@ -26,16 +26,16 @@ fn call_sum(x: &[int]) -> int { x.sum_() } pub fn main() { let x = ~[1, 2, 3]; let y = call_sum(x); - debug!("y==%d", y); + info!("y==%d", y); assert_eq!(y, 6); let mut x = ~[1, 2, 3]; let y = x.sum_(); - debug!("y==%d", y); + info!("y==%d", y); assert_eq!(y, 6); let x = ~[1, 2, 3]; let y = x.sum_(); - debug!("y==%d", y); + info!("y==%d", y); assert_eq!(y, 6); } diff --git a/src/test/run-pass/rec-align-u32.rs b/src/test/run-pass/rec-align-u32.rs index 475b9153fdc91..a3c9b2adf7a54 100644 --- a/src/test/run-pass/rec-align-u32.rs +++ b/src/test/run-pass/rec-align-u32.rs @@ -53,9 +53,9 @@ pub fn main() { // Send it through the shape code let y = fmt!("%?", x); - debug!("align inner = %?", rusti::min_align_of::()); - debug!("size outer = %?", sys::size_of::()); - debug!("y = %s", y); + info!("align inner = %?", rusti::min_align_of::()); + info!("size outer = %?", sys::size_of::()); + info!("y = %s", y); // per clang/gcc the alignment of `inner` is 4 on x86. assert_eq!(rusti::min_align_of::(), m::align()); diff --git a/src/test/run-pass/rec-align-u64.rs b/src/test/run-pass/rec-align-u64.rs index 7bc7a8583b915..13f26dff2acfe 100644 --- a/src/test/run-pass/rec-align-u64.rs +++ b/src/test/run-pass/rec-align-u64.rs @@ -75,9 +75,9 @@ pub fn main() { // Send it through the shape code let y = fmt!("%?", x); - debug!("align inner = %?", rusti::min_align_of::()); - debug!("size outer = %?", sys::size_of::()); - debug!("y = %s", y); + info!("align inner = %?", rusti::min_align_of::()); + info!("size outer = %?", sys::size_of::()); + info!("y = %s", y); // per clang/gcc the alignment of `Inner` is 4 on x86. assert_eq!(rusti::min_align_of::(), m::m::align()); diff --git a/src/test/run-pass/rec-auto.rs b/src/test/run-pass/rec-auto.rs index 62cb3296f60bb..01a31ebf3337b 100644 --- a/src/test/run-pass/rec-auto.rs +++ b/src/test/run-pass/rec-auto.rs @@ -19,6 +19,6 @@ struct X { foo: ~str, bar: ~str } pub fn main() { let x = X {foo: ~"hello", bar: ~"world"}; - debug!(x.foo.clone()); - debug!(x.bar.clone()); + info!(x.foo.clone()); + info!(x.bar.clone()); } diff --git a/src/test/run-pass/regions-borrow-at.rs b/src/test/run-pass/regions-borrow-at.rs index a8637fc8ab782..08a09c59facca 100644 --- a/src/test/run-pass/regions-borrow-at.rs +++ b/src/test/run-pass/regions-borrow-at.rs @@ -15,6 +15,6 @@ fn foo(x: &uint) -> uint { pub fn main() { let p = @22u; let r = foo(p); - debug!("r=%u", r); + info!("r=%u", r); assert_eq!(r, 22u); } diff --git a/src/test/run-pass/regions-self-impls.rs b/src/test/run-pass/regions-self-impls.rs index c43fd0db5666c..2a2fbcfe61f3f 100644 --- a/src/test/run-pass/regions-self-impls.rs +++ b/src/test/run-pass/regions-self-impls.rs @@ -22,6 +22,6 @@ impl<'self> get_chowder<'self> for Clam<'self> { pub fn main() { let clam = Clam { chowder: &3 }; - debug!(*clam.get_chowder()); + info!(*clam.get_chowder()); clam.get_chowder(); } diff --git a/src/test/run-pass/regions-self-in-enums.rs b/src/test/run-pass/regions-self-in-enums.rs index 5f8b9ee333289..c35ec383665ad 100644 --- a/src/test/run-pass/regions-self-in-enums.rs +++ b/src/test/run-pass/regions-self-in-enums.rs @@ -19,5 +19,5 @@ pub fn main() { match y { int_wrapper_ctor(zz) => { z = zz; } } - debug!(*z); + info!(*z); } diff --git a/src/test/run-pass/regions-simple.rs b/src/test/run-pass/regions-simple.rs index 436fede4dc11e..318c8a8670e01 100644 --- a/src/test/run-pass/regions-simple.rs +++ b/src/test/run-pass/regions-simple.rs @@ -12,5 +12,5 @@ pub fn main() { let mut x: int = 3; let y: &mut int = &mut x; *y = 5; - debug!(*y); + info!(*y); } diff --git a/src/test/run-pass/regions-static-closure.rs b/src/test/run-pass/regions-static-closure.rs index eab057548ef5e..a2eb459ce206e 100644 --- a/src/test/run-pass/regions-static-closure.rs +++ b/src/test/run-pass/regions-static-closure.rs @@ -21,6 +21,6 @@ fn call_static_closure(cl: closure_box<'static>) { } pub fn main() { - let cl_box = box_it(|| debug!("Hello, world!")); + let cl_box = box_it(|| info!("Hello, world!")); call_static_closure(cl_box); } diff --git a/src/test/run-pass/resource-assign-is-not-copy.rs b/src/test/run-pass/resource-assign-is-not-copy.rs index 112c6be560d6f..a9c4a114054fd 100644 --- a/src/test/run-pass/resource-assign-is-not-copy.rs +++ b/src/test/run-pass/resource-assign-is-not-copy.rs @@ -34,7 +34,7 @@ pub fn main() { let a = r(i); let b = (a, 10); let (c, _d) = b; - debug!(c); + info!(c); } assert_eq!(*i, 1); } diff --git a/src/test/run-pass/resource-cycle.rs b/src/test/run-pass/resource-cycle.rs index e48b841144a76..7858417a3ca22 100644 --- a/src/test/run-pass/resource-cycle.rs +++ b/src/test/run-pass/resource-cycle.rs @@ -19,7 +19,7 @@ struct r { impl Drop for r { fn drop(&self) { unsafe { - debug!("r's dtor: self = %x, self.v = %x, self.v's value = %x", + info!("r's dtor: self = %x, self.v = %x, self.v's value = %x", cast::transmute::<*r, uint>(self), cast::transmute::<**int, uint>(&(self.v)), cast::transmute::<*int, uint>(self.v)); @@ -56,11 +56,11 @@ pub fn main() { next: None, r: { let rs = r(i1p); - debug!("r = %x", cast::transmute::<*r, uint>(&rs)); + info!("r = %x", cast::transmute::<*r, uint>(&rs)); rs } }); - debug!("x1 = %x, x1.r = %x", + info!("x1 = %x, x1.r = %x", cast::transmute::<@mut t, uint>(x1), cast::transmute::<*r, uint>(&x1.r)); @@ -68,12 +68,12 @@ pub fn main() { next: None, r: { let rs = r(i2p); - debug!("r2 = %x", cast::transmute::<*r, uint>(&rs)); + info!("r2 = %x", cast::transmute::<*r, uint>(&rs)); rs } }); - debug!("x2 = %x, x2.r = %x", + info!("x2 = %x, x2.r = %x", cast::transmute::<@mut t, uint>(x2), cast::transmute::<*r, uint>(&(x2.r))); diff --git a/src/test/run-pass/sendfn-generic-fn.rs b/src/test/run-pass/sendfn-generic-fn.rs index 31a1e7bded7bf..b74e81bb612d0 100644 --- a/src/test/run-pass/sendfn-generic-fn.rs +++ b/src/test/run-pass/sendfn-generic-fn.rs @@ -22,12 +22,12 @@ fn make_generic_record(a: A, b: B) -> Pair { fn test05_start(f: &~fn(v: float, v: ~str) -> Pair) { let p = (*f)(22.22f, ~"Hi"); - debug!(copy p); + info!(copy p); assert!(p.a == 22.22f); assert!(p.b == ~"Hi"); let q = (*f)(44.44f, ~"Ho"); - debug!(copy q); + info!(copy q); assert!(q.a == 44.44f); assert!(q.b == ~"Ho"); } diff --git a/src/test/run-pass/shadow.rs b/src/test/run-pass/shadow.rs index d0c58b50e2cec..7486005f7e56d 100644 --- a/src/test/run-pass/shadow.rs +++ b/src/test/run-pass/shadow.rs @@ -17,7 +17,7 @@ fn foo(c: ~[int]) { match none:: { some::(_) => { for c.iter().advance |i| { - debug!(a); + info!(a); let a = 17; b.push(a); } diff --git a/src/test/run-pass/simple-infer.rs b/src/test/run-pass/simple-infer.rs index e7115a41179ee..efdf7f2792c96 100644 --- a/src/test/run-pass/simple-infer.rs +++ b/src/test/run-pass/simple-infer.rs @@ -10,4 +10,4 @@ -pub fn main() { let mut n; n = 1; debug!(n); } +pub fn main() { let mut n; n = 1; info!(n); } diff --git a/src/test/run-pass/simple-match-generic-tag.rs b/src/test/run-pass/simple-match-generic-tag.rs index 6f7f2af68209e..d8b7c99d000aa 100644 --- a/src/test/run-pass/simple-match-generic-tag.rs +++ b/src/test/run-pass/simple-match-generic-tag.rs @@ -14,5 +14,5 @@ enum opt { none, } pub fn main() { let x = none::; - match x { none:: => { debug!("hello world"); } } + match x { none:: => { info!("hello world"); } } } diff --git a/src/test/run-pass/size-and-align.rs b/src/test/run-pass/size-and-align.rs index 5bc7e18bdd844..973c38438948a 100644 --- a/src/test/run-pass/size-and-align.rs +++ b/src/test/run-pass/size-and-align.rs @@ -16,8 +16,8 @@ enum clam { a(T, int), b, } fn uhoh(v: ~[clam]) { match v[1] { - a::(ref t, ref u) => { debug!("incorrect"); debug!(u); fail!(); } - b:: => { debug!("correct"); } + a::(ref t, ref u) => { info!("incorrect"); info!(u); fail!(); } + b:: => { info!("correct"); } } } diff --git a/src/test/run-pass/spawn-fn.rs b/src/test/run-pass/spawn-fn.rs index e3e39b9d5b5b8..ca0c066043de0 100644 --- a/src/test/run-pass/spawn-fn.rs +++ b/src/test/run-pass/spawn-fn.rs @@ -12,8 +12,8 @@ use std::task; fn x(s: ~str, n: int) { - debug!(s); - debug!(n); + info!(s); + info!(n); } pub fn main() { @@ -21,5 +21,5 @@ pub fn main() { task::spawn(|| x(~"hello from second spawned fn", 66) ); task::spawn(|| x(~"hello from third spawned fn", 67) ); let mut i: int = 30; - while i > 0 { i = i - 1; debug!("parent sleeping"); task::yield(); } + while i > 0 { i = i - 1; info!("parent sleeping"); task::yield(); } } diff --git a/src/test/run-pass/str-append.rs b/src/test/run-pass/str-append.rs index 556247eb4260e..5ac3c0530af5a 100644 --- a/src/test/run-pass/str-append.rs +++ b/src/test/run-pass/str-append.rs @@ -16,7 +16,7 @@ extern mod extra; fn test1() { let mut s: ~str = ~"hello"; s.push_str("world"); - debug!(s.clone()); + info!(s.clone()); assert_eq!(s[9], 'd' as u8); } @@ -26,8 +26,8 @@ fn test2() { let ff: ~str = ~"abc"; let a: ~str = ff + ~"ABC" + ff; let b: ~str = ~"ABC" + ff + ~"ABC"; - debug!(a.clone()); - debug!(b.clone()); + info!(a.clone()); + info!(b.clone()); assert_eq!(a, ~"abcABCabc"); assert_eq!(b, ~"ABCabcABC"); } diff --git a/src/test/run-pass/str-concat.rs b/src/test/run-pass/str-concat.rs index 402d2fbbe3ffb..89804a6e5629e 100644 --- a/src/test/run-pass/str-concat.rs +++ b/src/test/run-pass/str-concat.rs @@ -16,6 +16,6 @@ pub fn main() { let a: ~str = ~"hello"; let b: ~str = ~"world"; let s: ~str = a + b; - debug!(s.clone()); + info!(s.clone()); assert_eq!(s[9], 'd' as u8); } diff --git a/src/test/run-pass/str-idx.rs b/src/test/run-pass/str-idx.rs index 84f63c0137e1a..68dcc0b982294 100644 --- a/src/test/run-pass/str-idx.rs +++ b/src/test/run-pass/str-idx.rs @@ -13,6 +13,6 @@ pub fn main() { let s = ~"hello"; let c: u8 = s[4]; - debug!(c); + info!(c); assert_eq!(c, 0x6f as u8); } diff --git a/src/test/run-pass/supported-cast.rs b/src/test/run-pass/supported-cast.rs index 36e41242f8f75..edadf282163b6 100644 --- a/src/test/run-pass/supported-cast.rs +++ b/src/test/run-pass/supported-cast.rs @@ -12,251 +12,251 @@ use std::libc; pub fn main() { let f = 1 as *libc::FILE; - debug!(f as int); - debug!(f as uint); - debug!(f as i8); - debug!(f as i16); - debug!(f as i32); - debug!(f as i64); - debug!(f as u8); - debug!(f as u16); - debug!(f as u32); - debug!(f as u64); + info!(f as int); + info!(f as uint); + info!(f as i8); + info!(f as i16); + info!(f as i32); + info!(f as i64); + info!(f as u8); + info!(f as u16); + info!(f as u32); + info!(f as u64); - debug!(1 as int); - debug!(1 as uint); - debug!(1 as float); - debug!(1 as bool); - debug!(1 as *libc::FILE); - debug!(1 as i8); - debug!(1 as i16); - debug!(1 as i32); - debug!(1 as i64); - debug!(1 as u8); - debug!(1 as u16); - debug!(1 as u32); - debug!(1 as u64); - debug!(1 as f32); - debug!(1 as f64); + info!(1 as int); + info!(1 as uint); + info!(1 as float); + info!(1 as bool); + info!(1 as *libc::FILE); + info!(1 as i8); + info!(1 as i16); + info!(1 as i32); + info!(1 as i64); + info!(1 as u8); + info!(1 as u16); + info!(1 as u32); + info!(1 as u64); + info!(1 as f32); + info!(1 as f64); - debug!(1u as int); - debug!(1u as uint); - debug!(1u as float); - debug!(1u as bool); - debug!(1u as *libc::FILE); - debug!(1u as i8); - debug!(1u as i16); - debug!(1u as i32); - debug!(1u as i64); - debug!(1u as u8); - debug!(1u as u16); - debug!(1u as u32); - debug!(1u as u64); - debug!(1u as f32); - debug!(1u as f64); + info!(1u as int); + info!(1u as uint); + info!(1u as float); + info!(1u as bool); + info!(1u as *libc::FILE); + info!(1u as i8); + info!(1u as i16); + info!(1u as i32); + info!(1u as i64); + info!(1u as u8); + info!(1u as u16); + info!(1u as u32); + info!(1u as u64); + info!(1u as f32); + info!(1u as f64); - debug!(1i8 as int); - debug!(1i8 as uint); - debug!(1i8 as float); - debug!(1i8 as bool); - debug!(1i8 as *libc::FILE); - debug!(1i8 as i8); - debug!(1i8 as i16); - debug!(1i8 as i32); - debug!(1i8 as i64); - debug!(1i8 as u8); - debug!(1i8 as u16); - debug!(1i8 as u32); - debug!(1i8 as u64); - debug!(1i8 as f32); - debug!(1i8 as f64); + info!(1i8 as int); + info!(1i8 as uint); + info!(1i8 as float); + info!(1i8 as bool); + info!(1i8 as *libc::FILE); + info!(1i8 as i8); + info!(1i8 as i16); + info!(1i8 as i32); + info!(1i8 as i64); + info!(1i8 as u8); + info!(1i8 as u16); + info!(1i8 as u32); + info!(1i8 as u64); + info!(1i8 as f32); + info!(1i8 as f64); - debug!(1u8 as int); - debug!(1u8 as uint); - debug!(1u8 as float); - debug!(1u8 as bool); - debug!(1u8 as *libc::FILE); - debug!(1u8 as i8); - debug!(1u8 as i16); - debug!(1u8 as i32); - debug!(1u8 as i64); - debug!(1u8 as u8); - debug!(1u8 as u16); - debug!(1u8 as u32); - debug!(1u8 as u64); - debug!(1u8 as f32); - debug!(1u8 as f64); + info!(1u8 as int); + info!(1u8 as uint); + info!(1u8 as float); + info!(1u8 as bool); + info!(1u8 as *libc::FILE); + info!(1u8 as i8); + info!(1u8 as i16); + info!(1u8 as i32); + info!(1u8 as i64); + info!(1u8 as u8); + info!(1u8 as u16); + info!(1u8 as u32); + info!(1u8 as u64); + info!(1u8 as f32); + info!(1u8 as f64); - debug!(1i16 as int); - debug!(1i16 as uint); - debug!(1i16 as float); - debug!(1i16 as bool); - debug!(1i16 as *libc::FILE); - debug!(1i16 as i8); - debug!(1i16 as i16); - debug!(1i16 as i32); - debug!(1i16 as i64); - debug!(1i16 as u8); - debug!(1i16 as u16); - debug!(1i16 as u32); - debug!(1i16 as u64); - debug!(1i16 as f32); - debug!(1i16 as f64); + info!(1i16 as int); + info!(1i16 as uint); + info!(1i16 as float); + info!(1i16 as bool); + info!(1i16 as *libc::FILE); + info!(1i16 as i8); + info!(1i16 as i16); + info!(1i16 as i32); + info!(1i16 as i64); + info!(1i16 as u8); + info!(1i16 as u16); + info!(1i16 as u32); + info!(1i16 as u64); + info!(1i16 as f32); + info!(1i16 as f64); - debug!(1u16 as int); - debug!(1u16 as uint); - debug!(1u16 as float); - debug!(1u16 as bool); - debug!(1u16 as *libc::FILE); - debug!(1u16 as i8); - debug!(1u16 as i16); - debug!(1u16 as i32); - debug!(1u16 as i64); - debug!(1u16 as u8); - debug!(1u16 as u16); - debug!(1u16 as u32); - debug!(1u16 as u64); - debug!(1u16 as f32); - debug!(1u16 as f64); + info!(1u16 as int); + info!(1u16 as uint); + info!(1u16 as float); + info!(1u16 as bool); + info!(1u16 as *libc::FILE); + info!(1u16 as i8); + info!(1u16 as i16); + info!(1u16 as i32); + info!(1u16 as i64); + info!(1u16 as u8); + info!(1u16 as u16); + info!(1u16 as u32); + info!(1u16 as u64); + info!(1u16 as f32); + info!(1u16 as f64); - debug!(1i32 as int); - debug!(1i32 as uint); - debug!(1i32 as float); - debug!(1i32 as bool); - debug!(1i32 as *libc::FILE); - debug!(1i32 as i8); - debug!(1i32 as i16); - debug!(1i32 as i32); - debug!(1i32 as i64); - debug!(1i32 as u8); - debug!(1i32 as u16); - debug!(1i32 as u32); - debug!(1i32 as u64); - debug!(1i32 as f32); - debug!(1i32 as f64); + info!(1i32 as int); + info!(1i32 as uint); + info!(1i32 as float); + info!(1i32 as bool); + info!(1i32 as *libc::FILE); + info!(1i32 as i8); + info!(1i32 as i16); + info!(1i32 as i32); + info!(1i32 as i64); + info!(1i32 as u8); + info!(1i32 as u16); + info!(1i32 as u32); + info!(1i32 as u64); + info!(1i32 as f32); + info!(1i32 as f64); - debug!(1u32 as int); - debug!(1u32 as uint); - debug!(1u32 as float); - debug!(1u32 as bool); - debug!(1u32 as *libc::FILE); - debug!(1u32 as i8); - debug!(1u32 as i16); - debug!(1u32 as i32); - debug!(1u32 as i64); - debug!(1u32 as u8); - debug!(1u32 as u16); - debug!(1u32 as u32); - debug!(1u32 as u64); - debug!(1u32 as f32); - debug!(1u32 as f64); + info!(1u32 as int); + info!(1u32 as uint); + info!(1u32 as float); + info!(1u32 as bool); + info!(1u32 as *libc::FILE); + info!(1u32 as i8); + info!(1u32 as i16); + info!(1u32 as i32); + info!(1u32 as i64); + info!(1u32 as u8); + info!(1u32 as u16); + info!(1u32 as u32); + info!(1u32 as u64); + info!(1u32 as f32); + info!(1u32 as f64); - debug!(1i64 as int); - debug!(1i64 as uint); - debug!(1i64 as float); - debug!(1i64 as bool); - debug!(1i64 as *libc::FILE); - debug!(1i64 as i8); - debug!(1i64 as i16); - debug!(1i64 as i32); - debug!(1i64 as i64); - debug!(1i64 as u8); - debug!(1i64 as u16); - debug!(1i64 as u32); - debug!(1i64 as u64); - debug!(1i64 as f32); - debug!(1i64 as f64); + info!(1i64 as int); + info!(1i64 as uint); + info!(1i64 as float); + info!(1i64 as bool); + info!(1i64 as *libc::FILE); + info!(1i64 as i8); + info!(1i64 as i16); + info!(1i64 as i32); + info!(1i64 as i64); + info!(1i64 as u8); + info!(1i64 as u16); + info!(1i64 as u32); + info!(1i64 as u64); + info!(1i64 as f32); + info!(1i64 as f64); - debug!(1u64 as int); - debug!(1u64 as uint); - debug!(1u64 as float); - debug!(1u64 as bool); - debug!(1u64 as *libc::FILE); - debug!(1u64 as i8); - debug!(1u64 as i16); - debug!(1u64 as i32); - debug!(1u64 as i64); - debug!(1u64 as u8); - debug!(1u64 as u16); - debug!(1u64 as u32); - debug!(1u64 as u64); - debug!(1u64 as f32); - debug!(1u64 as f64); + info!(1u64 as int); + info!(1u64 as uint); + info!(1u64 as float); + info!(1u64 as bool); + info!(1u64 as *libc::FILE); + info!(1u64 as i8); + info!(1u64 as i16); + info!(1u64 as i32); + info!(1u64 as i64); + info!(1u64 as u8); + info!(1u64 as u16); + info!(1u64 as u32); + info!(1u64 as u64); + info!(1u64 as f32); + info!(1u64 as f64); - debug!(1u64 as int); - debug!(1u64 as uint); - debug!(1u64 as float); - debug!(1u64 as bool); - debug!(1u64 as *libc::FILE); - debug!(1u64 as i8); - debug!(1u64 as i16); - debug!(1u64 as i32); - debug!(1u64 as i64); - debug!(1u64 as u8); - debug!(1u64 as u16); - debug!(1u64 as u32); - debug!(1u64 as u64); - debug!(1u64 as f32); - debug!(1u64 as f64); + info!(1u64 as int); + info!(1u64 as uint); + info!(1u64 as float); + info!(1u64 as bool); + info!(1u64 as *libc::FILE); + info!(1u64 as i8); + info!(1u64 as i16); + info!(1u64 as i32); + info!(1u64 as i64); + info!(1u64 as u8); + info!(1u64 as u16); + info!(1u64 as u32); + info!(1u64 as u64); + info!(1u64 as f32); + info!(1u64 as f64); - debug!(true as int); - debug!(true as uint); - debug!(true as float); - debug!(true as bool); - debug!(true as *libc::FILE); - debug!(true as i8); - debug!(true as i16); - debug!(true as i32); - debug!(true as i64); - debug!(true as u8); - debug!(true as u16); - debug!(true as u32); - debug!(true as u64); - debug!(true as f32); - debug!(true as f64); + info!(true as int); + info!(true as uint); + info!(true as float); + info!(true as bool); + info!(true as *libc::FILE); + info!(true as i8); + info!(true as i16); + info!(true as i32); + info!(true as i64); + info!(true as u8); + info!(true as u16); + info!(true as u32); + info!(true as u64); + info!(true as f32); + info!(true as f64); - debug!(1. as int); - debug!(1. as uint); - debug!(1. as float); - debug!(1. as bool); - debug!(1. as i8); - debug!(1. as i16); - debug!(1. as i32); - debug!(1. as i64); - debug!(1. as u8); - debug!(1. as u16); - debug!(1. as u32); - debug!(1. as u64); - debug!(1. as f32); - debug!(1. as f64); + info!(1. as int); + info!(1. as uint); + info!(1. as float); + info!(1. as bool); + info!(1. as i8); + info!(1. as i16); + info!(1. as i32); + info!(1. as i64); + info!(1. as u8); + info!(1. as u16); + info!(1. as u32); + info!(1. as u64); + info!(1. as f32); + info!(1. as f64); - debug!(1f32 as int); - debug!(1f32 as uint); - debug!(1f32 as float); - debug!(1f32 as bool); - debug!(1f32 as i8); - debug!(1f32 as i16); - debug!(1f32 as i32); - debug!(1f32 as i64); - debug!(1f32 as u8); - debug!(1f32 as u16); - debug!(1f32 as u32); - debug!(1f32 as u64); - debug!(1f32 as f32); - debug!(1f32 as f64); + info!(1f32 as int); + info!(1f32 as uint); + info!(1f32 as float); + info!(1f32 as bool); + info!(1f32 as i8); + info!(1f32 as i16); + info!(1f32 as i32); + info!(1f32 as i64); + info!(1f32 as u8); + info!(1f32 as u16); + info!(1f32 as u32); + info!(1f32 as u64); + info!(1f32 as f32); + info!(1f32 as f64); - debug!(1f64 as int); - debug!(1f64 as uint); - debug!(1f64 as float); - debug!(1f64 as bool); - debug!(1f64 as i8); - debug!(1f64 as i16); - debug!(1f64 as i32); - debug!(1f64 as i64); - debug!(1f64 as u8); - debug!(1f64 as u16); - debug!(1f64 as u32); - debug!(1f64 as u64); - debug!(1f64 as f32); - debug!(1f64 as f64); + info!(1f64 as int); + info!(1f64 as uint); + info!(1f64 as float); + info!(1f64 as bool); + info!(1f64 as i8); + info!(1f64 as i16); + info!(1f64 as i32); + info!(1f64 as i64); + info!(1f64 as u8); + info!(1f64 as u16); + info!(1f64 as u32); + info!(1f64 as u64); + info!(1f64 as f32); + info!(1f64 as f64); } diff --git a/src/test/run-pass/syntax-extension-fmt.rs b/src/test/run-pass/syntax-extension-fmt.rs index fe7b510cfe782..4dd1dc61c0d00 100644 --- a/src/test/run-pass/syntax-extension-fmt.rs +++ b/src/test/run-pass/syntax-extension-fmt.rs @@ -11,8 +11,8 @@ extern mod extra; fn test(actual: ~str, expected: ~str) { - debug!(actual.clone()); - debug!(expected.clone()); + info!(actual.clone()); + info!(expected.clone()); assert_eq!(actual, expected); } diff --git a/src/test/run-pass/tag-align-shape.rs b/src/test/run-pass/tag-align-shape.rs index 43a793a34c89d..f86c134eef247 100644 --- a/src/test/run-pass/tag-align-shape.rs +++ b/src/test/run-pass/tag-align-shape.rs @@ -20,6 +20,6 @@ struct t_rec { pub fn main() { let x = t_rec {c8: 22u8, t: a_tag(44u64)}; let y = fmt!("%?", x); - debug!("y = %s", y); + info!("y = %s", y); assert_eq!(y, ~"{c8: 22, t: a_tag(44)}"); } diff --git a/src/test/run-pass/tail-cps.rs b/src/test/run-pass/tail-cps.rs index b32f1f82aa7fa..99371bec58bdb 100644 --- a/src/test/run-pass/tail-cps.rs +++ b/src/test/run-pass/tail-cps.rs @@ -17,13 +17,13 @@ fn checktrue(rs: bool) -> bool { assert!((rs)); return true; } pub fn main() { let k = checktrue; evenk(42, k); oddk(45, k); } fn evenk(n: int, k: extern fn(bool) -> bool) -> bool { - debug!("evenk"); - debug!(n); + info!("evenk"); + info!(n); if n == 0 { return k(true); } else { return oddk(n - 1, k); } } fn oddk(n: int, k: extern fn(bool) -> bool) -> bool { - debug!("oddk"); - debug!(n); + info!("oddk"); + info!(n); if n == 0 { return k(false); } else { return evenk(n - 1, k); } } diff --git a/src/test/run-pass/task-comm-1.rs b/src/test/run-pass/task-comm-1.rs index 4d34e3bae3289..d202bac7089b1 100644 --- a/src/test/run-pass/task-comm-1.rs +++ b/src/test/run-pass/task-comm-1.rs @@ -12,9 +12,9 @@ use std::task; pub fn main() { test00(); } -fn start() { debug!("Started / Finished task."); } +fn start() { info!("Started / Finished task."); } fn test00() { task::try(|| start() ); - debug!("Completing."); + info!("Completing."); } diff --git a/src/test/run-pass/task-comm-12.rs b/src/test/run-pass/task-comm-12.rs index a241e9a49a73f..fd2e81d062e8e 100644 --- a/src/test/run-pass/task-comm-12.rs +++ b/src/test/run-pass/task-comm-12.rs @@ -14,7 +14,7 @@ use std::task; pub fn main() { test00(); } -fn start(task_number: int) { debug!("Started / Finished task."); } +fn start(task_number: int) { info!("Started / Finished task."); } fn test00() { let i: int = 0; @@ -35,5 +35,5 @@ fn test00() { // Try joining tasks that have already finished. result.unwrap().recv(); - debug!("Joined task."); + info!("Joined task."); } diff --git a/src/test/run-pass/task-comm-13.rs b/src/test/run-pass/task-comm-13.rs index b625b0557a7cf..3caf346456398 100644 --- a/src/test/run-pass/task-comm-13.rs +++ b/src/test/run-pass/task-comm-13.rs @@ -21,8 +21,8 @@ fn start(c: &comm::Chan, start: int, number_of_messages: int) { } pub fn main() { - debug!("Check that we don't deadlock."); + info!("Check that we don't deadlock."); let (p, ch) = comm::stream(); task::try(|| start(&ch, 0, 10) ); - debug!("Joined task"); + info!("Joined task"); } diff --git a/src/test/run-pass/task-comm-14.rs b/src/test/run-pass/task-comm-14.rs index a637d95175701..6910d39d495ae 100644 --- a/src/test/run-pass/task-comm-14.rs +++ b/src/test/run-pass/task-comm-14.rs @@ -19,7 +19,7 @@ pub fn main() { // Spawn 10 tasks each sending us back one int. let mut i = 10; while (i > 0) { - debug!(i); + info!(i); let (p, ch) = comm::stream(); po.add(p); task::spawn({let i = i; || child(i, &ch)}); @@ -31,15 +31,15 @@ pub fn main() { i = 10; while (i > 0) { - debug!(i); + info!(i); po.recv(); i = i - 1; } - debug!("main thread exiting"); + info!("main thread exiting"); } fn child(x: int, ch: &comm::Chan) { - debug!(x); + info!(x); ch.send(x); } diff --git a/src/test/run-pass/task-comm-3.rs b/src/test/run-pass/task-comm-3.rs index f94b548737491..6c7405ef44188 100644 --- a/src/test/run-pass/task-comm-3.rs +++ b/src/test/run-pass/task-comm-3.rs @@ -16,24 +16,24 @@ use std::comm::Chan; use std::comm; use std::task; -pub fn main() { debug!("===== WITHOUT THREADS ====="); test00(); } +pub fn main() { info!("===== WITHOUT THREADS ====="); test00(); } fn test00_start(ch: &Chan, message: int, count: int) { - debug!("Starting test00_start"); + info!("Starting test00_start"); let mut i: int = 0; while i < count { - debug!("Sending Message"); + info!("Sending Message"); ch.send(message + 0); i = i + 1; } - debug!("Ending test00_start"); + info!("Ending test00_start"); } fn test00() { let number_of_tasks: int = 16; let number_of_messages: int = 4; - debug!("Creating tasks"); + info!("Creating tasks"); let po = comm::PortSet::new(); @@ -66,7 +66,7 @@ fn test00() { // Join spawned tasks... for results.iter().advance |r| { r.recv(); } - debug!("Completed: Final number is: "); + info!("Completed: Final number is: "); error!(sum); // assert (sum == (((number_of_tasks * (number_of_tasks - 1)) / 2) * // number_of_messages)); diff --git a/src/test/run-pass/task-comm-4.rs b/src/test/run-pass/task-comm-4.rs index 2033092d2ce19..5b0ebb0fa2508 100644 --- a/src/test/run-pass/task-comm-4.rs +++ b/src/test/run-pass/task-comm-4.rs @@ -22,31 +22,31 @@ fn test00() { c.send(4); r = p.recv(); sum += r; - debug!(r); + info!(r); r = p.recv(); sum += r; - debug!(r); + info!(r); r = p.recv(); sum += r; - debug!(r); + info!(r); r = p.recv(); sum += r; - debug!(r); + info!(r); c.send(5); c.send(6); c.send(7); c.send(8); r = p.recv(); sum += r; - debug!(r); + info!(r); r = p.recv(); sum += r; - debug!(r); + info!(r); r = p.recv(); sum += r; - debug!(r); + info!(r); r = p.recv(); sum += r; - debug!(r); + info!(r); assert_eq!(sum, 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8); } diff --git a/src/test/run-pass/task-comm-9.rs b/src/test/run-pass/task-comm-9.rs index d520949fb2258..14c462f410cb2 100644 --- a/src/test/run-pass/task-comm-9.rs +++ b/src/test/run-pass/task-comm-9.rs @@ -39,7 +39,7 @@ fn test00() { let mut i: int = 0; while i < number_of_messages { sum += p.recv(); - debug!(r); + info!(r); i += 1; } diff --git a/src/test/run-pass/threads.rs b/src/test/run-pass/threads.rs index 8922ff91cfd0e..0c82e0194e523 100644 --- a/src/test/run-pass/threads.rs +++ b/src/test/run-pass/threads.rs @@ -16,7 +16,7 @@ use std::task; pub fn main() { let mut i = 10; while i > 0 { task::spawn({let i = i; || child(i)}); i = i - 1; } - debug!("main thread exiting"); + info!("main thread exiting"); } -fn child(x: int) { debug!(x); } +fn child(x: int) { info!(x); } diff --git a/src/test/run-pass/use-uninit-match.rs b/src/test/run-pass/use-uninit-match.rs index f4943ed09bd85..3bfe7d76ce8b0 100644 --- a/src/test/run-pass/use-uninit-match.rs +++ b/src/test/run-pass/use-uninit-match.rs @@ -18,4 +18,4 @@ fn foo(o: myoption) -> int { enum myoption { none, some(T), } -pub fn main() { debug!(5); } +pub fn main() { info!(5); } diff --git a/src/test/run-pass/use-uninit-match2.rs b/src/test/run-pass/use-uninit-match2.rs index 802c861f88bc2..ea627a7c7602b 100644 --- a/src/test/run-pass/use-uninit-match2.rs +++ b/src/test/run-pass/use-uninit-match2.rs @@ -18,4 +18,4 @@ fn foo(o: myoption) -> int { enum myoption { none, some(T), } -pub fn main() { debug!(5); } +pub fn main() { info!(5); } diff --git a/src/test/run-pass/utf8.rs b/src/test/run-pass/utf8.rs index cd383985c55a3..e0cb2703deb4d 100644 --- a/src/test/run-pass/utf8.rs +++ b/src/test/run-pass/utf8.rs @@ -42,10 +42,10 @@ pub fn main() { fn check_str_eq(a: ~str, b: ~str) { let mut i: int = 0; for a.bytes_iter().advance |ab| { - debug!(i); - debug!(ab); + info!(i); + info!(ab); let bb: u8 = b[i]; - debug!(bb); + info!(bb); assert_eq!(ab, bb); i += 1; } diff --git a/src/test/run-pass/vec-concat.rs b/src/test/run-pass/vec-concat.rs index b6fa7c107dbc7..54fe4408e48f5 100644 --- a/src/test/run-pass/vec-concat.rs +++ b/src/test/run-pass/vec-concat.rs @@ -13,7 +13,7 @@ pub fn main() { let a: ~[int] = ~[1, 2, 3, 4, 5]; let b: ~[int] = ~[6, 7, 8, 9, 0]; let v: ~[int] = a + b; - debug!(v[9]); + info!(v[9]); assert_eq!(v[0], 1); assert_eq!(v[7], 8); assert_eq!(v[9], 0); diff --git a/src/test/run-pass/vec-late-init.rs b/src/test/run-pass/vec-late-init.rs index 3f7501f34dad5..3b07a4ecbcb73 100644 --- a/src/test/run-pass/vec-late-init.rs +++ b/src/test/run-pass/vec-late-init.rs @@ -13,5 +13,5 @@ pub fn main() { let mut later: ~[int]; if true { later = ~[1]; } else { later = ~[2]; } - debug!(later[0]); + info!(later[0]); } diff --git a/src/test/run-pass/weird-exprs.rs b/src/test/run-pass/weird-exprs.rs index 5a585c8c10e81..565188829d6b9 100644 --- a/src/test/run-pass/weird-exprs.rs +++ b/src/test/run-pass/weird-exprs.rs @@ -61,7 +61,7 @@ fn canttouchthis() -> uint { fn p() -> bool { true } let _a = (assert!((true)) == (assert!(p()))); let _c = (assert!((p())) == ()); - let _b: bool = (debug!("%d", 0) == (return 0u)); + let _b: bool = (info!("%d", 0) == (return 0u)); } fn angrydome() { @@ -71,7 +71,7 @@ fn angrydome() { break; } } -fn evil_lincoln() { let evil = debug!("lincoln"); } +fn evil_lincoln() { let evil = info!("lincoln"); } pub fn main() { strange(); diff --git a/src/test/run-pass/while-cont.rs b/src/test/run-pass/while-cont.rs index add9ba54aa6aa..836f737b845fe 100644 --- a/src/test/run-pass/while-cont.rs +++ b/src/test/run-pass/while-cont.rs @@ -13,7 +13,7 @@ pub fn main() { let mut i = 1; while i > 0 { assert!((i > 0)); - debug!(i); + info!(i); i -= 1; loop; } diff --git a/src/test/run-pass/while-loop-constraints-2.rs b/src/test/run-pass/while-loop-constraints-2.rs index 7b5cd095849e6..de87a40a61f7e 100644 --- a/src/test/run-pass/while-loop-constraints-2.rs +++ b/src/test/run-pass/while-loop-constraints-2.rs @@ -16,7 +16,7 @@ pub fn main() { while z < 50 { z += 1; while false { x = y; y = z; } - debug!(y); + info!(y); } assert!((y == 42 && z == 50)); } diff --git a/src/test/run-pass/while-with-break.rs b/src/test/run-pass/while-with-break.rs index 465cb7d562b37..a7ab011f8e143 100644 --- a/src/test/run-pass/while-with-break.rs +++ b/src/test/run-pass/while-with-break.rs @@ -5,13 +5,13 @@ pub fn main() { let mut i: int = 90; while i < 100 { - debug!(i); + info!(i); i = i + 1; if i == 95 { let v: ~[int] = ~[1, 2, 3, 4, 5]; // we check that it is freed by break - debug!("breaking"); + info!("breaking"); break; } } diff --git a/src/test/run-pass/while.rs b/src/test/run-pass/while.rs index 70a88a025de62..8c6186ef10e0d 100644 --- a/src/test/run-pass/while.rs +++ b/src/test/run-pass/while.rs @@ -13,10 +13,10 @@ pub fn main() { let mut x: int = 10; let mut y: int = 0; - while y < x { debug!(y); debug!("hello"); y = y + 1; } + while y < x { info!(y); info!("hello"); y = y + 1; } while x > 0 { - debug!("goodbye"); + info!("goodbye"); x = x - 1; - debug!(x); + info!(x); } } From e252277fe9b44ed9a913aeeb9f55dc85eaadace4 Mon Sep 17 00:00:00 2001 From: Huon Wilson Date: Wed, 17 Jul 2013 03:13:23 -0500 Subject: [PATCH 3/4] rustc: handle allocas and LoadRangeAsserts in unreachable blocks correctly. An alloca in an unreachable block would shortcircuit with Undef, but with type `Type`, rather than type `*Type` (i.e. a plain value, not a pointer) but it is expected to return a pointer into the stack, leading to confusion and LLVM asserts later. Similarly, attaching the range metadata to a Load in an unreachable block makes LLVM unhappy, since the Load returns Undef. Fixes #7344. --- src/librustc/middle/trans/base.rs | 2 +- src/librustc/middle/trans/build.rs | 20 +++++++++++--------- src/librustc/middle/trans/datum.rs | 2 +- src/test/run-pass/issue-7344.rs | 28 ++++++++++++++++++++++++++++ 4 files changed, 41 insertions(+), 11 deletions(-) create mode 100644 src/test/run-pass/issue-7344.rs diff --git a/src/librustc/middle/trans/base.rs b/src/librustc/middle/trans/base.rs index 7182f7ff8b7d4..8b64809df9ea3 100644 --- a/src/librustc/middle/trans/base.rs +++ b/src/librustc/middle/trans/base.rs @@ -1549,7 +1549,7 @@ pub fn alloca_maybe_zeroed(cx: block, ty: Type, name: &str, zero: bool) -> Value let _icx = push_ctxt("alloca"); if cx.unreachable { unsafe { - return llvm::LLVMGetUndef(ty.to_ref()); + return llvm::LLVMGetUndef(ty.ptr_to().to_ref()); } } let initcx = base::raw_block(cx.fcx, false, cx.fcx.get_llstaticallocas()); diff --git a/src/librustc/middle/trans/build.rs b/src/librustc/middle/trans/build.rs index db5553ca939d7..1b92574fd96e1 100644 --- a/src/librustc/middle/trans/build.rs +++ b/src/librustc/middle/trans/build.rs @@ -569,15 +569,17 @@ pub fn LoadRangeAssert(cx: block, PointerVal: ValueRef, lo: c_ulonglong, hi: c_ulonglong, signed: lib::llvm::Bool) -> ValueRef { let value = Load(cx, PointerVal); - unsafe { - let t = llvm::LLVMGetElementType(llvm::LLVMTypeOf(PointerVal)); - let min = llvm::LLVMConstInt(t, lo, signed); - let max = llvm::LLVMConstInt(t, hi, signed); - - do [min, max].as_imm_buf |ptr, len| { - llvm::LLVMSetMetadata(value, lib::llvm::MD_range as c_uint, - llvm::LLVMMDNodeInContext(cx.fcx.ccx.llcx, - ptr, len as c_uint)); + if !cx.unreachable { + unsafe { + let t = llvm::LLVMGetElementType(llvm::LLVMTypeOf(PointerVal)); + let min = llvm::LLVMConstInt(t, lo, signed); + let max = llvm::LLVMConstInt(t, hi, signed); + + do [min, max].as_imm_buf |ptr, len| { + llvm::LLVMSetMetadata(value, lib::llvm::MD_range as c_uint, + llvm::LLVMMDNodeInContext(cx.fcx.ccx.llcx, + ptr, len as c_uint)); + } } } diff --git a/src/librustc/middle/trans/datum.rs b/src/librustc/middle/trans/datum.rs index 591e318c7314f..efd666c8d9691 100644 --- a/src/librustc/middle/trans/datum.rs +++ b/src/librustc/middle/trans/datum.rs @@ -413,7 +413,7 @@ impl Datum { pub fn to_value_datum(&self, bcx: block) -> Datum { /*! * - * Yields a by-ref form of this datum. This may involve + * Yields a by-value form of this datum. This may involve * creation of a temporary stack slot. The value returned by * this function is not separately rooted from this datum, so * it will not live longer than the current datum. */ diff --git a/src/test/run-pass/issue-7344.rs b/src/test/run-pass/issue-7344.rs new file mode 100644 index 0000000000000..acf55d2463bc3 --- /dev/null +++ b/src/test/run-pass/issue-7344.rs @@ -0,0 +1,28 @@ +// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#[allow(unreachable_code)]; + +fn foo() -> bool { false } + +fn bar() { + return; + !foo(); +} + +fn baz() { + return; + if "" == "" {} +} + +fn main() { + bar(); + baz(); +} From 4797dd4087104246b5d5c2d3edf1623acfbc06e5 Mon Sep 17 00:00:00 2001 From: Huon Wilson Date: Wed, 17 Jul 2013 03:13:41 -0500 Subject: [PATCH 4/4] rustc: selectively trans branches for `if `. That is, the `b` branch in `if true { a } else { b }` will not be trans'd, and that expression will be exactly the same as `a`. This means that, for example, macros conditionally expanding to `if false { .. }` (like debug!) will not waste time in LLVM (or trans). --- src/librustc/middle/trans/controlflow.rs | 72 ++++++++++++++++++------ 1 file changed, 55 insertions(+), 17 deletions(-) diff --git a/src/librustc/middle/trans/controlflow.rs b/src/librustc/middle/trans/controlflow.rs index e03a6e7c167cc..36f1f5cdbefc8 100644 --- a/src/librustc/middle/trans/controlflow.rs +++ b/src/librustc/middle/trans/controlflow.rs @@ -63,6 +63,38 @@ pub fn trans_if(bcx: block, let _indenter = indenter(); let _icx = push_ctxt("trans_if"); + + match cond.node { + // `if true` and `if false` can be trans'd more efficiently, + // by dropping branches that are known to be impossible. + ast::expr_lit(@ref l) => match l.node { + ast::lit_bool(true) => { + // if true { .. } [else { .. }] + let then_bcx_in = scope_block(bcx, thn.info(), "if_true_then"); + let then_bcx_out = trans_block(then_bcx_in, thn, dest); + let then_bcx_out = trans_block_cleanups(then_bcx_out, + block_cleanups(then_bcx_in)); + Br(bcx, then_bcx_in.llbb); + return then_bcx_out; + } + ast::lit_bool(false) => { + match els { + // if false { .. } else { .. } + Some(elexpr) => { + let (else_bcx_in, else_bcx_out) = + trans_if_else(bcx, elexpr, dest, "if_false_else"); + Br(bcx, else_bcx_in.llbb); + return else_bcx_out; + } + // if false { .. } + None => return bcx, + } + } + _ => {} + }, + _ => {} + } + let Result {bcx, val: cond_val} = expr::trans_to_datum(bcx, cond).to_result(); @@ -80,22 +112,8 @@ pub fn trans_if(bcx: block, // 'else' context let (else_bcx_in, next_bcx) = match els { Some(elexpr) => { - let else_bcx_in = scope_block(bcx, els.info(), "else"); - let else_bcx_out = match elexpr.node { - ast::expr_if(_, _, _) => { - let elseif_blk = ast_util::block_from_expr(elexpr); - trans_block(else_bcx_in, &elseif_blk, dest) - } - ast::expr_block(ref blk) => { - trans_block(else_bcx_in, blk, dest) - } - // would be nice to have a constraint on ifs - _ => bcx.tcx().sess.bug("strange alternative in if") - }; - let else_bcx_out = trans_block_cleanups(else_bcx_out, - block_cleanups(else_bcx_in)); - - (else_bcx_in, join_blocks(bcx, [then_bcx_out, else_bcx_out])) + let (else_bcx_in, else_bcx_out) = trans_if_else(bcx, elexpr, dest, "else"); + (else_bcx_in, join_blocks(bcx, [then_bcx_out, else_bcx_out])) } _ => { let next_bcx = sub_block(bcx, "next"); @@ -109,7 +127,27 @@ pub fn trans_if(bcx: block, then_bcx_in.to_str(), else_bcx_in.to_str()); CondBr(bcx, cond_val, then_bcx_in.llbb, else_bcx_in.llbb); - next_bcx + return next_bcx; + + // trans `else [ if { .. } ... | { .. } ]` + fn trans_if_else(bcx: block, elexpr: @ast::expr, + dest: expr::Dest, scope_name: &str) -> (block, block) { + let else_bcx_in = scope_block(bcx, elexpr.info(), scope_name); + let else_bcx_out = match elexpr.node { + ast::expr_if(_, _, _) => { + let elseif_blk = ast_util::block_from_expr(elexpr); + trans_block(else_bcx_in, &elseif_blk, dest) + } + ast::expr_block(ref blk) => { + trans_block(else_bcx_in, blk, dest) + } + // would be nice to have a constraint on ifs + _ => bcx.tcx().sess.bug("strange alternative in if") + }; + let else_bcx_out = trans_block_cleanups(else_bcx_out, + block_cleanups(else_bcx_in)); + (else_bcx_in, else_bcx_out) + } } pub fn join_blocks(parent_bcx: block, in_cxs: &[block]) -> block {