diff --git a/doc/rust.md b/doc/rust.md index e17f8ed890b2..2d4b0c15cb83 100644 --- a/doc/rust.md +++ b/doc/rust.md @@ -700,15 +700,15 @@ mod math { type complex = (f64, f64); fn sin(f: f64) -> f64 { ... -# fail2!(); +# fail!(); } fn cos(f: f64) -> f64 { ... -# fail2!(); +# fail!(); } fn tan(f: f64) -> f64 { ... -# fail2!(); +# fail!(); } } ~~~~ @@ -1059,8 +1059,8 @@ output slot type would normally be. For example: ~~~~ fn my_err(s: &str) -> ! { - info2!("{}", s); - fail2!(); + info!("{}", s); + fail!(); } ~~~~ @@ -1078,7 +1078,7 @@ were declared without the `!` annotation, the following code would not typecheck: ~~~~ -# fn my_err(s: &str) -> ! { fail2!() } +# fn my_err(s: &str) -> ! { fail!() } fn f(i: int) -> int { if i == 42 { @@ -2826,9 +2826,9 @@ enum List { Nil, Cons(X, @List) } let x: List = Cons(10, @Cons(11, @Nil)); match x { - Cons(_, @Nil) => fail2!("singleton list"), + Cons(_, @Nil) => fail!("singleton list"), Cons(*) => return, - Nil => fail2!("empty list") + Nil => fail!("empty list") } ~~~~ @@ -2864,7 +2864,7 @@ match x { return; } _ => { - fail2!(); + fail!(); } } ~~~~ @@ -2918,7 +2918,7 @@ guard may refer to the variables bound within the pattern they follow. let message = match maybe_digit { Some(x) if x < 10 => process_digit(x), Some(x) => process_other(x), - None => fail2!() + None => fail!() }; ~~~~ @@ -3669,10 +3669,10 @@ that demonstrates all four of them: ~~~~ fn main() { - error2!("This is an error log") - warn2!("This is a warn log") - info2!("this is an info log") - debug2!("This is a debug log") + error!("This is an error log") + warn!("This is a warn log") + info!("this is an info log") + debug!("This is a debug log") } ~~~~ diff --git a/doc/tutorial-macros.md b/doc/tutorial-macros.md index a70b29f91005..f1f4ade0542d 100644 --- a/doc/tutorial-macros.md +++ b/doc/tutorial-macros.md @@ -226,7 +226,7 @@ match x { // complicated stuff goes here return result + val; }, - _ => fail2!("Didn't get good_2") + _ => fail!("Didn't get good_2") } } _ => return 0 // default value @@ -268,7 +268,7 @@ macro_rules! biased_match ( biased_match!((x) ~ (good_1(g1, val)) else { return 0 }; binds g1, val ) biased_match!((g1.body) ~ (good_2(result) ) - else { fail2!("Didn't get good_2") }; + else { fail!("Didn't get good_2") }; binds result ) // complicated stuff goes here return result + val; @@ -369,7 +369,7 @@ macro_rules! biased_match ( # fn f(x: t1) -> uint { biased_match!( (x) ~ (good_1(g1, val)) else { return 0 }; - (g1.body) ~ (good_2(result) ) else { fail2!("Didn't get good_2") }; + (g1.body) ~ (good_2(result) ) else { fail!("Didn't get good_2") }; binds val, result ) // complicated stuff goes here return result + val; diff --git a/doc/tutorial.md b/doc/tutorial.md index 51a2e6eb3842..42617a96daab 100644 --- a/doc/tutorial.md +++ b/doc/tutorial.md @@ -763,7 +763,7 @@ unit, `()`, as the empty tuple if you like). ~~~~ let mytup: (int, int, f64) = (10, 20, 30.0); match mytup { - (a, b, c) => info2!("{}", a + b + (c as int)) + (a, b, c) => info!("{}", a + b + (c as int)) } ~~~~ @@ -779,7 +779,7 @@ For example: struct MyTup(int, int, f64); let mytup: MyTup = MyTup(10, 20, 30.0); match mytup { - MyTup(a, b, c) => info2!("{}", a + b + (c as int)) + MyTup(a, b, c) => info!("{}", a + b + (c as int)) } ~~~~ @@ -1576,7 +1576,7 @@ arguments. use std::task::spawn; do spawn() || { - debug2!("I'm a task, whatever"); + debug!("I'm a task, whatever"); } ~~~~ @@ -1588,7 +1588,7 @@ may be omitted from `do` expressions. use std::task::spawn; do spawn { - debug2!("Kablam!"); + debug!("Kablam!"); } ~~~~ diff --git a/src/compiletest/compiletest.rs b/src/compiletest/compiletest.rs index 362d2ba749d1..7f5a72e8a2c8 100644 --- a/src/compiletest/compiletest.rs +++ b/src/compiletest/compiletest.rs @@ -85,20 +85,20 @@ pub fn parse_config(args: ~[~str]) -> config { let message = format!("Usage: {} [OPTIONS] [TESTNAME...]", argv0); println(getopts::groups::usage(message, groups)); println(""); - fail2!() + fail!() } let matches = &match getopts::groups::getopts(args_, groups) { Ok(m) => m, - Err(f) => fail2!("{}", f.to_err_msg()) + Err(f) => fail!("{}", f.to_err_msg()) }; if matches.opt_present("h") || matches.opt_present("help") { let message = format!("Usage: {} [OPTIONS] [TESTNAME...]", argv0); println(getopts::groups::usage(message, groups)); println(""); - fail2!() + fail!() } fn opt_path(m: &getopts::Matches, nm: &str) -> Path { @@ -203,7 +203,7 @@ pub fn str_mode(s: ~str) -> mode { ~"pretty" => mode_pretty, ~"debug-info" => mode_debug_info, ~"codegen" => mode_codegen, - _ => fail2!("invalid mode") + _ => fail!("invalid mode") } } @@ -226,7 +226,7 @@ pub fn run_tests(config: &config) { // For context, see #8904 rt::test::prepare_for_lots_of_tests(); let res = test::run_tests_console(&opts, tests); - if !res { fail2!("Some tests failed"); } + if !res { fail!("Some tests failed"); } } pub fn test_opts(config: &config) -> test::TestOpts { @@ -244,13 +244,13 @@ pub fn test_opts(config: &config) -> test::TestOpts { } pub fn make_tests(config: &config) -> ~[test::TestDescAndFn] { - debug2!("making tests from {}", + debug!("making tests from {}", config.src_base.display()); let mut tests = ~[]; let dirs = os::list_dir_path(&config.src_base); for file in dirs.iter() { let file = file.clone(); - debug2!("inspecting file {}", file.display()); + debug!("inspecting file {}", file.display()); if is_test(config, &file) { let t = do make_test(config, &file) { match config.mode { diff --git a/src/compiletest/errors.rs b/src/compiletest/errors.rs index e49a9701460b..0c94ec8ab8a8 100644 --- a/src/compiletest/errors.rs +++ b/src/compiletest/errors.rs @@ -61,7 +61,7 @@ fn parse_expected(line_num: uint, line: ~str) -> ~[ExpectedError] { while idx < len && line[idx] == (' ' as u8) { idx += 1u; } let msg = line.slice(idx, len).to_owned(); - debug2!("line={} kind={} msg={}", line_num - adjust_line, kind, msg); + debug!("line={} kind={} msg={}", line_num - adjust_line, kind, msg); return ~[ExpectedError{line: line_num - adjust_line, kind: kind, msg: msg}]; diff --git a/src/compiletest/header.rs b/src/compiletest/header.rs index 541aa082f516..368c96ffe854 100644 --- a/src/compiletest/header.rs +++ b/src/compiletest/header.rs @@ -154,7 +154,7 @@ fn parse_exec_env(line: &str) -> Option<(~str, ~str)> { let end = strs.pop(); (strs.pop(), end) } - n => fail2!("Expected 1 or 2 strings, not {}", n) + n => fail!("Expected 1 or 2 strings, not {}", n) } } } @@ -183,7 +183,7 @@ fn parse_name_value_directive(line: &str, Some(colon) => { let value = line.slice(colon + keycolon.len(), line.len()).to_owned(); - debug2!("{}: {}", directive, value); + debug!("{}: {}", directive, value); Some(value) } None => None diff --git a/src/compiletest/runtest.rs b/src/compiletest/runtest.rs index 627a80ace691..d02b88ae74e5 100644 --- a/src/compiletest/runtest.rs +++ b/src/compiletest/runtest.rs @@ -63,9 +63,9 @@ pub fn run_metrics(config: config, testfile: ~str, mm: &mut MetricMap) { io::stdout().write_str("\n\n"); } let testfile = Path::new(testfile); - debug2!("running {}", testfile.display()); + debug!("running {}", testfile.display()); let props = load_props(&testfile); - debug2!("loaded props"); + debug!("loaded props"); match config.mode { mode_compile_fail => run_cfail_test(&config, &props, &testfile), mode_run_fail => run_rfail_test(&config, &props, &testfile), @@ -241,7 +241,7 @@ actual:\n\ \n", expected, actual); io::stdout().write_str(msg); - fail2!(); + fail!(); } } @@ -289,7 +289,7 @@ fn run_debuginfo_test(config: &config, props: &TestProps, testfile: &Path) { let script_str = [~"set charset UTF-8", cmds, ~"quit\n"].connect("\n"); - debug2!("script_str = {}", script_str); + debug!("script_str = {}", script_str); dump_output_file(config, testfile, script_str, "debugger.script"); // run debugger script with gdb @@ -348,10 +348,10 @@ fn check_error_patterns(props: &TestProps, let mut done = false; for line in ProcRes.stderr.line_iter() { if line.contains(*next_err_pat) { - debug2!("found error pattern {}", *next_err_pat); + debug!("found error pattern {}", *next_err_pat); next_err_idx += 1u; if next_err_idx == props.error_patterns.len() { - debug2!("found all error patterns"); + debug!("found all error patterns"); done = true; break; } @@ -423,7 +423,7 @@ fn check_expected_errors(expected_errors: ~[errors::ExpectedError], let mut was_expected = false; for (i, ee) in expected_errors.iter().enumerate() { if !found_flags[i] { - debug2!("prefix={} ee.kind={} ee.msg={} line={}", + debug!("prefix={} ee.kind={} ee.msg={} line={}", prefixes[i], ee.kind, ee.msg, line); if (prefix_matches(line, prefixes[i]) && line.contains(ee.kind) && @@ -626,7 +626,7 @@ fn compose_and_run_compiler( fn ensure_dir(path: &Path) { if os::path_is_dir(path) { return; } if !os::make_dir(path, 0x1c0i32) { - fail2!("can't make dir {}", path.display()); + fail!("can't make dir {}", path.display()); } } @@ -784,7 +784,7 @@ fn maybe_dump_to_stdout(config: &config, out: &str, err: &str) { fn error(err: ~str) { io::stdout().write_line(format!("\nerror: {}", err)); } -fn fatal(err: ~str) -> ! { error(err); fail2!(); } +fn fatal(err: ~str) -> ! { error(err); fail!(); } fn fatal_ProcRes(err: ~str, ProcRes: &ProcRes) -> ! { let msg = @@ -802,7 +802,7 @@ stderr:\n\ \n", err, ProcRes.cmdline, ProcRes.stdout, ProcRes.stderr); io::stdout().write_str(msg); - fail2!(); + fail!(); } fn _arm_exec_compiled_test(config: &config, props: &TestProps, diff --git a/src/compiletest/util.rs b/src/compiletest/util.rs index 59b8ba1c7ff3..04ef180299da 100644 --- a/src/compiletest/util.rs +++ b/src/compiletest/util.rs @@ -29,7 +29,7 @@ pub fn get_os(triple: &str) -> &'static str { return os } } - fail2!("Cannot determine OS from triple"); + fail!("Cannot determine OS from triple"); } pub fn make_new_path(path: &str) -> ~str { @@ -63,6 +63,6 @@ pub fn path_div() -> ~str { ~":" } pub fn path_div() -> ~str { ~";" } pub fn logv(config: &config, s: ~str) { - debug2!("{}", s); + debug!("{}", s); if config.verbose { io::println(s); } } diff --git a/src/libextra/arc.rs b/src/libextra/arc.rs index d1e7534795b0..66dad4721aa9 100644 --- a/src/libextra/arc.rs +++ b/src/libextra/arc.rs @@ -255,7 +255,7 @@ impl MutexArc { let inner = x.unwrap(); let MutexArcInner { failed: failed, data: data, _ } = inner; if failed { - fail2!("Can't unwrap poisoned MutexArc - another task failed inside!"); + fail!("Can't unwrap poisoned MutexArc - another task failed inside!"); } data } @@ -300,9 +300,9 @@ impl MutexArc { fn check_poison(is_mutex: bool, failed: bool) { if failed { if is_mutex { - fail2!("Poisoned MutexArc - another task failed inside!"); + fail!("Poisoned MutexArc - another task failed inside!"); } else { - fail2!("Poisoned rw_arc - another task failed inside!"); + fail!("Poisoned rw_arc - another task failed inside!"); } } } @@ -505,7 +505,7 @@ impl RWArc { let inner = x.unwrap(); let RWArcInner { failed: failed, data: data, _ } = inner; if failed { - fail2!("Can't unwrap poisoned RWArc - another task failed inside!") + fail!("Can't unwrap poisoned RWArc - another task failed inside!") } data } @@ -619,7 +619,7 @@ mod tests { assert_eq!(arc_v.get()[2], 3); assert_eq!(arc_v.get()[4], 5); - info2!("{:?}", arc_v); + info!("{:?}", arc_v); } #[test] diff --git a/src/libextra/arena.rs b/src/libextra/arena.rs index 6c4e86d958e2..b684e0d429e3 100644 --- a/src/libextra/arena.rs +++ b/src/libextra/arena.rs @@ -127,7 +127,7 @@ unsafe fn destroy_chunk(chunk: &Chunk) { let start = round_up_to(after_tydesc, align); - //debug2!("freeing object: idx = {}, size = {}, align = {}, done = {}", + //debug!("freeing object: idx = {}, size = {}, align = {}, done = {}", // start, size, align, is_done); if is_done { ((*tydesc).drop_glue)(ptr::offset(buf, start as int) as *i8); @@ -176,7 +176,7 @@ impl Arena { } this.pod_head.fill = end; - //debug2!("idx = {}, size = {}, align = {}, fill = {}", + //debug!("idx = {}, size = {}, align = {}, fill = {}", // start, n_bytes, align, head.fill); ptr::offset(vec::raw::to_ptr(this.pod_head.data), start as int) @@ -232,7 +232,7 @@ impl Arena { let head = transmute_mut_region(&mut self.head); head.fill = round_up_to(end, mem::pref_align_of::<*TyDesc>()); - //debug2!("idx = {}, size = {}, align = {}, fill = {}", + //debug!("idx = {}, size = {}, align = {}, fill = {}", // start, n_bytes, align, head.fill); let buf = vec::raw::to_ptr(self.head.data); @@ -305,6 +305,6 @@ fn test_arena_destructors_fail() { // Now, fail while allocating do arena.alloc::<@int> { // Now fail. - fail2!(); + fail!(); }; } diff --git a/src/libextra/base64.rs b/src/libextra/base64.rs index 5d9c38c95430..3960be466869 100644 --- a/src/libextra/base64.rs +++ b/src/libextra/base64.rs @@ -141,7 +141,7 @@ impl<'self> ToBase64 for &'self [u8] { v.push('=' as u8); } } - _ => fail2!("Algebra is broken, please alert the math police") + _ => fail!("Algebra is broken, please alert the math police") } unsafe { diff --git a/src/libextra/bitv.rs b/src/libextra/bitv.rs index 4f8cd4d33088..bf0fde807d3f 100644 --- a/src/libextra/bitv.rs +++ b/src/libextra/bitv.rs @@ -232,7 +232,7 @@ pub struct Bitv { } fn die() -> ! { - fail2!("Tried to do operation on bit vectors with different sizes"); + fail!("Tried to do operation on bit vectors with different sizes"); } impl Bitv { @@ -1357,7 +1357,7 @@ mod tests { let mut b = Bitv::new(14, true); b.clear(); do b.ones |i| { - fail2!("found 1 at {:?}", i) + fail!("found 1 at {:?}", i) }; } @@ -1366,7 +1366,7 @@ mod tests { let mut b = Bitv::new(140, true); b.clear(); do b.ones |i| { - fail2!("found 1 at {:?}", i) + fail!("found 1 at {:?}", i) }; } diff --git a/src/libextra/comm.rs b/src/libextra/comm.rs index 4da8bc89ea62..4a3801827a21 100644 --- a/src/libextra/comm.rs +++ b/src/libextra/comm.rs @@ -179,7 +179,7 @@ mod test { let (port, chan) = rendezvous(); do spawn_unlinked { chan.duplex_stream.send(()); // Can't access this field outside this module - fail2!() + fail!() } port.recv() } @@ -189,7 +189,7 @@ mod test { let (port, chan) = rendezvous(); do spawn_unlinked { port.duplex_stream.recv(); - fail2!() + fail!() } chan.try_send(()); } @@ -200,7 +200,7 @@ mod test { let (port, chan) = rendezvous(); do spawn_unlinked { port.duplex_stream.recv(); - fail2!() + fail!() } chan.send(()); } diff --git a/src/libextra/crypto/cryptoutil.rs b/src/libextra/crypto/cryptoutil.rs index f4bc87ae7639..97b82383d843 100644 --- a/src/libextra/crypto/cryptoutil.rs +++ b/src/libextra/crypto/cryptoutil.rs @@ -109,23 +109,23 @@ impl ToBits for u64 { } } -/// Adds the specified number of bytes to the bit count. fail2!() if this would cause numeric +/// Adds the specified number of bytes to the bit count. fail!() if this would cause numeric /// overflow. pub fn add_bytes_to_bits(bits: T, bytes: T) -> T { let (new_high_bits, new_low_bits) = bytes.to_bits(); if new_high_bits > Zero::zero() { - fail2!("Numeric overflow occured.") + fail!("Numeric overflow occured.") } match bits.checked_add(&new_low_bits) { Some(x) => return x, - None => fail2!("Numeric overflow occured.") + None => fail!("Numeric overflow occured.") } } /// Adds the specified number of bytes to the bit count, which is a tuple where the first element is -/// the high order value. fail2!() if this would cause numeric overflow. +/// the high order value. fail!() if this would cause numeric overflow. pub fn add_bytes_to_bits_tuple (bits: (T, T), bytes: T) -> (T, T) { @@ -144,7 +144,7 @@ pub fn add_bytes_to_bits_tuple } else { match hi.checked_add(&new_high_bits) { Some(y) => return (y, x), - None => fail2!("Numeric overflow occured.") + None => fail!("Numeric overflow occured.") } } }, @@ -152,7 +152,7 @@ pub fn add_bytes_to_bits_tuple let one: T = One::one(); let z = match new_high_bits.checked_add(&one) { Some(w) => w, - None => fail2!("Numeric overflow occured.") + None => fail!("Numeric overflow occured.") }; match hi.checked_add(&z) { // This re-executes the addition that was already performed earlier when overflow @@ -163,7 +163,7 @@ pub fn add_bytes_to_bits_tuple // be Unsigned - overflow is not defined for Signed types. This function could be // implemented for signed types as well if that were needed. Some(y) => return (y, low + new_low_bits), - None => fail2!("Numeric overflow occured.") + None => fail!("Numeric overflow occured.") } } } diff --git a/src/libextra/dlist.rs b/src/libextra/dlist.rs index 6668e9871f4f..f29cbd6ee529 100644 --- a/src/libextra/dlist.rs +++ b/src/libextra/dlist.rs @@ -635,11 +635,11 @@ pub fn check_links(list: &DList) { loop { match (last_ptr, node_ptr.prev.resolve_immut()) { (None , None ) => {} - (None , _ ) => fail2!("prev link for list_head"), + (None , _ ) => fail!("prev link for list_head"), (Some(p), Some(pptr)) => { assert_eq!(p as *Node, pptr as *Node); } - _ => fail2!("prev link is none, not good"), + _ => fail!("prev link is none, not good"), } match node_ptr.next { Some(ref next) => { diff --git a/src/libextra/ebml.rs b/src/libextra/ebml.rs index 0792400e857e..006ae3520c60 100644 --- a/src/libextra/ebml.rs +++ b/src/libextra/ebml.rs @@ -138,7 +138,7 @@ pub mod reader { (data[start + 3u] as uint), next: start + 4u}; } - fail2!("vint too big"); + fail!("vint too big"); } #[cfg(target_arch = "x86")] @@ -216,8 +216,8 @@ pub mod reader { match maybe_get_doc(d, tg) { Some(d) => d, None => { - error2!("failed to find block with tag {}", tg); - fail2!(); + error!("failed to find block with tag {}", tg); + fail!(); } } } @@ -305,20 +305,20 @@ pub mod reader { self.pos = r_doc.end; let str = r_doc.as_str_slice(); if lbl != str { - fail2!("Expected label {} but found {}", lbl, str); + fail!("Expected label {} but found {}", lbl, str); } } } } fn next_doc(&mut self, exp_tag: EbmlEncoderTag) -> Doc { - debug2!(". next_doc(exp_tag={:?})", exp_tag); + debug!(". next_doc(exp_tag={:?})", exp_tag); if self.pos >= self.parent.end { - fail2!("no more documents in current node!"); + fail!("no more documents in current node!"); } let TaggedDoc { tag: r_tag, doc: r_doc } = doc_at(self.parent.data, self.pos); - debug2!("self.parent={}-{} self.pos={} r_tag={} r_doc={}-{}", + debug!("self.parent={}-{} self.pos={} r_tag={} r_doc={}-{}", self.parent.start, self.parent.end, self.pos, @@ -326,11 +326,11 @@ pub mod reader { r_doc.start, r_doc.end); if r_tag != (exp_tag as uint) { - fail2!("expected EBML doc with tag {:?} but found tag {:?}", + fail!("expected EBML doc with tag {:?} but found tag {:?}", exp_tag, r_tag); } if r_doc.end > self.parent.end { - fail2!("invalid EBML, child extends to {:#x}, parent to {:#x}", + fail!("invalid EBML, child extends to {:#x}, parent to {:#x}", r_doc.end, self.parent.end); } self.pos = r_doc.end; @@ -352,7 +352,7 @@ pub mod reader { fn _next_uint(&mut self, exp_tag: EbmlEncoderTag) -> uint { let r = doc_as_u32(self.next_doc(exp_tag)); - debug2!("_next_uint exp_tag={:?} result={}", exp_tag, r); + debug!("_next_uint exp_tag={:?} result={}", exp_tag, r); r as uint } } @@ -384,7 +384,7 @@ pub mod reader { fn read_uint(&mut self) -> uint { let v = doc_as_u64(self.next_doc(EsUint)); if v > (::std::uint::max_value as u64) { - fail2!("uint {} too large for this architecture", v); + fail!("uint {} too large for this architecture", v); } v as uint } @@ -404,8 +404,8 @@ pub mod reader { fn read_int(&mut self) -> int { let v = doc_as_u64(self.next_doc(EsInt)) as i64; if v > (int::max_value as i64) || v < (int::min_value as i64) { - debug2!("FIXME \\#6122: Removing this makes this function miscompile"); - fail2!("int {} out of range for this architecture", v); + debug!("FIXME \\#6122: Removing this makes this function miscompile"); + fail!("int {} out of range for this architecture", v); } v as int } @@ -434,7 +434,7 @@ pub mod reader { name: &str, f: &fn(&mut Decoder) -> T) -> T { - debug2!("read_enum({})", name); + debug!("read_enum({})", name); self._check_label(name); let doc = self.next_doc(EsEnum); @@ -454,9 +454,9 @@ pub mod reader { _: &[&str], f: &fn(&mut Decoder, uint) -> T) -> T { - debug2!("read_enum_variant()"); + debug!("read_enum_variant()"); let idx = self._next_uint(EsEnumVid); - debug2!(" idx={}", idx); + debug!(" idx={}", idx); let doc = self.next_doc(EsEnumBody); @@ -474,7 +474,7 @@ pub mod reader { fn read_enum_variant_arg(&mut self, idx: uint, f: &fn(&mut Decoder) -> T) -> T { - debug2!("read_enum_variant_arg(idx={})", idx); + debug!("read_enum_variant_arg(idx={})", idx); f(self) } @@ -482,9 +482,9 @@ pub mod reader { _: &[&str], f: &fn(&mut Decoder, uint) -> T) -> T { - debug2!("read_enum_struct_variant()"); + debug!("read_enum_struct_variant()"); let idx = self._next_uint(EsEnumVid); - debug2!(" idx={}", idx); + debug!(" idx={}", idx); let doc = self.next_doc(EsEnumBody); @@ -504,7 +504,7 @@ pub mod reader { idx: uint, f: &fn(&mut Decoder) -> T) -> T { - debug2!("read_enum_struct_variant_arg(name={}, idx={})", name, idx); + debug!("read_enum_struct_variant_arg(name={}, idx={})", name, idx); f(self) } @@ -513,7 +513,7 @@ pub mod reader { _: uint, f: &fn(&mut Decoder) -> T) -> T { - debug2!("read_struct(name={})", name); + debug!("read_struct(name={})", name); f(self) } @@ -522,19 +522,19 @@ pub mod reader { idx: uint, f: &fn(&mut Decoder) -> T) -> T { - debug2!("read_struct_field(name={}, idx={})", name, idx); + debug!("read_struct_field(name={}, idx={})", name, idx); self._check_label(name); f(self) } fn read_tuple(&mut self, f: &fn(&mut Decoder, uint) -> T) -> T { - debug2!("read_tuple()"); + debug!("read_tuple()"); self.read_seq(f) } fn read_tuple_arg(&mut self, idx: uint, f: &fn(&mut Decoder) -> T) -> T { - debug2!("read_tuple_arg(idx={})", idx); + debug!("read_tuple_arg(idx={})", idx); self.read_seq_elt(idx, f) } @@ -542,7 +542,7 @@ pub mod reader { name: &str, f: &fn(&mut Decoder, uint) -> T) -> T { - debug2!("read_tuple_struct(name={})", name); + debug!("read_tuple_struct(name={})", name); self.read_tuple(f) } @@ -550,43 +550,43 @@ pub mod reader { idx: uint, f: &fn(&mut Decoder) -> T) -> T { - debug2!("read_tuple_struct_arg(idx={})", idx); + debug!("read_tuple_struct_arg(idx={})", idx); self.read_tuple_arg(idx, f) } fn read_option(&mut self, f: &fn(&mut Decoder, bool) -> T) -> T { - debug2!("read_option()"); + debug!("read_option()"); do self.read_enum("Option") |this| { do this.read_enum_variant(["None", "Some"]) |this, idx| { match idx { 0 => f(this, false), 1 => f(this, true), - _ => fail2!(), + _ => fail!(), } } } } fn read_seq(&mut self, f: &fn(&mut Decoder, uint) -> T) -> T { - debug2!("read_seq()"); + debug!("read_seq()"); do self.push_doc(EsVec) |d| { let len = d._next_uint(EsVecLen); - debug2!(" len={}", len); + debug!(" len={}", len); f(d, len) } } fn read_seq_elt(&mut self, idx: uint, f: &fn(&mut Decoder) -> T) -> T { - debug2!("read_seq_elt(idx={})", idx); + debug!("read_seq_elt(idx={})", idx); self.push_doc(EsVecElt, f) } fn read_map(&mut self, f: &fn(&mut Decoder, uint) -> T) -> T { - debug2!("read_map()"); + debug!("read_map()"); do self.push_doc(EsMap) |d| { let len = d._next_uint(EsMapLen); - debug2!(" len={}", len); + debug!(" len={}", len); f(d, len) } } @@ -595,7 +595,7 @@ pub mod reader { idx: uint, f: &fn(&mut Decoder) -> T) -> T { - debug2!("read_map_elt_key(idx={})", idx); + debug!("read_map_elt_key(idx={})", idx); self.push_doc(EsMapKey, f) } @@ -603,7 +603,7 @@ pub mod reader { idx: uint, f: &fn(&mut Decoder) -> T) -> T { - debug2!("read_map_elt_val(idx={})", idx); + debug!("read_map_elt_val(idx={})", idx); self.push_doc(EsMapVal, f) } } @@ -639,7 +639,7 @@ pub mod writer { n as u8]), 4u => w.write(&[0x10u8 | ((n >> 24_u) as u8), (n >> 16_u) as u8, (n >> 8_u) as u8, n as u8]), - _ => fail2!("vint to write too big: {}", n) + _ => fail!("vint to write too big: {}", n) }; } @@ -648,7 +648,7 @@ pub mod writer { if n < 0x4000_u { write_sized_vuint(w, n, 2u); return; } if n < 0x200000_u { write_sized_vuint(w, n, 3u); return; } if n < 0x10000000_u { write_sized_vuint(w, n, 4u); return; } - fail2!("vint to write too big: {}", n); + fail!("vint to write too big: {}", n); } pub fn Encoder(w: @io::Writer) -> Encoder { @@ -662,7 +662,7 @@ pub mod writer { // FIXME (#2741): Provide a function to write the standard ebml header. impl Encoder { pub fn start_tag(&mut self, tag_id: uint) { - debug2!("Start tag {}", tag_id); + debug!("Start tag {}", tag_id); // Write the enum ID: write_vuint(self.writer, tag_id); @@ -681,7 +681,7 @@ pub mod writer { write_sized_vuint(self.writer, size, 4u); self.writer.seek(cur_pos as int, io::SeekSet); - debug2!("End tag (size = {})", size); + debug!("End tag (size = {})", size); } pub fn wr_tag(&mut self, tag_id: uint, blk: &fn()) { @@ -745,12 +745,12 @@ pub mod writer { } pub fn wr_bytes(&mut self, b: &[u8]) { - debug2!("Write {} bytes", b.len()); + debug!("Write {} bytes", b.len()); self.writer.write(b); } pub fn wr_str(&mut self, s: &str) { - debug2!("Write str: {}", s); + debug!("Write str: {}", s); self.writer.write(s.as_bytes()); } } @@ -969,7 +969,7 @@ mod tests { #[test] fn test_option_int() { fn test_v(v: Option) { - debug2!("v == {:?}", v); + debug!("v == {:?}", v); let bytes = do io::with_bytes_writer |wr| { let mut ebml_w = writer::Encoder(wr); v.encode(&mut ebml_w) @@ -977,7 +977,7 @@ mod tests { let ebml_doc = reader::Doc(@bytes); let mut deser = reader::Decoder(ebml_doc); let v1 = serialize::Decodable::decode(&mut deser); - debug2!("v1 == {:?}", v1); + debug!("v1 == {:?}", v1); assert_eq!(v, v1); } diff --git a/src/libextra/fileinput.rs b/src/libextra/fileinput.rs index 8f176d5ccea1..fda88c583ce0 100644 --- a/src/libextra/fileinput.rs +++ b/src/libextra/fileinput.rs @@ -506,7 +506,7 @@ mod test { let contents = vec::from_fn(3, |j| format!("{} {}", i, j)); make_file(filename.get_ref(), contents); - debug2!("contents={:?}", contents); + debug!("contents={:?}", contents); all_lines.push_all(contents); } @@ -555,7 +555,7 @@ mod test { let expected_path = match line { "1" | "2" => filenames[0].clone(), "3" | "4" => filenames[2].clone(), - _ => fail2!("unexpected line") + _ => fail!("unexpected line") }; assert_eq!(state.current_path.clone(), expected_path); count += 1; diff --git a/src/libextra/flate.rs b/src/libextra/flate.rs index a1dccf33f6ce..9d6c2e8aa820 100644 --- a/src/libextra/flate.rs +++ b/src/libextra/flate.rs @@ -121,11 +121,11 @@ mod tests { do 2000.times { input.push_all(r.choose(words)); } - debug2!("de/inflate of {} bytes of random word-sequences", + debug!("de/inflate of {} bytes of random word-sequences", input.len()); let cmp = deflate_bytes(input); let out = inflate_bytes(cmp); - debug2!("{} bytes deflated to {} ({:.1f}% size)", + debug!("{} bytes deflated to {} ({:.1f}% size)", input.len(), cmp.len(), 100.0 * ((cmp.len() as f64) / (input.len() as f64))); assert_eq!(input, out); diff --git a/src/libextra/future.rs b/src/libextra/future.rs index 516a34f53128..fdb296e5f403 100644 --- a/src/libextra/future.rs +++ b/src/libextra/future.rs @@ -57,7 +57,7 @@ impl Future { let state = replace(&mut this.state, Evaluating); match state { Forced(v) => v, - _ => fail2!( "Logic error." ), + _ => fail!( "Logic error." ), } } @@ -69,10 +69,10 @@ impl Future { */ match self.state { Forced(ref v) => return v, - Evaluating => fail2!("Recursive forcing of future!"), + Evaluating => fail!("Recursive forcing of future!"), Pending(_) => { match replace(&mut self.state, Evaluating) { - Forced(_) | Evaluating => fail2!("Logic error."), + Forced(_) | Evaluating => fail!("Logic error."), Pending(f) => { self.state = Forced(f()); self.get_ref() @@ -217,7 +217,7 @@ mod test { #[test] #[should_fail] fn test_futurefail() { - let mut f = Future::spawn(|| fail2!()); + let mut f = Future::spawn(|| fail!()); let _x: ~str = f.get(); } diff --git a/src/libextra/getopts.rs b/src/libextra/getopts.rs index a997d49fdde9..a0ce29cd1b64 100644 --- a/src/libextra/getopts.rs +++ b/src/libextra/getopts.rs @@ -60,7 +60,7 @@ //! ]; //! let matches = match getopts(args.tail(), opts) { //! Ok(m) => { m } -//! Err(f) => { fail2!(f.to_err_msg()) } +//! Err(f) => { fail!(f.to_err_msg()) } //! }; //! if matches.opt_present("h") || matches.opt_present("help") { //! print_usage(program, opts); @@ -190,7 +190,7 @@ impl Matches { pub fn opt_vals(&self, nm: &str) -> ~[Optval] { match find_opt(self.opts, Name::from_str(nm)) { Some(id) => self.vals[id].clone(), - None => fail2!("No option '{}' defined", nm) + None => fail!("No option '{}' defined", nm) } } @@ -556,7 +556,7 @@ pub mod groups { } = (*self).clone(); match (short_name.len(), long_name.len()) { - (0,0) => fail2!("this long-format option was given no name"), + (0,0) => fail!("this long-format option was given no name"), (0,_) => Opt { name: Long((long_name)), hasarg: hasarg, @@ -582,7 +582,7 @@ pub mod groups { } ] }, - (_,_) => fail2!("something is wrong with the long-form opt") + (_,_) => fail!("something is wrong with the long-form opt") } } } @@ -701,7 +701,7 @@ pub mod groups { row.push_str(short_name); row.push_char(' '); } - _ => fail2!("the short name should only be 1 ascii char long"), + _ => fail!("the short name should only be 1 ascii char long"), } // long option @@ -815,7 +815,7 @@ pub mod groups { (B, Cr, UnderLim) => { B } (B, Cr, OverLim) if (i - last_start + 1) > lim - => fail2!("word starting with {} longer than limit!", + => fail!("word starting with {} longer than limit!", ss.slice(last_start, i + 1)), (B, Cr, OverLim) => { slice(); slice_start = last_start; B } (B, Ws, UnderLim) => { last_end = i; C } @@ -888,7 +888,7 @@ mod tests { assert!(m.opt_present("test")); assert_eq!(m.opt_str("test").unwrap(), ~"20"); } - _ => { fail2!("test_reqopt_long failed"); } + _ => { fail!("test_reqopt_long failed"); } } } @@ -899,7 +899,7 @@ mod tests { let rs = getopts(args, opts); match rs { Err(f) => check_fail_type(f, OptionMissing_), - _ => fail2!() + _ => fail!() } } @@ -910,7 +910,7 @@ mod tests { let rs = getopts(args, opts); match rs { Err(f) => check_fail_type(f, ArgumentMissing_), - _ => fail2!() + _ => fail!() } } @@ -921,7 +921,7 @@ mod tests { let rs = getopts(args, opts); match rs { Err(f) => check_fail_type(f, OptionDuplicated_), - _ => fail2!() + _ => fail!() } } @@ -935,7 +935,7 @@ mod tests { assert!(m.opt_present("t")); assert_eq!(m.opt_str("t").unwrap(), ~"20"); } - _ => fail2!() + _ => fail!() } } @@ -946,7 +946,7 @@ mod tests { let rs = getopts(args, opts); match rs { Err(f) => check_fail_type(f, OptionMissing_), - _ => fail2!() + _ => fail!() } } @@ -957,7 +957,7 @@ mod tests { let rs = getopts(args, opts); match rs { Err(f) => check_fail_type(f, ArgumentMissing_), - _ => fail2!() + _ => fail!() } } @@ -968,7 +968,7 @@ mod tests { let rs = getopts(args, opts); match rs { Err(f) => check_fail_type(f, OptionDuplicated_), - _ => fail2!() + _ => fail!() } } @@ -984,7 +984,7 @@ mod tests { assert!(m.opt_present("test")); assert_eq!(m.opt_str("test").unwrap(), ~"20"); } - _ => fail2!() + _ => fail!() } } @@ -995,7 +995,7 @@ mod tests { let rs = getopts(args, opts); match rs { Ok(ref m) => assert!(!m.opt_present("test")), - _ => fail2!() + _ => fail!() } } @@ -1006,7 +1006,7 @@ mod tests { let rs = getopts(args, opts); match rs { Err(f) => check_fail_type(f, ArgumentMissing_), - _ => fail2!() + _ => fail!() } } @@ -1017,7 +1017,7 @@ mod tests { let rs = getopts(args, opts); match rs { Err(f) => check_fail_type(f, OptionDuplicated_), - _ => fail2!() + _ => fail!() } } @@ -1031,7 +1031,7 @@ mod tests { assert!((m.opt_present("t"))); assert_eq!(m.opt_str("t").unwrap(), ~"20"); } - _ => fail2!() + _ => fail!() } } @@ -1042,7 +1042,7 @@ mod tests { let rs = getopts(args, opts); match rs { Ok(ref m) => assert!(!m.opt_present("t")), - _ => fail2!() + _ => fail!() } } @@ -1053,7 +1053,7 @@ mod tests { let rs = getopts(args, opts); match rs { Err(f) => check_fail_type(f, ArgumentMissing_), - _ => fail2!() + _ => fail!() } } @@ -1064,7 +1064,7 @@ mod tests { let rs = getopts(args, opts); match rs { Err(f) => check_fail_type(f, OptionDuplicated_), - _ => fail2!() + _ => fail!() } } @@ -1077,7 +1077,7 @@ mod tests { let rs = getopts(args, opts); match rs { Ok(ref m) => assert!(m.opt_present("test")), - _ => fail2!() + _ => fail!() } } @@ -1088,7 +1088,7 @@ mod tests { let rs = getopts(args, opts); match rs { Ok(ref m) => assert!(!m.opt_present("test")), - _ => fail2!() + _ => fail!() } } @@ -1099,10 +1099,10 @@ mod tests { let rs = getopts(args, opts); match rs { Err(f) => { - error2!("{:?}", f.clone().to_err_msg()); + error!("{:?}", f.clone().to_err_msg()); check_fail_type(f, UnexpectedArgument_); } - _ => fail2!() + _ => fail!() } } @@ -1113,7 +1113,7 @@ mod tests { let rs = getopts(args, opts); match rs { Err(f) => check_fail_type(f, OptionDuplicated_), - _ => fail2!() + _ => fail!() } } @@ -1124,7 +1124,7 @@ mod tests { let rs = getopts(args, opts); match rs { Ok(ref m) => assert!(m.opt_present("t")), - _ => fail2!() + _ => fail!() } } @@ -1135,7 +1135,7 @@ mod tests { let rs = getopts(args, opts); match rs { Ok(ref m) => assert!(!m.opt_present("t")), - _ => fail2!() + _ => fail!() } } @@ -1150,7 +1150,7 @@ mod tests { assert!(m.free[0] == ~"20"); } - _ => fail2!() + _ => fail!() } } @@ -1161,7 +1161,7 @@ mod tests { let rs = getopts(args, opts); match rs { Err(f) => check_fail_type(f, OptionDuplicated_), - _ => fail2!() + _ => fail!() } } @@ -1175,7 +1175,7 @@ mod tests { Ok(ref m) => { assert_eq!(m.opt_count("v"), 1); } - _ => fail2!() + _ => fail!() } } @@ -1188,7 +1188,7 @@ mod tests { Ok(ref m) => { assert_eq!(m.opt_count("v"), 2); } - _ => fail2!() + _ => fail!() } } @@ -1201,7 +1201,7 @@ mod tests { Ok(ref m) => { assert_eq!(m.opt_count("v"), 2); } - _ => fail2!() + _ => fail!() } } @@ -1214,7 +1214,7 @@ mod tests { Ok(ref m) => { assert_eq!(m.opt_count("verbose"), 1); } - _ => fail2!() + _ => fail!() } } @@ -1227,7 +1227,7 @@ mod tests { Ok(ref m) => { assert_eq!(m.opt_count("verbose"), 2); } - _ => fail2!() + _ => fail!() } } @@ -1242,7 +1242,7 @@ mod tests { assert!((m.opt_present("test"))); assert_eq!(m.opt_str("test").unwrap(), ~"20"); } - _ => fail2!() + _ => fail!() } } @@ -1253,7 +1253,7 @@ mod tests { let rs = getopts(args, opts); match rs { Ok(ref m) => assert!(!m.opt_present("test")), - _ => fail2!() + _ => fail!() } } @@ -1264,7 +1264,7 @@ mod tests { let rs = getopts(args, opts); match rs { Err(f) => check_fail_type(f, ArgumentMissing_), - _ => fail2!() + _ => fail!() } } @@ -1281,7 +1281,7 @@ mod tests { assert!(pair[0] == ~"20"); assert!(pair[1] == ~"30"); } - _ => fail2!() + _ => fail!() } } @@ -1295,7 +1295,7 @@ mod tests { assert!((m.opt_present("t"))); assert_eq!(m.opt_str("t").unwrap(), ~"20"); } - _ => fail2!() + _ => fail!() } } @@ -1306,7 +1306,7 @@ mod tests { let rs = getopts(args, opts); match rs { Ok(ref m) => assert!(!m.opt_present("t")), - _ => fail2!() + _ => fail!() } } @@ -1317,7 +1317,7 @@ mod tests { let rs = getopts(args, opts); match rs { Err(f) => check_fail_type(f, ArgumentMissing_), - _ => fail2!() + _ => fail!() } } @@ -1334,7 +1334,7 @@ mod tests { assert!(pair[0] == ~"20"); assert!(pair[1] == ~"30"); } - _ => fail2!() + _ => fail!() } } @@ -1345,7 +1345,7 @@ mod tests { let rs = getopts(args, opts); match rs { Err(f) => check_fail_type(f, UnrecognizedOption_), - _ => fail2!() + _ => fail!() } } @@ -1356,7 +1356,7 @@ mod tests { let rs = getopts(args, opts); match rs { Err(f) => check_fail_type(f, UnrecognizedOption_), - _ => fail2!() + _ => fail!() } } @@ -1388,7 +1388,7 @@ mod tests { assert!(pair[1] == ~"-60 70"); assert!((!m.opt_present("notpresent"))); } - _ => fail2!() + _ => fail!() } } @@ -1399,7 +1399,7 @@ mod tests { let args_single = ~[~"-e", ~"foo"]; let matches_single = &match getopts(args_single, opts) { result::Ok(m) => m, - result::Err(_) => fail2!() + result::Err(_) => fail!() }; assert!(matches_single.opts_present([~"e"])); assert!(matches_single.opts_present([~"encrypt", ~"e"])); @@ -1415,7 +1415,7 @@ mod tests { let args_both = ~[~"-e", ~"foo", ~"--encrypt", ~"foo"]; let matches_both = &match getopts(args_both, opts) { result::Ok(m) => m, - result::Err(_) => fail2!() + result::Err(_) => fail!() }; assert!(matches_both.opts_present([~"e"])); assert!(matches_both.opts_present([~"encrypt"])); @@ -1437,7 +1437,7 @@ mod tests { let opts = ~[optmulti("L"), optmulti("M")]; let matches = &match getopts(args, opts) { result::Ok(m) => m, - result::Err(_) => fail2!() + result::Err(_) => fail!() }; assert!(matches.opts_present([~"L"])); assert_eq!(matches.opts_str([~"L"]).unwrap(), ~"foo"); @@ -1580,8 +1580,8 @@ Options: let generated_usage = groups::usage("Usage: fruits", optgroups); - debug2!("expected: <<{}>>", expected); - debug2!("generated: <<{}>>", generated_usage); + debug!("expected: <<{}>>", expected); + debug!("generated: <<{}>>", generated_usage); assert_eq!(generated_usage, expected); } @@ -1608,8 +1608,8 @@ Options: let usage = groups::usage("Usage: fruits", optgroups); - debug2!("expected: <<{}>>", expected); - debug2!("generated: <<{}>>", usage); + debug!("expected: <<{}>>", expected); + debug!("generated: <<{}>>", usage); assert!(usage == expected) } @@ -1635,8 +1635,8 @@ Options: let usage = groups::usage("Usage: fruits", optgroups); - debug2!("expected: <<{}>>", expected); - debug2!("generated: <<{}>>", usage); + debug!("expected: <<{}>>", expected); + debug!("generated: <<{}>>", usage); assert!(usage == expected) } } diff --git a/src/libextra/json.rs b/src/libextra/json.rs index 1d8f3ffdc62a..e151568ad7f8 100644 --- a/src/libextra/json.rs +++ b/src/libextra/json.rs @@ -880,10 +880,10 @@ pub fn Decoder(json: Json) -> Decoder { impl serialize::Decoder for Decoder { fn read_nil(&mut self) -> () { - debug2!("read_nil"); + debug!("read_nil"); match self.stack.pop() { Null => (), - value => fail2!("not a null: {:?}", value) + value => fail!("not a null: {:?}", value) } } @@ -900,18 +900,18 @@ impl serialize::Decoder for Decoder { fn read_int(&mut self) -> int { self.read_f64() as int } fn read_bool(&mut self) -> bool { - debug2!("read_bool"); + debug!("read_bool"); match self.stack.pop() { Boolean(b) => b, - value => fail2!("not a boolean: {:?}", value) + value => fail!("not a boolean: {:?}", value) } } fn read_f64(&mut self) -> f64 { - debug2!("read_f64"); + debug!("read_f64"); match self.stack.pop() { Number(f) => f, - value => fail2!("not a number: {:?}", value) + value => fail!("not a number: {:?}", value) } } fn read_f32(&mut self) -> f32 { self.read_f64() as f32 } @@ -921,20 +921,20 @@ impl serialize::Decoder for Decoder { let mut v = ~[]; let s = self.read_str(); for c in s.iter() { v.push(c) } - if v.len() != 1 { fail2!("string must have one character") } + if v.len() != 1 { fail!("string must have one character") } v[0] } fn read_str(&mut self) -> ~str { - debug2!("read_str"); + debug!("read_str"); match self.stack.pop() { String(s) => s, - json => fail2!("not a string: {:?}", json) + json => fail!("not a string: {:?}", json) } } fn read_enum(&mut self, name: &str, f: &fn(&mut Decoder) -> T) -> T { - debug2!("read_enum({})", name); + debug!("read_enum({})", name); f(self) } @@ -942,13 +942,13 @@ impl serialize::Decoder for Decoder { names: &[&str], f: &fn(&mut Decoder, uint) -> T) -> T { - debug2!("read_enum_variant(names={:?})", names); + debug!("read_enum_variant(names={:?})", names); let name = match self.stack.pop() { String(s) => s, Object(o) => { let n = match o.find(&~"variant").expect("invalidly encoded json") { &String(ref s) => s.clone(), - _ => fail2!("invalidly encoded json"), + _ => fail!("invalidly encoded json"), }; match o.find(&~"fields").expect("invalidly encoded json") { &List(ref l) => { @@ -956,15 +956,15 @@ impl serialize::Decoder for Decoder { self.stack.push(field.clone()); } }, - _ => fail2!("invalidly encoded json") + _ => fail!("invalidly encoded json") } n } - ref json => fail2!("invalid variant: {:?}", *json), + ref json => fail!("invalid variant: {:?}", *json), }; let idx = match names.iter().position(|n| str::eq_slice(*n, name)) { Some(idx) => idx, - None => fail2!("Unknown variant name: {}", name), + None => fail!("Unknown variant name: {}", name), }; f(self, idx) } @@ -973,7 +973,7 @@ impl serialize::Decoder for Decoder { idx: uint, f: &fn(&mut Decoder) -> T) -> T { - debug2!("read_enum_variant_arg(idx={})", idx); + debug!("read_enum_variant_arg(idx={})", idx); f(self) } @@ -981,7 +981,7 @@ impl serialize::Decoder for Decoder { names: &[&str], f: &fn(&mut Decoder, uint) -> T) -> T { - debug2!("read_enum_struct_variant(names={:?})", names); + debug!("read_enum_struct_variant(names={:?})", names); self.read_enum_variant(names, f) } @@ -991,7 +991,7 @@ impl serialize::Decoder for Decoder { idx: uint, f: &fn(&mut Decoder) -> T) -> T { - debug2!("read_enum_struct_variant_field(name={}, idx={})", name, idx); + debug!("read_enum_struct_variant_field(name={}, idx={})", name, idx); self.read_enum_variant_arg(idx, f) } @@ -1000,7 +1000,7 @@ impl serialize::Decoder for Decoder { len: uint, f: &fn(&mut Decoder) -> T) -> T { - debug2!("read_struct(name={}, len={})", name, len); + debug!("read_struct(name={}, len={})", name, len); let value = f(self); self.stack.pop(); value @@ -1011,12 +1011,12 @@ impl serialize::Decoder for Decoder { idx: uint, f: &fn(&mut Decoder) -> T) -> T { - debug2!("read_struct_field(name={}, idx={})", name, idx); + debug!("read_struct_field(name={}, idx={})", name, idx); match self.stack.pop() { Object(obj) => { let mut obj = obj; let value = match obj.pop(&name.to_owned()) { - None => fail2!("no such field: {}", name), + None => fail!("no such field: {}", name), Some(json) => { self.stack.push(json); f(self) @@ -1025,12 +1025,12 @@ impl serialize::Decoder for Decoder { self.stack.push(Object(obj)); value } - value => fail2!("not an object: {:?}", value) + value => fail!("not an object: {:?}", value) } } fn read_tuple(&mut self, f: &fn(&mut Decoder, uint) -> T) -> T { - debug2!("read_tuple()"); + debug!("read_tuple()"); self.read_seq(f) } @@ -1038,7 +1038,7 @@ impl serialize::Decoder for Decoder { idx: uint, f: &fn(&mut Decoder) -> T) -> T { - debug2!("read_tuple_arg(idx={})", idx); + debug!("read_tuple_arg(idx={})", idx); self.read_seq_elt(idx, f) } @@ -1046,7 +1046,7 @@ impl serialize::Decoder for Decoder { name: &str, f: &fn(&mut Decoder, uint) -> T) -> T { - debug2!("read_tuple_struct(name={})", name); + debug!("read_tuple_struct(name={})", name); self.read_tuple(f) } @@ -1054,7 +1054,7 @@ impl serialize::Decoder for Decoder { idx: uint, f: &fn(&mut Decoder) -> T) -> T { - debug2!("read_tuple_struct_arg(idx={})", idx); + debug!("read_tuple_struct_arg(idx={})", idx); self.read_tuple_arg(idx, f) } @@ -1066,7 +1066,7 @@ impl serialize::Decoder for Decoder { } fn read_seq(&mut self, f: &fn(&mut Decoder, uint) -> T) -> T { - debug2!("read_seq()"); + debug!("read_seq()"); let len = match self.stack.pop() { List(list) => { let len = list.len(); @@ -1075,18 +1075,18 @@ impl serialize::Decoder for Decoder { } len } - _ => fail2!("not a list"), + _ => fail!("not a list"), }; f(self, len) } fn read_seq_elt(&mut self, idx: uint, f: &fn(&mut Decoder) -> T) -> T { - debug2!("read_seq_elt(idx={})", idx); + debug!("read_seq_elt(idx={})", idx); f(self) } fn read_map(&mut self, f: &fn(&mut Decoder, uint) -> T) -> T { - debug2!("read_map()"); + debug!("read_map()"); let len = match self.stack.pop() { Object(obj) => { let len = obj.len(); @@ -1096,7 +1096,7 @@ impl serialize::Decoder for Decoder { } len } - json => fail2!("not an object: {:?}", json), + json => fail!("not an object: {:?}", json), }; f(self, len) } @@ -1105,13 +1105,13 @@ impl serialize::Decoder for Decoder { idx: uint, f: &fn(&mut Decoder) -> T) -> T { - debug2!("read_map_elt_key(idx={})", idx); + debug!("read_map_elt_key(idx={})", idx); f(self) } fn read_map_elt_val(&mut self, idx: uint, f: &fn(&mut Decoder) -> T) -> T { - debug2!("read_map_elt_val(idx={})", idx); + debug!("read_map_elt_val(idx={})", idx); f(self) } } diff --git a/src/libextra/list.rs b/src/libextra/list.rs index 1e494a179134..5eada3dfb1a4 100644 --- a/src/libextra/list.rs +++ b/src/libextra/list.rs @@ -98,7 +98,7 @@ pub fn len(ls: @List) -> uint { pub fn tail(ls: @List) -> @List { match *ls { Cons(_, tl) => return tl, - Nil => fail2!("list empty") + Nil => fail!("list empty") } } @@ -107,7 +107,7 @@ pub fn head(ls: @List) -> T { match *ls { Cons(ref hd, _) => (*hd).clone(), // makes me sad - _ => fail2!("head invoked on empty list") + _ => fail!("head invoked on empty list") } } diff --git a/src/libextra/num/bigint.rs b/src/libextra/num/bigint.rs index ed68f3162aa5..cd5ccc14cafb 100644 --- a/src/libextra/num/bigint.rs +++ b/src/libextra/num/bigint.rs @@ -353,7 +353,7 @@ impl Rem for BigUint { impl Neg for BigUint { #[inline] - fn neg(&self) -> BigUint { fail2!() } + fn neg(&self) -> BigUint { fail!() } } impl Integer for BigUint { @@ -375,7 +375,7 @@ impl Integer for BigUint { } fn div_mod_floor(&self, other: &BigUint) -> (BigUint, BigUint) { - if other.is_zero() { fail2!() } + if other.is_zero() { fail!() } if self.is_zero() { return (Zero::zero(), Zero::zero()); } if *other == One::one() { return ((*self).clone(), Zero::zero()); } @@ -824,7 +824,7 @@ fn get_radix_base(radix: uint) -> (uint, uint) { 14 => (38416, 4), 15 => (50625, 4), 16 => (65536, 4), - _ => fail2!() + _ => fail!() } } @@ -848,7 +848,7 @@ fn get_radix_base(radix: uint) -> (uint, uint) { 14 => (1475789056, 8), 15 => (2562890625, 8), 16 => (4294967296, 8), - _ => fail2!() + _ => fail!() } } @@ -1102,7 +1102,7 @@ impl Integer for BigInt { let d = BigInt::from_biguint(Plus, d_ui); let r = BigInt::from_biguint(Plus, r_ui); match (self.sign, other.sign) { - (_, Zero) => fail2!(), + (_, Zero) => fail!(), (Plus, Plus) | (Zero, Plus) => ( d, r), (Plus, Minus) | (Zero, Minus) => (-d, r), (Minus, Plus) => (-d, -r), @@ -1128,7 +1128,7 @@ impl Integer for BigInt { let d = BigInt::from_biguint(Plus, d_ui); let m = BigInt::from_biguint(Plus, m_ui); match (self.sign, other.sign) { - (_, Zero) => fail2!(), + (_, Zero) => fail!(), (Plus, Plus) | (Zero, Plus) => (d, m), (Plus, Minus) | (Zero, Minus) => if m.is_zero() { (-d, Zero::zero()) @@ -1942,7 +1942,7 @@ mod biguint_tests { ~"2" + str::from_chars(vec::from_elem(bits / 2 - 1, '0')) + "1"), (10, match bits { - 32 => ~"8589934593", 16 => ~"131073", _ => fail2!() + 32 => ~"8589934593", 16 => ~"131073", _ => fail!() }), (16, ~"2" + @@ -1959,7 +1959,7 @@ mod biguint_tests { (10, match bits { 32 => ~"55340232229718589441", 16 => ~"12885032961", - _ => fail2!() + _ => fail!() }), (16, ~"3" + str::from_chars(vec::from_elem(bits / 4 - 1, '0')) + "2" + @@ -2014,7 +2014,7 @@ mod biguint_tests { fn check(n: uint, s: &str) { let n = factor(n); let ans = match FromStrRadix::from_str_radix(s, 10) { - Some(x) => x, None => fail2!() + Some(x) => x, None => fail!() }; assert_eq!(n, ans); } diff --git a/src/libextra/num/rational.rs b/src/libextra/num/rational.rs index a8dfdfbfd001..abb802c06f3b 100644 --- a/src/libextra/num/rational.rs +++ b/src/libextra/num/rational.rs @@ -50,7 +50,7 @@ impl #[inline] pub fn new(numer: T, denom: T) -> Ratio { if denom == Zero::zero() { - fail2!("denominator == 0"); + fail!("denominator == 0"); } let mut ret = Ratio::new_raw(numer, denom); ret.reduce(); diff --git a/src/libextra/ringbuf.rs b/src/libextra/ringbuf.rs index 5738faeca956..e7032db5a919 100644 --- a/src/libextra/ringbuf.rs +++ b/src/libextra/ringbuf.rs @@ -127,7 +127,7 @@ impl RingBuf { pub fn get<'a>(&'a self, i: uint) -> &'a T { let idx = self.raw_index(i); match self.elts[idx] { - None => fail2!(), + None => fail!(), Some(ref v) => v } } @@ -138,7 +138,7 @@ impl RingBuf { pub fn get_mut<'a>(&'a mut self, i: uint) -> &'a mut T { let idx = self.raw_index(i); match self.elts[idx] { - None => fail2!(), + None => fail!(), Some(ref mut v) => v } } @@ -373,21 +373,21 @@ mod tests { assert_eq!(d.len(), 3u); d.push_back(137); assert_eq!(d.len(), 4u); - debug2!("{:?}", d.front()); + debug!("{:?}", d.front()); assert_eq!(*d.front().unwrap(), 42); - debug2!("{:?}", d.back()); + debug!("{:?}", d.back()); assert_eq!(*d.back().unwrap(), 137); let mut i = d.pop_front(); - debug2!("{:?}", i); + debug!("{:?}", i); assert_eq!(i, Some(42)); i = d.pop_back(); - debug2!("{:?}", i); + debug!("{:?}", i); assert_eq!(i, Some(137)); i = d.pop_back(); - debug2!("{:?}", i); + debug!("{:?}", i); assert_eq!(i, Some(137)); i = d.pop_back(); - debug2!("{:?}", i); + debug!("{:?}", i); assert_eq!(i, Some(17)); assert_eq!(d.len(), 0u); d.push_back(3); @@ -398,10 +398,10 @@ mod tests { assert_eq!(d.len(), 3u); d.push_front(1); assert_eq!(d.len(), 4u); - debug2!("{:?}", d.get(0)); - debug2!("{:?}", d.get(1)); - debug2!("{:?}", d.get(2)); - debug2!("{:?}", d.get(3)); + debug!("{:?}", d.get(0)); + debug!("{:?}", d.get(1)); + debug!("{:?}", d.get(2)); + debug!("{:?}", d.get(3)); assert_eq!(*d.get(0), 1); assert_eq!(*d.get(1), 2); assert_eq!(*d.get(2), 3); diff --git a/src/libextra/semver.rs b/src/libextra/semver.rs index 8c7d656f5413..e5ef9ee12d5a 100644 --- a/src/libextra/semver.rs +++ b/src/libextra/semver.rs @@ -159,7 +159,7 @@ fn take_nonempty_prefix(rdr: @io::Reader, if buf.is_empty() { bad_parse::cond.raise(()) } - debug2!("extracted nonempty prefix: {}", buf); + debug!("extracted nonempty prefix: {}", buf); (buf, ch) } @@ -235,7 +235,7 @@ pub fn parse(s: &str) -> Option { } let s = s.trim(); let mut bad = false; - do bad_parse::cond.trap(|_| { debug2!("bad"); bad = true }).inside { + do bad_parse::cond.trap(|_| { debug!("bad"); bad = true }).inside { do io::with_str_reader(s) |rdr| { let v = parse_reader(rdr); if bad || v.to_str() != s.to_owned() { diff --git a/src/libextra/smallintmap.rs b/src/libextra/smallintmap.rs index 794b25c2e38e..0ca0ff66039d 100644 --- a/src/libextra/smallintmap.rs +++ b/src/libextra/smallintmap.rs @@ -265,7 +265,7 @@ mod test_map { assert!(m.insert(5, 14)); let new = 100; match m.find_mut(&5) { - None => fail2!(), Some(x) => *x = new + None => fail!(), Some(x) => *x = new } assert_eq!(m.find(&5), Some(&new)); } diff --git a/src/libextra/sort.rs b/src/libextra/sort.rs index e1230070836c..d884f4f05c17 100644 --- a/src/libextra/sort.rs +++ b/src/libextra/sort.rs @@ -564,7 +564,7 @@ impl MergeState { shift_vec(array, dest, c2, len2); swap(&mut array[dest+len2], &mut tmp[c1]); } else if len1 == 0 { - fail2!("Comparison violates its contract!"); + fail!("Comparison violates its contract!"); } else { assert_eq!(len2, 0); assert!(len1 > 1); @@ -683,7 +683,7 @@ impl MergeState { shift_vec(array, dest+1, c1+1, len1); swap(&mut array[dest], &mut tmp[c2]); } else if len2 == 0 { - fail2!("Comparison violates its contract!"); + fail!("Comparison violates its contract!"); } else { assert_eq!(len1, 0); assert!(len2 != 0); @@ -790,7 +790,7 @@ mod test_qsort { quick_sort::(v1, leual); let mut i = 0u; while i < len { - // debug2!(v2[i]); + // debug!(v2[i]); assert_eq!(v2[i], v1[i]); i += 1; } @@ -833,7 +833,7 @@ mod test_qsort { let immut_names = names; for (&a, &b) in expected.iter().zip(immut_names.iter()) { - debug2!("{} {}", a, b); + debug!("{} {}", a, b); assert_eq!(a, b); } } @@ -851,7 +851,7 @@ mod tests { let v3 = merge_sort::(v1, f); let mut i = 0u; while i < len { - debug2!("{:?}", v3[i]); + debug!("{:?}", v3[i]); assert_eq!(v3[i], v2[i]); i += 1; } @@ -922,7 +922,7 @@ mod test_tim_sort { fn lt(&self, other: &CVal) -> bool { let mut rng = rand::rng(); if rng.gen::() > 0.995 { - fail2!("It's happening!!!"); + fail!("It's happening!!!"); } (*self).val < other.val } @@ -936,7 +936,7 @@ mod test_tim_sort { tim_sort::(v1); let mut i = 0u; while i < len { - // debug2!(v2[i]); + // debug!(v2[i]); assert_eq!(v2[i], v1[i]); i += 1u; } @@ -977,7 +977,7 @@ mod test_tim_sort { }; tim_sort(arr); - fail2!("Guarantee the fail"); + fail!("Guarantee the fail"); } #[deriving(Clone)] @@ -1045,7 +1045,7 @@ mod big_tests { fn isSorted(arr: &[T]) { for i in range(0u, arr.len() - 1) { if arr[i] > arr[i+1] { - fail2!("Array not sorted"); + fail!("Array not sorted"); } } } @@ -1116,7 +1116,7 @@ mod big_tests { fn isSorted(arr: &[@T]) { for i in range(0u, arr.len() - 1) { if arr[i] > arr[i+1] { - fail2!("Array not sorted"); + fail!("Array not sorted"); } } } diff --git a/src/libextra/sync.rs b/src/libextra/sync.rs index b5b182ea8c58..5a2c1e0998ca 100644 --- a/src/libextra/sync.rs +++ b/src/libextra/sync.rs @@ -309,9 +309,9 @@ fn check_cvar_bounds(out_of_bounds: Option, id: uint, act: &str, blk: &fn() -> U) -> U { match out_of_bounds { Some(0) => - fail2!("{} with illegal ID {} - this lock has no condvars!", act, id), + fail!("{} with illegal ID {} - this lock has no condvars!", act, id), Some(length) => - fail2!("{} with illegal ID {} - ID must be less than {}", act, id, length), + fail!("{} with illegal ID {} - ID must be less than {}", act, id, length), None => blk() } } @@ -636,7 +636,7 @@ impl RWLock { pub fn downgrade<'a>(&self, token: RWLockWriteMode<'a>) -> RWLockReadMode<'a> { if !borrow::ref_eq(self, token.lock) { - fail2!("Can't downgrade() with a different rwlock's write_mode!"); + fail!("Can't downgrade() with a different rwlock's write_mode!"); } unsafe { do task::unkillable { @@ -920,7 +920,7 @@ mod tests { let result: result::Result<(),()> = do task::try { do m2.lock { - fail2!(); + fail!(); } }; assert!(result.is_err()); @@ -940,7 +940,7 @@ mod tests { do task::spawn || { // linked let _ = p.recv(); // wait for sibling to get in the mutex task::deschedule(); - fail2!(); + fail!(); } do m2.lock_cond |cond| { c.send(()); // tell sibling go ahead @@ -978,9 +978,9 @@ mod tests { do (|| { cond.wait(); // block forever }).finally { - error2!("task unwinding and sending"); + error!("task unwinding and sending"); c.send(()); - error2!("task unwinding and done sending"); + error!("task unwinding and done sending"); } } } @@ -990,7 +990,7 @@ mod tests { } do m2.lock { } c.send(sibling_convos); // let parent wait on all children - fail2!(); + fail!(); }; assert!(result.is_err()); // child task must have finished by the time try returns @@ -1030,7 +1030,7 @@ mod tests { let _ = p.recv(); do m.lock_cond |cond| { if !cond.signal_on(0) { - fail2!(); // success; punt sibling awake. + fail!(); // success; punt sibling awake. } } }; @@ -1274,7 +1274,7 @@ mod tests { let result: result::Result<(),()> = do task::try || { do lock_rwlock_in_mode(&x2, mode1) { - fail2!(); + fail!(); } }; assert!(result.is_err()); @@ -1321,7 +1321,7 @@ mod tests { let mut xopt = Some(xwrite); do y.write_downgrade |_ywrite| { y.downgrade(xopt.take_unwrap()); - error2!("oops, y.downgrade(x) should have failed!"); + error!("oops, y.downgrade(x) should have failed!"); } } } diff --git a/src/libextra/term.rs b/src/libextra/term.rs index 85975ba6347d..cebe0ba9aa65 100644 --- a/src/libextra/term.rs +++ b/src/libextra/term.rs @@ -147,7 +147,7 @@ impl Terminal { self.out.write(s.unwrap()); return true } else { - warn2!("{}", s.unwrap_err()); + warn!("{}", s.unwrap_err()); } } false @@ -167,7 +167,7 @@ impl Terminal { self.out.write(s.unwrap()); return true } else { - warn2!("{}", s.unwrap_err()); + warn!("{}", s.unwrap_err()); } } false @@ -188,7 +188,7 @@ impl Terminal { self.out.write(s.unwrap()); return true } else { - warn2!("{}", s.unwrap_err()); + warn!("{}", s.unwrap_err()); } } false @@ -226,11 +226,11 @@ impl Terminal { if s.is_ok() { self.out.write(s.unwrap()); } else if self.num_colors > 0 { - warn2!("{}", s.unwrap_err()); + warn!("{}", s.unwrap_err()); } else { - // if we support attributes but not color, it would be nice to still warn2!() + // if we support attributes but not color, it would be nice to still warn!() // but it's not worth testing all known attributes just for this. - debug2!("{}", s.unwrap_err()); + debug!("{}", s.unwrap_err()); } } diff --git a/src/libextra/terminfo/parm.rs b/src/libextra/terminfo/parm.rs index d7944bad5fa6..d1a0a86334af 100644 --- a/src/libextra/terminfo/parm.rs +++ b/src/libextra/terminfo/parm.rs @@ -462,7 +462,7 @@ impl FormatOp { 'x' => FormatHex, 'X' => FormatHEX, 's' => FormatString, - _ => fail2!("bad FormatOp char") + _ => fail!("bad FormatOp char") } } fn to_char(self) -> char { diff --git a/src/libextra/terminfo/parser/compiled.rs b/src/libextra/terminfo/parser/compiled.rs index 0adf86ed9315..bc24c8a6e306 100644 --- a/src/libextra/terminfo/parser/compiled.rs +++ b/src/libextra/terminfo/parser/compiled.rs @@ -190,26 +190,26 @@ pub fn parse(file: @Reader, longnames: bool) -> Result<~TermInfo, ~str> { assert!(names_bytes > 0); - debug2!("names_bytes = {}", names_bytes); - debug2!("bools_bytes = {}", bools_bytes); - debug2!("numbers_count = {}", numbers_count); - debug2!("string_offsets_count = {}", string_offsets_count); - debug2!("string_table_bytes = {}", string_table_bytes); + debug!("names_bytes = {}", names_bytes); + debug!("bools_bytes = {}", bools_bytes); + debug!("numbers_count = {}", numbers_count); + debug!("string_offsets_count = {}", string_offsets_count); + debug!("string_table_bytes = {}", string_table_bytes); if (bools_bytes as uint) > boolnames.len() { - error2!("expected bools_bytes to be less than {} but found {}", boolnames.len(), + error!("expected bools_bytes to be less than {} but found {}", boolnames.len(), bools_bytes); return Err(~"incompatible file: more booleans than expected"); } if (numbers_count as uint) > numnames.len() { - error2!("expected numbers_count to be less than {} but found {}", numnames.len(), + error!("expected numbers_count to be less than {} but found {}", numnames.len(), numbers_count); return Err(~"incompatible file: more numbers than expected"); } if (string_offsets_count as uint) > stringnames.len() { - error2!("expected string_offsets_count to be less than {} but found {}", stringnames.len(), + error!("expected string_offsets_count to be less than {} but found {}", stringnames.len(), string_offsets_count); return Err(~"incompatible file: more string offsets than expected"); } @@ -219,26 +219,26 @@ pub fn parse(file: @Reader, longnames: bool) -> Result<~TermInfo, ~str> { file.read_byte(); // consume NUL - debug2!("term names: {:?}", term_names); + debug!("term names: {:?}", term_names); let mut bools_map = HashMap::new(); if bools_bytes != 0 { for i in range(0, bools_bytes) { let b = file.read_byte(); if b < 0 { - error2!("EOF reading bools after {} entries", i); + error!("EOF reading bools after {} entries", i); return Err(~"error: expected more bools but hit EOF"); } else if b == 1 { - debug2!("{} set", bnames[i]); + debug!("{} set", bnames[i]); bools_map.insert(bnames[i].to_owned(), true); } } } - debug2!("bools: {:?}", bools_map); + debug!("bools: {:?}", bools_map); if (bools_bytes + names_bytes) % 2 == 1 { - debug2!("adjusting for padding between bools and numbers"); + debug!("adjusting for padding between bools and numbers"); file.read_byte(); // compensate for padding } @@ -247,13 +247,13 @@ pub fn parse(file: @Reader, longnames: bool) -> Result<~TermInfo, ~str> { for i in range(0, numbers_count) { let n = file.read_le_u16(); if n != 0xFFFF { - debug2!("{}\\#{}", nnames[i], n); + debug!("{}\\#{}", nnames[i], n); numbers_map.insert(nnames[i].to_owned(), n); } } } - debug2!("numbers: {:?}", numbers_map); + debug!("numbers: {:?}", numbers_map); let mut string_map = HashMap::new(); @@ -263,12 +263,12 @@ pub fn parse(file: @Reader, longnames: bool) -> Result<~TermInfo, ~str> { string_offsets.push(file.read_le_u16()); } - debug2!("offsets: {:?}", string_offsets); + debug!("offsets: {:?}", string_offsets); let string_table = file.read_bytes(string_table_bytes as uint); if string_table.len() != string_table_bytes as uint { - error2!("EOF reading string table after {} bytes, wanted {}", string_table.len(), + error!("EOF reading string table after {} bytes, wanted {}", string_table.len(), string_table_bytes); return Err(~"error: hit EOF before end of string table"); } diff --git a/src/libextra/test.rs b/src/libextra/test.rs index 59eea6b4a134..1f8405dca949 100644 --- a/src/libextra/test.rs +++ b/src/libextra/test.rs @@ -155,10 +155,10 @@ pub fn test_main(args: &[~str], tests: ~[TestDescAndFn]) { let opts = match parse_opts(args) { Some(Ok(o)) => o, - Some(Err(msg)) => fail2!("{}", msg), + Some(Err(msg)) => fail!("{}", msg), None => return }; - if !run_tests_console(&opts, tests) { fail2!("Some tests failed"); } + if !run_tests_console(&opts, tests) { fail!("Some tests failed"); } } // A variant optimized for invocation with a static test vector. @@ -178,7 +178,7 @@ pub fn test_main_static(args: &[~str], tests: &[TestDescAndFn]) { TestDescAndFn { testfn: StaticBenchFn(f), desc: t.desc.clone() }, _ => { - fail2!("non-static tests passed to test::test_main_static"); + fail!("non-static tests passed to test::test_main_static"); } } }; @@ -240,7 +240,7 @@ Test Attributes: #[bench] - Indicates a function is a benchmark to be run. This function takes one argument (extra::test::BenchHarness). #[should_fail] - This function (also labeled with #[test]) will only pass if - the code causes a failure (an assertion failure or fail2!) + the code causes a failure (an assertion failure or fail!) #[ignore] - When applied to a function which is already attributed as a test, then the test runner will ignore these tests during normal test runs. Running with --ignored will run these @@ -358,7 +358,7 @@ impl ConsoleTestState { io::Truncate]) { result::Ok(w) => Some(w), result::Err(ref s) => { - fail2!("can't open output file: {}", *s) + fail!("can't open output file: {}", *s) } }, None => None @@ -607,7 +607,7 @@ pub fn fmt_bench_samples(bs: &BenchSamples) -> ~str { pub fn run_tests_console(opts: &TestOpts, tests: ~[TestDescAndFn]) -> bool { fn callback(event: &TestEvent, st: &mut ConsoleTestState) { - debug2!("callback(event={:?})", event); + debug!("callback(event={:?})", event); match (*event).clone() { TeFiltered(ref filtered_tests) => st.write_run_start(filtered_tests.len()), TeWait(ref test, padding) => st.write_test_start(test, padding), @@ -649,7 +649,7 @@ pub fn run_tests_console(opts: &TestOpts, match tests.iter().max_by(|t|len_if_padded(*t)) { Some(t) => { let n = t.desc.name.to_str(); - debug2!("Setting max_name_len from: {}", n); + debug!("Setting max_name_len from: {}", n); st.max_name_len = n.len(); }, None => {} @@ -736,7 +736,7 @@ fn run_tests(opts: &TestOpts, // It's tempting to just spawn all the tests at once, but since we have // many tests that run in other processes we would be making a big mess. let concurrency = get_concurrency(); - debug2!("using {} test tasks", concurrency); + debug!("using {} test tasks", concurrency); let mut remaining = filtered_tests; remaining.reverse(); @@ -783,7 +783,7 @@ fn get_concurrency() -> uint { let opt_n: Option = FromStr::from_str(s); match opt_n { Some(n) if n > 0 => n, - _ => fail2!("RUST_TEST_TASKS is `{}`, should be a positive integer.", s) + _ => fail!("RUST_TEST_TASKS is `{}`, should be a positive integer.", s) } } None => { @@ -1047,7 +1047,7 @@ impl MetricMap { }; if ok { - debug2!("rewriting file '{:?}' with updated metrics", p); + debug!("rewriting file '{:?}' with updated metrics", p); self.save(p); } return (diff, ok) @@ -1086,7 +1086,7 @@ impl BenchHarness { pub fn bench_n(&mut self, n: u64, f: &fn(&mut BenchHarness)) { self.iterations = n; - debug2!("running benchmark for {} iterations", + debug!("running benchmark for {} iterations", n as uint); f(self); } @@ -1127,7 +1127,7 @@ impl BenchHarness { stats::winsorize(samples, 5.0); let summ5 = stats::Summary::new(samples); - debug2!("{} samples, median {}, MAD={}, MADP={}", + debug!("{} samples, median {}, MAD={}, MADP={}", samples.len(), summ.median as f64, summ.median_abs_dev as f64, @@ -1198,7 +1198,7 @@ mod tests { #[test] pub fn do_not_run_ignored_tests() { - fn f() { fail2!(); } + fn f() { fail!(); } let desc = TestDescAndFn { desc: TestDesc { name: StaticTestName("whatever"), @@ -1234,7 +1234,7 @@ mod tests { #[test] fn test_should_fail() { - fn f() { fail2!(); } + fn f() { fail!(); } let desc = TestDescAndFn { desc: TestDesc { name: StaticTestName("whatever"), @@ -1273,7 +1273,7 @@ mod tests { let args = ~[~"progname", ~"filter"]; let opts = match parse_opts(args) { Some(Ok(o)) => o, - _ => fail2!("Malformed arg in first_free_arg_should_be_a_filter") + _ => fail!("Malformed arg in first_free_arg_should_be_a_filter") }; assert!("filter" == opts.filter.clone().unwrap()); } @@ -1283,7 +1283,7 @@ mod tests { let args = ~[~"progname", ~"filter", ~"--ignored"]; let opts = match parse_opts(args) { Some(Ok(o)) => o, - _ => fail2!("Malformed arg in parse_ignored_flag") + _ => fail!("Malformed arg in parse_ignored_flag") }; assert!((opts.run_ignored)); } diff --git a/src/libextra/time.rs b/src/libextra/time.rs index 9376e2258975..ab701f1f982c 100644 --- a/src/libextra/time.rs +++ b/src/libextra/time.rs @@ -955,13 +955,13 @@ mod tests { static SOME_FUTURE_DATE: i64 = 1577836800i64; // 2020-01-01T00:00:00Z let tv1 = get_time(); - debug2!("tv1={:?} sec + {:?} nsec", tv1.sec as uint, tv1.nsec as uint); + debug!("tv1={:?} sec + {:?} nsec", tv1.sec as uint, tv1.nsec as uint); assert!(tv1.sec > SOME_RECENT_DATE); assert!(tv1.nsec < 1000000000i32); let tv2 = get_time(); - debug2!("tv2={:?} sec + {:?} nsec", tv2.sec as uint, tv2.nsec as uint); + debug!("tv2={:?} sec + {:?} nsec", tv2.sec as uint, tv2.nsec as uint); assert!(tv2.sec >= tv1.sec); assert!(tv2.sec < SOME_FUTURE_DATE); @@ -975,16 +975,16 @@ mod tests { let s0 = precise_time_s(); let ns1 = precise_time_ns(); - debug2!("s0={} sec", f64::to_str_digits(s0, 9u)); + debug!("s0={} sec", f64::to_str_digits(s0, 9u)); assert!(s0 > 0.); let ns0 = (s0 * 1000000000.) as u64; - debug2!("ns0={:?} ns", ns0); + debug!("ns0={:?} ns", ns0); - debug2!("ns1={:?} ns", ns0); + debug!("ns1={:?} ns", ns0); assert!(ns1 >= ns0); let ns2 = precise_time_ns(); - debug2!("ns2={:?} ns", ns0); + debug!("ns2={:?} ns", ns0); assert!(ns2 >= ns1); } @@ -1016,7 +1016,7 @@ mod tests { let time = Timespec::new(1234567890, 54321); let local = at(time); - error2!("time_at: {:?}", local); + error!("time_at: {:?}", local); assert!(local.tm_sec == 30_i32); assert!(local.tm_min == 31_i32); @@ -1091,7 +1091,7 @@ mod tests { == Err(~"Invalid time")); match strptime("Fri Feb 13 15:31:30.01234 2009", format) { - Err(e) => fail2!(e), + Err(e) => fail!(e), Ok(ref tm) => { assert!(tm.tm_sec == 30_i32); assert!(tm.tm_min == 31_i32); @@ -1111,7 +1111,7 @@ mod tests { fn test(s: &str, format: &str) -> bool { match strptime(s, format) { Ok(ref tm) => tm.strftime(format) == s.to_owned(), - Err(e) => fail2!(e) + Err(e) => fail!(e) } } @@ -1237,7 +1237,7 @@ mod tests { let utc = at_utc(time); let local = at(time); - error2!("test_ctime: {:?} {:?}", utc.ctime(), local.ctime()); + error!("test_ctime: {:?} {:?}", utc.ctime(), local.ctime()); assert_eq!(utc.ctime(), ~"Fri Feb 13 23:31:30 2009"); assert_eq!(local.ctime(), ~"Fri Feb 13 15:31:30 2009"); diff --git a/src/libextra/treemap.rs b/src/libextra/treemap.rs index 432d854ad546..ad196b32fb2c 100644 --- a/src/libextra/treemap.rs +++ b/src/libextra/treemap.rs @@ -831,7 +831,7 @@ fn remove(node: &mut Option<~TreeNode>, } } return match node.take() { - Some(~TreeNode{value, _}) => Some(value), None => fail2!() + Some(~TreeNode{value, _}) => Some(value), None => fail!() }; } @@ -900,7 +900,7 @@ mod test_treemap { assert!(m.insert(5, 14)); let new = 100; match m.find_mut(&5) { - None => fail2!(), Some(x) => *x = new + None => fail!(), Some(x) => *x = new } assert_eq!(m.find(&5), Some(&new)); } diff --git a/src/libextra/workcache.rs b/src/libextra/workcache.rs index a30951890d59..3ee102513231 100644 --- a/src/libextra/workcache.rs +++ b/src/libextra/workcache.rs @@ -183,11 +183,11 @@ impl Database { assert!(os::path_exists(&self.db_filename)); let f = io::file_reader(&self.db_filename); match f { - Err(e) => fail2!("Couldn't load workcache database {}: {}", + Err(e) => fail!("Couldn't load workcache database {}: {}", self.db_filename.display(), e.to_str()), Ok(r) => match json::from_reader(r) { - Err(e) => fail2!("Couldn't parse workcache database (from file {}): {}", + Err(e) => fail!("Couldn't parse workcache database (from file {}): {}", self.db_filename.display(), e.to_str()), Ok(r) => { let mut decoder = json::Decoder(r); @@ -219,7 +219,7 @@ impl Logger { } pub fn info(&self, i: &str) { - info2!("workcache: {}", i); + info!("workcache: {}", i); } } @@ -264,7 +264,7 @@ fn json_encode>(t: &T) -> ~str { // FIXME(#5121) fn json_decode>(s: &str) -> T { - debug2!("json decoding: {}", s); + debug!("json decoding: {}", s); do io::with_str_reader(s) |rdr| { let j = json::from_reader(rdr).unwrap(); let mut decoder = json::Decoder(j); @@ -321,7 +321,7 @@ impl Exec { dependency_kind: &str, dependency_name: &str, dependency_val: &str) { - debug2!("Discovering input {} {} {}", dependency_kind, dependency_name, dependency_val); + debug!("Discovering input {} {} {}", dependency_kind, dependency_name, dependency_val); self.discovered_inputs.insert_work_key(WorkKey::new(dependency_kind, dependency_name), dependency_val.to_owned()); } @@ -329,7 +329,7 @@ impl Exec { dependency_kind: &str, dependency_name: &str, dependency_val: &str) { - debug2!("Discovering output {} {} {}", dependency_kind, dependency_name, dependency_val); + debug!("Discovering output {} {} {}", dependency_kind, dependency_name, dependency_val); self.discovered_outputs.insert_work_key(WorkKey::new(dependency_kind, dependency_name), dependency_val.to_owned()); } @@ -368,7 +368,7 @@ impl<'self> Prep<'self> { impl<'self> Prep<'self> { pub fn declare_input(&mut self, kind: &str, name: &str, val: &str) { - debug2!("Declaring input {} {} {}", kind, name, val); + debug!("Declaring input {} {} {}", kind, name, val); self.declared_inputs.insert_work_key(WorkKey::new(kind, name), val.to_owned()); } @@ -377,9 +377,9 @@ impl<'self> Prep<'self> { name: &str, val: &str) -> bool { let k = kind.to_owned(); let f = self.ctxt.freshness.get().find(&k); - debug2!("freshness for: {}/{}/{}/{}", cat, kind, name, val) + debug!("freshness for: {}/{}/{}/{}", cat, kind, name, val) let fresh = match f { - None => fail2!("missing freshness-function for '{}'", kind), + None => fail!("missing freshness-function for '{}'", kind), Some(f) => (*f)(name, val) }; do self.ctxt.logger.write |lg| { @@ -418,7 +418,7 @@ impl<'self> Prep<'self> { &'self self, blk: ~fn(&mut Exec) -> T) -> Work<'self, T> { let mut bo = Some(blk); - debug2!("exec_work: looking up {} and {:?}", self.fn_name, + debug!("exec_work: looking up {} and {:?}", self.fn_name, self.declared_inputs); let cached = do self.ctxt.db.read |db| { db.prepare(self.fn_name, &self.declared_inputs) @@ -429,14 +429,14 @@ impl<'self> Prep<'self> { if self.all_fresh("declared input",&self.declared_inputs) && self.all_fresh("discovered input", disc_in) && self.all_fresh("discovered output", disc_out) => { - debug2!("Cache hit!"); - debug2!("Trying to decode: {:?} / {:?} / {}", + debug!("Cache hit!"); + debug!("Trying to decode: {:?} / {:?} / {}", disc_in, disc_out, *res); Work::from_value(json_decode(*res)) } _ => { - debug2!("Cache miss!"); + debug!("Cache miss!"); let (port, chan) = oneshot(); let blk = bo.take_unwrap(); let chan = Cell::new(chan); diff --git a/src/librustc/back/link.rs b/src/librustc/back/link.rs index 7c2856b75776..8bf3d5008db2 100644 --- a/src/librustc/back/link.rs +++ b/src/librustc/back/link.rs @@ -129,13 +129,13 @@ pub mod jit { let cstore = sess.cstore; let r = cstore::get_used_crate_files(cstore); for cratepath in r.iter() { - debug2!("linking: {}", cratepath.display()); + debug!("linking: {}", cratepath.display()); do cratepath.with_c_str |buf_t| { if !llvm::LLVMRustLoadCrate(manager, buf_t) { llvm_err(sess, ~"Could not link"); } - debug2!("linked: {}", cratepath.display()); + debug!("linked: {}", cratepath.display()); } } @@ -915,20 +915,20 @@ pub fn link_binary(sess: Session, let output = if *sess.building_library { let long_libname = output_dll_filename(sess.targ_cfg.os, lm); - debug2!("link_meta.name: {}", lm.name); - debug2!("long_libname: {}", long_libname); - debug2!("out_filename: {}", out_filename.display()); + debug!("link_meta.name: {}", lm.name); + debug!("long_libname: {}", long_libname); + debug!("out_filename: {}", out_filename.display()); let out_dirname = out_filename.dir_path(); - debug2!("dirname(out_filename): {}", out_dirname.display()); + debug!("dirname(out_filename): {}", out_dirname.display()); out_filename.with_filename(long_libname) } else { out_filename.clone() }; - debug2!("output: {}", output.display()); + debug!("output: {}", output.display()); let cc_args = link_args(sess, obj_filename, out_filename, lm); - debug2!("{} link args: {}", cc_prog, cc_args.connect(" ")); + debug!("{} link args: {}", cc_prog, cc_args.connect(" ")); if (sess.opts.debugging_opts & session::print_link_args) != 0 { io::println(format!("{} link args: {}", cc_prog, cc_args.connect(" "))); } diff --git a/src/librustc/back/rpath.rs b/src/librustc/back/rpath.rs index faf8dd25186f..3d6a8350795b 100644 --- a/src/librustc/back/rpath.rs +++ b/src/librustc/back/rpath.rs @@ -29,7 +29,7 @@ pub fn get_rpath_flags(sess: session::Session, out_filename: &Path) return ~[]; } - debug2!("preparing the RPATH!"); + debug!("preparing the RPATH!"); let sysroot = sess.filesearch.sysroot(); let output = out_filename; @@ -60,13 +60,13 @@ fn get_rpaths(os: session::Os, output: &Path, libs: &[Path], target_triple: &str) -> ~[~str] { - debug2!("sysroot: {}", sysroot.display()); - debug2!("output: {}", output.display()); - debug2!("libs:"); + debug!("sysroot: {}", sysroot.display()); + debug!("output: {}", output.display()); + debug!("libs:"); for libpath in libs.iter() { - debug2!(" {}", libpath.display()); + debug!(" {}", libpath.display()); } - debug2!("target_triple: {}", target_triple); + debug!("target_triple: {}", target_triple); // Use relative paths to the libraries. Binaries can be moved // as long as they maintain the relative relationship to the @@ -81,9 +81,9 @@ fn get_rpaths(os: session::Os, let fallback_rpaths = ~[get_install_prefix_rpath(target_triple)]; fn log_rpaths(desc: &str, rpaths: &[~str]) { - debug2!("{} rpaths:", desc); + debug!("{} rpaths:", desc); for rpath in rpaths.iter() { - debug2!(" {}", *rpath); + debug!(" {}", *rpath); } } @@ -188,7 +188,7 @@ mod test { let res = get_install_prefix_rpath("triple"); let mut d = Path::new(env!("CFG_PREFIX")); d.push("lib/rustc/triple/lib"); - debug2!("test_prefix_path: {} vs. {}", + debug!("test_prefix_path: {} vs. {}", res, d.display()); assert!(res.as_bytes().ends_with(d.as_vec())); @@ -248,7 +248,7 @@ mod test { fn test_get_absolute_rpath() { let res = get_absolute_rpath(&Path::new("lib/libstd.so")); let lib = os::make_absolute(&Path::new("lib")); - debug2!("test_get_absolute_rpath: {} vs. {}", + debug!("test_get_absolute_rpath: {} vs. {}", res.to_str(), lib.display()); // FIXME (#9639): This needs to handle non-utf8 paths diff --git a/src/librustc/driver/driver.rs b/src/librustc/driver/driver.rs index 5ca81a91bfd0..67a59f24e293 100644 --- a/src/librustc/driver/driver.rs +++ b/src/librustc/driver/driver.rs @@ -394,7 +394,7 @@ pub fn phase_6_link_output(sess: Session, pub fn stop_after_phase_3(sess: Session) -> bool { if sess.opts.no_trans { - debug2!("invoked with --no-trans, returning early from compile_input"); + debug!("invoked with --no-trans, returning early from compile_input"); return true; } return false; @@ -402,7 +402,7 @@ pub fn stop_after_phase_3(sess: Session) -> bool { pub fn stop_after_phase_1(sess: Session) -> bool { if sess.opts.parse_only { - debug2!("invoked with --parse-only, returning early from compile_input"); + debug!("invoked with --parse-only, returning early from compile_input"); return true; } return false; @@ -410,17 +410,17 @@ pub fn stop_after_phase_1(sess: Session) -> bool { pub fn stop_after_phase_5(sess: Session) -> bool { if sess.opts.output_type != link::output_type_exe { - debug2!("not building executable, returning early from compile_input"); + debug!("not building executable, returning early from compile_input"); return true; } if sess.opts.is_static && *sess.building_library { - debug2!("building static library, returning early from compile_input"); + debug!("building static library, returning early from compile_input"); return true; } if sess.opts.jit { - debug2!("running JIT, returning early from compile_input"); + debug!("running JIT, returning early from compile_input"); return true; } return false; @@ -1045,7 +1045,7 @@ pub fn build_output_filenames(input: &input, pub fn early_error(emitter: @diagnostic::Emitter, msg: &str) -> ! { emitter.emit(None, msg, diagnostic::fatal); - fail2!(); + fail!(); } pub fn list_metadata(sess: Session, path: &Path, out: @io::Writer) { @@ -1070,7 +1070,7 @@ mod test { let matches = &match getopts([~"--test"], optgroups()) { Ok(m) => m, - Err(f) => fail2!("test_switch_implies_cfg_test: {}", f.to_err_msg()) + Err(f) => fail!("test_switch_implies_cfg_test: {}", f.to_err_msg()) }; let sessopts = build_session_options( @"rustc", @@ -1091,7 +1091,7 @@ mod test { &match getopts([~"--test", ~"--cfg=test"], optgroups()) { Ok(m) => m, Err(f) => { - fail2!("test_switch_implies_cfg_test_unless_cfg_test: {}", + fail!("test_switch_implies_cfg_test_unless_cfg_test: {}", f.to_err_msg()); } }; diff --git a/src/librustc/front/test.rs b/src/librustc/front/test.rs index aad2228f66fd..9541a03aff25 100644 --- a/src/librustc/front/test.rs +++ b/src/librustc/front/test.rs @@ -78,7 +78,7 @@ impl fold::ast_fold for TestHarnessGenerator { fn fold_item(&self, i: @ast::item) -> Option<@ast::item> { self.cx.path.push(i.ident); - debug2!("current path: {}", + debug!("current path: {}", ast_util::path_name_i(self.cx.path.clone())); if is_test_fn(self.cx, i) || is_bench_fn(i) { @@ -91,7 +91,7 @@ impl fold::ast_fold for TestHarnessGenerator { tests"); } _ => { - debug2!("this is a test function"); + debug!("this is a test function"); let test = Test { span: i.span, path: self.cx.path.clone(), @@ -100,7 +100,7 @@ impl fold::ast_fold for TestHarnessGenerator { should_fail: should_fail(i) }; self.cx.testfns.push(test); - // debug2!("have {} test/bench functions", + // debug!("have {} test/bench functions", // cx.testfns.len()); } } @@ -327,7 +327,7 @@ fn mk_test_module(cx: &TestCtxt) -> @ast::item { span: dummy_sp(), }; - debug2!("Synthetic test module:\n{}\n", + debug!("Synthetic test module:\n{}\n", pprust::item_to_str(@item.clone(), cx.sess.intr())); return @item; @@ -381,7 +381,7 @@ fn is_extra(crate: &ast::Crate) -> bool { } fn mk_test_descs(cx: &TestCtxt) -> @ast::Expr { - debug2!("building test vector from {} tests", cx.testfns.len()); + debug!("building test vector from {} tests", cx.testfns.len()); let mut descs = ~[]; for test in cx.testfns.iter() { descs.push(mk_test_desc_and_fn_rec(cx, test)); @@ -404,7 +404,7 @@ fn mk_test_desc_and_fn_rec(cx: &TestCtxt, test: &Test) -> @ast::Expr { let span = test.span; let path = test.path.clone(); - debug2!("encoding {}", ast_util::path_name_i(path)); + debug!("encoding {}", ast_util::path_name_i(path)); let name_lit: ast::lit = nospan(ast::lit_str(ast_util::path_name_i(path).to_managed(), ast::CookedStr)); diff --git a/src/librustc/metadata/creader.rs b/src/librustc/metadata/creader.rs index 9700f68383ad..f7b1955191ab 100644 --- a/src/librustc/metadata/creader.rs +++ b/src/librustc/metadata/creader.rs @@ -74,11 +74,11 @@ struct cache_entry { } fn dump_crates(crate_cache: &[cache_entry]) { - debug2!("resolved crates:"); + debug!("resolved crates:"); for entry in crate_cache.iter() { - debug2!("cnum: {:?}", entry.cnum); - debug2!("span: {:?}", entry.span); - debug2!("hash: {:?}", entry.hash); + debug!("cnum: {:?}", entry.cnum); + debug!("span: {:?}", entry.span); + debug!("hash: {:?}", entry.hash); } } @@ -155,7 +155,7 @@ fn visit_view_item(e: @mut Env, i: &ast::view_item) { } } }; - debug2!("resolving extern mod stmt. ident: {:?}, meta: {:?}", + debug!("resolving extern mod stmt. ident: {:?}, meta: {:?}", ident, meta_items); let cnum = resolve_crate(e, ident, @@ -321,7 +321,7 @@ fn resolve_crate(e: @mut Env, // Go through the crate metadata and load any crates that it references fn resolve_crate_deps(e: @mut Env, cdata: @~[u8]) -> cstore::cnum_map { - debug2!("resolving deps of external crate"); + debug!("resolving deps of external crate"); // The map from crate numbers in the crate we're resolving to local crate // numbers let mut cnum_map = HashMap::new(); @@ -330,18 +330,18 @@ fn resolve_crate_deps(e: @mut Env, cdata: @~[u8]) -> cstore::cnum_map { let extrn_cnum = dep.cnum; let cname_str = token::ident_to_str(&dep.name); let cmetas = metas_with(dep.vers, @"vers", ~[]); - debug2!("resolving dep crate {} ver: {} hash: {}", + debug!("resolving dep crate {} ver: {} hash: {}", cname_str, dep.vers, dep.hash); match existing_match(e, metas_with_ident(cname_str, cmetas.clone()), dep.hash) { Some(local_cnum) => { - debug2!("already have it"); + debug!("already have it"); // We've already seen this crate cnum_map.insert(extrn_cnum, local_cnum); } None => { - debug2!("need to load it"); + debug!("need to load it"); // This is a new one so we've got to load it // FIXME (#2404): Need better error reporting than just a bogus // span. diff --git a/src/librustc/metadata/csearch.rs b/src/librustc/metadata/csearch.rs index 6def597b89fb..617051c217f5 100644 --- a/src/librustc/metadata/csearch.rs +++ b/src/librustc/metadata/csearch.rs @@ -210,17 +210,17 @@ pub fn get_field_type(tcx: ty::ctxt, class_id: ast::DefId, let cstore = tcx.cstore; let cdata = cstore::get_crate_data(cstore, class_id.crate); let all_items = reader::get_doc(reader::Doc(cdata.data), tag_items); - debug2!("Looking up {:?}", class_id); + debug!("Looking up {:?}", class_id); let class_doc = expect(tcx.diag, decoder::maybe_find_item(class_id.node, all_items), || format!("get_field_type: class ID {:?} not found", class_id) ); - debug2!("looking up {:?} : {:?}", def, class_doc); + debug!("looking up {:?} : {:?}", def, class_doc); let the_field = expect(tcx.diag, decoder::maybe_find_item(def.node, class_doc), || format!("get_field_type: in class {:?}, field ID {:?} not found", class_id, def) ); - debug2!("got field data {:?}", the_field); + debug!("got field data {:?}", the_field); let ty = decoder::item_type(def, the_field, tcx, cdata); ty::ty_param_bounds_and_ty { generics: ty::Generics {type_param_defs: @~[], diff --git a/src/librustc/metadata/cstore.rs b/src/librustc/metadata/cstore.rs index 226c19a5d5e4..3c79ea2fe5e3 100644 --- a/src/librustc/metadata/cstore.rs +++ b/src/librustc/metadata/cstore.rs @@ -152,7 +152,7 @@ pub fn get_dep_hashes(cstore: &CStore) -> ~[@str] { let cdata = cstore::get_crate_data(cstore, cnum); let hash = decoder::get_crate_hash(cdata.data); let vers = decoder::get_crate_vers(cdata.data); - debug2!("Add hash[{}]: {} {}", cdata.name, vers, hash); + debug!("Add hash[{}]: {} {}", cdata.name, vers, hash); result.push(crate_hash { name: cdata.name, vers: vers, @@ -164,9 +164,9 @@ pub fn get_dep_hashes(cstore: &CStore) -> ~[@str] { (a.name, a.vers, a.hash) <= (b.name, b.vers, b.hash) }; - debug2!("sorted:"); + debug!("sorted:"); for x in sorted.iter() { - debug2!(" hash[{}]: {}", x.name, x.hash); + debug!(" hash[{}]: {}", x.name, x.hash); } sorted.map(|ch| ch.hash) diff --git a/src/librustc/metadata/decoder.rs b/src/librustc/metadata/decoder.rs index cf34d129fec8..aa1c4c1eb7ec 100644 --- a/src/librustc/metadata/decoder.rs +++ b/src/librustc/metadata/decoder.rs @@ -89,7 +89,7 @@ pub fn maybe_find_item(item_id: int, items: ebml::Doc) -> Option { fn find_item(item_id: int, items: ebml::Doc) -> ebml::Doc { match maybe_find_item(item_id, items) { - None => fail2!("lookup_item: id not found: {}", item_id), + None => fail!("lookup_item: id not found: {}", item_id), Some(d) => d } } @@ -148,7 +148,7 @@ fn item_family(item: ebml::Doc) -> Family { 'g' => PublicField, 'j' => PrivateField, 'N' => InheritedField, - c => fail2!("unexpected family char: {}", c) + c => fail!("unexpected family char: {}", c) } } @@ -160,7 +160,7 @@ fn item_visibility(item: ebml::Doc) -> ast::visibility { 'y' => ast::public, 'n' => ast::private, 'i' => ast::inherited, - _ => fail2!("unknown visibility character") + _ => fail!("unknown visibility character") } } } @@ -494,8 +494,8 @@ pub enum DefLike { pub fn def_like_to_def(def_like: DefLike) -> ast::Def { match def_like { DlDef(def) => return def, - DlImpl(*) => fail2!("found impl in def_like_to_def"), - DlField => fail2!("found field in def_like_to_def") + DlImpl(*) => fail!("found impl in def_like_to_def"), + DlField => fail!("found field in def_like_to_def") } } @@ -550,13 +550,13 @@ impl<'self> EachItemContext<'self> { let def_like = item_to_def_like(doc, def_id, self.cdata.cnum); match def_like { DlDef(def) => { - debug2!("(iterating over each item of a module) processing \ + debug!("(iterating over each item of a module) processing \ `{}` (def {:?})", *self.path_builder, def); } _ => { - debug2!("(iterating over each item of a module) processing \ + debug!("(iterating over each item of a module) processing \ `{}` ({}:{})", *self.path_builder, def_id.crate, @@ -631,7 +631,7 @@ impl<'self> EachItemContext<'self> { reader::get_doc(root, tag_items) }; - debug2!("(iterating over each item of a module) looking up item \ + debug!("(iterating over each item of a module) looking up item \ {}:{} in `{}`, crate {}", child_def_id.crate, child_def_id.node, @@ -644,7 +644,7 @@ impl<'self> EachItemContext<'self> { Some(child_item_doc) => { // Push the name. let child_name = item_name(self.intr, child_item_doc); - debug2!("(iterating over each item of a module) pushing \ + debug!("(iterating over each item of a module) pushing \ name `{}` onto `{}`", token::ident_to_str(&child_name), *self.path_builder); @@ -682,7 +682,7 @@ impl<'self> EachItemContext<'self> { let name = name_doc.as_str_slice(); // Push the name. - debug2!("(iterating over each item of a module) pushing \ + debug!("(iterating over each item of a module) pushing \ reexported name `{}` onto `{}` (crate {}, orig {}, \ in crate {})", name, @@ -900,7 +900,7 @@ pub fn maybe_get_item_ast(cdata: Cmd, tcx: ty::ctxt, id: ast::NodeId, decode_inlined_item: decode_inlined_item) -> csearch::found_ast { - debug2!("Looking up item: {}", id); + debug!("Looking up item: {}", id); let item_doc = lookup_item(id, cdata.data); let path = { let item_path = item_path(item_doc); @@ -965,7 +965,7 @@ fn get_explicit_self(item: ebml::Doc) -> ast::explicit_self_ { match ch as char { 'i' => ast::MutImmutable, 'm' => ast::MutMutable, - _ => fail2!("unknown mutability character: `{}`", ch as char), + _ => fail!("unknown mutability character: `{}`", ch as char), } } @@ -983,7 +983,7 @@ fn get_explicit_self(item: ebml::Doc) -> ast::explicit_self_ { return ast::sty_region(None, get_mutability(string[1])); } _ => { - fail2!("unknown self type code: `{}`", explicit_self_kind as char); + fail!("unknown self type code: `{}`", explicit_self_kind as char); } } } @@ -1164,7 +1164,7 @@ pub fn get_static_methods_if_impl(intr: @ident_interner, match item_family(impl_method_doc) { StaticMethod => purity = ast::impure_fn, UnsafeStaticMethod => purity = ast::unsafe_fn, - _ => fail2!() + _ => fail!() } static_impl_methods.push(StaticMethodInfo { @@ -1200,7 +1200,7 @@ fn struct_field_family_to_visibility(family: Family) -> ast::visibility { PublicField => ast::public, PrivateField => ast::private, InheritedField => ast::inherited, - _ => fail2!() + _ => fail!() } } @@ -1266,7 +1266,7 @@ fn describe_def(items: ebml::Doc, id: ast::DefId) -> ~str { if id.crate != ast::LOCAL_CRATE { return ~"external"; } let it = match maybe_find_item(id.node, items) { Some(it) => it, - None => fail2!("describe_def: item not found {:?}", id) + None => fail!("describe_def: item not found {:?}", id) }; return item_family_to_str(item_family(it)); } @@ -1453,7 +1453,7 @@ pub fn translate_def_id(cdata: Cmd, did: ast::DefId) -> ast::DefId { match cdata.cnum_map.find(&did.crate) { option::Some(&n) => ast::DefId { crate: n, node: did.node }, - option::None => fail2!("didn't find a crate in the cnum_map") + option::None => fail!("didn't find a crate in the cnum_map") } } diff --git a/src/librustc/metadata/encoder.rs b/src/librustc/metadata/encoder.rs index 5434e7ab07b1..9f40593a93ae 100644 --- a/src/librustc/metadata/encoder.rs +++ b/src/librustc/metadata/encoder.rs @@ -282,7 +282,7 @@ fn encode_symbol(ecx: &EncodeContext, ebml_w.start_tag(tag_items_data_item_symbol); match ecx.item_symbols.find(&id) { Some(x) => { - debug2!("encode_symbol(id={:?}, str={})", id, *x); + debug!("encode_symbol(id={:?}, str={})", id, *x); ebml_w.writer.write(x.as_bytes()); } None => { @@ -337,7 +337,7 @@ fn encode_enum_variant_info(ecx: &EncodeContext, path: &[ast_map::path_elt], index: @mut ~[entry], generics: &ast::Generics) { - debug2!("encode_enum_variant_info(id={:?})", id); + debug!("encode_enum_variant_info(id={:?})", id); let mut disr_val = 0; let mut i = 0; @@ -423,7 +423,7 @@ fn encode_reexported_static_method(ecx: &EncodeContext, exp: &middle::resolve::Export2, method_def_id: DefId, method_ident: Ident) { - debug2!("(encode reexported static method) {}::{}", + debug!("(encode reexported static method) {}::{}", exp.name, ecx.tcx.sess.str_of(method_ident)); ebml_w.start_tag(tag_items_data_item_reexport); ebml_w.start_tag(tag_items_data_item_reexport_def_id); @@ -496,13 +496,13 @@ fn encode_reexported_static_methods(ecx: &EncodeContext, if mod_path != *path || exp.name != original_name { if !encode_reexported_static_base_methods(ecx, ebml_w, exp) { if encode_reexported_static_trait_methods(ecx, ebml_w, exp) { - debug2!("(encode reexported static methods) {} \ + debug!("(encode reexported static methods) {} \ [trait]", original_name); } } else { - debug2!("(encode reexported static methods) {} [base]", + debug!("(encode reexported static methods) {} [base]", original_name); } } @@ -550,12 +550,12 @@ fn encode_reexports(ecx: &EncodeContext, ebml_w: &mut writer::Encoder, id: NodeId, path: &[ast_map::path_elt]) { - debug2!("(encoding info for module) encoding reexports for {}", id); + debug!("(encoding info for module) encoding reexports for {}", id); match ecx.reexports2.find(&id) { Some(ref exports) => { - debug2!("(encoding info for module) found reexports for {}", id); + debug!("(encoding info for module) found reexports for {}", id); for exp in exports.iter() { - debug2!("(encoding info for module) reexport '{}' ({}/{}) for \ + debug!("(encoding info for module) reexport '{}' ({}/{}) for \ {}", exp.name, exp.def_id.crate, @@ -573,7 +573,7 @@ fn encode_reexports(ecx: &EncodeContext, } } None => { - debug2!("(encoding info for module) found no reexports for {}", + debug!("(encoding info for module) found no reexports for {}", id); } } @@ -590,7 +590,7 @@ fn encode_info_for_mod(ecx: &EncodeContext, encode_def_id(ebml_w, local_def(id)); encode_family(ebml_w, 'm'); encode_name(ecx, ebml_w, name); - debug2!("(encoding info for module) encoding info for module ID {}", id); + debug!("(encoding info for module) encoding info for module ID {}", id); // Encode info about all the module children. for item in md.items.iter() { @@ -608,7 +608,7 @@ fn encode_info_for_mod(ecx: &EncodeContext, match item.node { item_impl(*) => { let (ident, did) = (item.ident, item.id); - debug2!("(encoding info for module) ... encoding impl {} \ + debug!("(encoding info for module) ... encoding impl {} \ ({:?}/{:?})", ecx.tcx.sess.str_of(ident), did, @@ -627,7 +627,7 @@ fn encode_info_for_mod(ecx: &EncodeContext, // Encode the reexports of this module, if this module is public. if vis == public { - debug2!("(encoding info for module) encoding reexports for {}", id); + debug!("(encoding info for module) encoding reexports for {}", id); encode_reexports(ecx, ebml_w, id, path); } @@ -729,7 +729,7 @@ fn encode_info_for_struct(ecx: &EncodeContext, index.push(entry {val: id as i64, pos: ebml_w.writer.tell()}); global_index.push(entry {val: id as i64, pos: ebml_w.writer.tell()}); ebml_w.start_tag(tag_items_data_item); - debug2!("encode_info_for_struct: doing {} {}", + debug!("encode_info_for_struct: doing {} {}", tcx.sess.str_of(nm), id); encode_struct_field_family(ebml_w, vis); encode_name(ecx, ebml_w, nm); @@ -795,7 +795,7 @@ fn encode_info_for_method(ecx: &EncodeContext, parent_id: NodeId, ast_method_opt: Option<@method>) { - debug2!("encode_info_for_method: {:?} {}", m.def_id, + debug!("encode_info_for_method: {:?} {}", m.def_id, ecx.tcx.sess.str_of(m.ident)); ebml_w.start_tag(tag_items_data_item); @@ -835,7 +835,7 @@ fn purity_static_method_family(p: purity) -> char { match p { unsafe_fn => 'U', impure_fn => 'F', - _ => fail2!("extern fn can't be static") + _ => fail!("extern fn can't be static") } } @@ -894,7 +894,7 @@ fn encode_info_for_item(ecx: &EncodeContext, } let add_to_index: &fn() = || add_to_index_(item, ebml_w, index); - debug2!("encoding info for item at {}", + debug!("encoding info for item at {}", ecx.tcx.sess.codemap.span_to_str(item.span)); let def_id = local_def(item.id); @@ -1224,7 +1224,7 @@ fn encode_info_for_item(ecx: &EncodeContext, // Encode inherent implementations for this trait. encode_inherent_implementations(ecx, ebml_w, def_id); } - item_mac(*) => fail2!("item macros unimplemented") + item_mac(*) => fail!("item macros unimplemented") } } @@ -1278,7 +1278,7 @@ fn my_visit_item(i:@item, items: ast_map::map, ebml_w:&writer::Encoder, let ecx : &EncodeContext = unsafe { cast::transmute(ecx_ptr) }; encode_info_for_item(ecx, &mut ebml_w, i, index, *pt, i.vis); } - _ => fail2!("bad item") + _ => fail!("bad item") } } @@ -1286,7 +1286,7 @@ fn my_visit_foreign_item(ni:@foreign_item, items: ast_map::map, ebml_w:&writer:: ecx_ptr:*int, index: @mut ~[entry]) { match items.get_copy(&ni.id) { ast_map::node_foreign_item(_, abi, _, pt) => { - debug2!("writing foreign item {}::{}", + debug!("writing foreign item {}::{}", ast_map::path_to_str( *pt, token::get_ident_interner()), @@ -1303,7 +1303,7 @@ fn my_visit_foreign_item(ni:@foreign_item, items: ast_map::map, ebml_w:&writer:: abi); } // case for separate item and foreign-item tables - _ => fail2!("bad foreign item") + _ => fail!("bad foreign item") } } diff --git a/src/librustc/metadata/filesearch.rs b/src/librustc/metadata/filesearch.rs index 8f4261470788..4b679072bba7 100644 --- a/src/librustc/metadata/filesearch.rs +++ b/src/librustc/metadata/filesearch.rs @@ -53,7 +53,7 @@ pub fn mk_filesearch(maybe_sysroot: &Option<@Path>, let mut visited_dirs = HashSet::new(); let mut found = false; - debug2!("filesearch: searching additional lib search paths [{:?}]", + debug!("filesearch: searching additional lib search paths [{:?}]", self.addl_lib_search_paths.len()); for path in self.addl_lib_search_paths.iter() { match f(path) { @@ -63,7 +63,7 @@ pub fn mk_filesearch(maybe_sysroot: &Option<@Path>, visited_dirs.insert(path.as_vec().to_owned()); } - debug2!("filesearch: searching target lib path"); + debug!("filesearch: searching target lib path"); let tlib_path = make_target_lib_path(self.sysroot, self.target_triple); if !visited_dirs.contains_equiv(&tlib_path.as_vec()) { @@ -78,7 +78,7 @@ pub fn mk_filesearch(maybe_sysroot: &Option<@Path>, let rustpath = rust_path(); for path in rustpath.iter() { let tlib_path = make_rustpkg_target_lib_path(path, self.target_triple); - debug2!("is {} in visited_dirs? {:?}", tlib_path.display(), + debug!("is {} in visited_dirs? {:?}", tlib_path.display(), visited_dirs.contains_equiv(&tlib_path.as_vec().to_owned())); if !visited_dirs.contains_equiv(&tlib_path.as_vec()) { @@ -106,7 +106,7 @@ pub fn mk_filesearch(maybe_sysroot: &Option<@Path>, } let sysroot = get_sysroot(maybe_sysroot); - debug2!("using sysroot = {}", sysroot.display()); + debug!("using sysroot = {}", sysroot.display()); @FileSearchImpl { sysroot: sysroot, addl_lib_search_paths: addl_lib_search_paths, @@ -116,19 +116,19 @@ pub fn mk_filesearch(maybe_sysroot: &Option<@Path>, pub fn search(filesearch: @FileSearch, pick: pick) { do filesearch.for_each_lib_search_path() |lib_search_path| { - debug2!("searching {}", lib_search_path.display()); + debug!("searching {}", lib_search_path.display()); let r = os::list_dir_path(lib_search_path); let mut rslt = FileDoesntMatch; for path in r.iter() { - debug2!("testing {}", path.display()); + debug!("testing {}", path.display()); let maybe_picked = pick(path); match maybe_picked { FileMatches => { - debug2!("picked {}", path.display()); + debug!("picked {}", path.display()); rslt = FileMatches; } FileDoesntMatch => { - debug2!("rejected {}", path.display()); + debug!("rejected {}", path.display()); } } } @@ -161,7 +161,7 @@ fn make_rustpkg_target_lib_path(dir: &Path, pub fn get_or_default_sysroot() -> Path { match os::self_exe_path() { option::Some(p) => { let mut p = p; p.pop(); p } - option::None => fail2!("can't determine value for sysroot") + option::None => fail!("can't determine value for sysroot") } } diff --git a/src/librustc/metadata/loader.rs b/src/librustc/metadata/loader.rs index 593a02c95082..e682ff299a93 100644 --- a/src/librustc/metadata/loader.rs +++ b/src/librustc/metadata/loader.rs @@ -99,21 +99,21 @@ fn find_library_crate_aux( None => FileDoesntMatch, Some(path_str) => if path_str.starts_with(prefix) && path_str.ends_with(suffix) { - debug2!("{} is a candidate", path.display()); + debug!("{} is a candidate", path.display()); match get_metadata_section(cx.os, path) { Some(cvec) => if !crate_matches(cvec, cx.metas, cx.hash) { - debug2!("skipping {}, metadata doesn't match", + debug!("skipping {}, metadata doesn't match", path.display()); FileDoesntMatch } else { - debug2!("found {} with matching metadata", path.display()); + debug!("found {} with matching metadata", path.display()); // FIXME (#9639): This needs to handle non-utf8 paths matches.push((path.as_str().unwrap().to_owned(), cvec)); FileMatches }, _ => { - debug2!("could not load metadata for {}", path.display()); + debug!("could not load metadata for {}", path.display()); FileDoesntMatch } } @@ -151,7 +151,7 @@ pub fn crate_name_from_metas(metas: &[@ast::MetaItem]) -> @str { _ => {} } } - fail2!("expected to find the crate name") + fail!("expected to find the crate name") } pub fn package_id_from_metas(metas: &[@ast::MetaItem]) -> Option<@str> { @@ -190,7 +190,7 @@ pub fn metadata_matches(extern_metas: &[@ast::MetaItem], // extern_metas: metas we read from the crate // local_metas: metas we're looking for - debug2!("matching {} metadata requirements against {} items", + debug!("matching {} metadata requirements against {} items", local_metas.len(), extern_metas.len()); do local_metas.iter().all |needed| { @@ -213,14 +213,14 @@ fn get_metadata_section(os: Os, while llvm::LLVMIsSectionIteratorAtEnd(of.llof, si.llsi) == False { let name_buf = llvm::LLVMGetSectionName(si.llsi); let name = str::raw::from_c_str(name_buf); - debug2!("get_metadata_section: name {}", name); + debug!("get_metadata_section: name {}", name); if read_meta_section_name(os) == name { let cbuf = llvm::LLVMGetSectionContents(si.llsi); let csz = llvm::LLVMGetSectionSize(si.llsi) as uint; let mut found = None; let cvbuf: *u8 = cast::transmute(cbuf); let vlen = encoder::metadata_encoding_version.len(); - debug2!("checking {} bytes of metadata-version stamp", + debug!("checking {} bytes of metadata-version stamp", vlen); let minsz = num::min(vlen, csz); let mut version_ok = false; @@ -231,7 +231,7 @@ fn get_metadata_section(os: Os, if !version_ok { return None; } let cvbuf1 = ptr::offset(cvbuf, vlen as int); - debug2!("inflating {} bytes of compressed metadata", + debug!("inflating {} bytes of compressed metadata", csz - vlen); do vec::raw::buf_as_slice(cvbuf1, csz-vlen) |bytes| { let inflated = flate::inflate_bytes(bytes); diff --git a/src/librustc/metadata/tydecode.rs b/src/librustc/metadata/tydecode.rs index d7a544320c26..62de991ce963 100644 --- a/src/librustc/metadata/tydecode.rs +++ b/src/librustc/metadata/tydecode.rs @@ -80,10 +80,10 @@ fn scan(st: &mut PState, is_last: &fn(char) -> bool, op: &fn(&[u8]) -> R) -> R { let start_pos = st.pos; - debug2!("scan: '{}' (start)", st.data[st.pos] as char); + debug!("scan: '{}' (start)", st.data[st.pos] as char); while !is_last(st.data[st.pos] as char) { st.pos += 1; - debug2!("scan: '{}'", st.data[st.pos] as char); + debug!("scan: '{}'", st.data[st.pos] as char); } let end_pos = st.pos; st.pos += 1; @@ -221,7 +221,7 @@ fn parse_region_substs(st: &mut PState) -> ty::RegionSubsts { assert_eq!(next(st), '.'); ty::NonerasedRegions(regions) } - _ => fail2!("parse_bound_region: bad input") + _ => fail!("parse_bound_region: bad input") } } @@ -239,7 +239,7 @@ fn parse_bound_region(st: &mut PState) -> ty::bound_region { assert_eq!(next(st), '|'); ty::br_cap_avoid(id, @parse_bound_region(st)) }, - _ => fail2!("parse_bound_region: bad input") + _ => fail!("parse_bound_region: bad input") } } @@ -268,7 +268,7 @@ fn parse_region(st: &mut PState) -> ty::Region { 'e' => { ty::re_static } - _ => fail2!("parse_region: bad input") + _ => fail!("parse_region: bad input") } } @@ -276,7 +276,7 @@ fn parse_opt(st: &mut PState, f: &fn(&mut PState) -> T) -> Option { match next(st) { 'n' => None, 's' => Some(f(st)), - _ => fail2!("parse_opt: bad input") + _ => fail!("parse_opt: bad input") } } @@ -316,7 +316,7 @@ fn parse_ty(st: &mut PState, conv: conv_did) -> ty::t { 'D' => return ty::mk_mach_int(ast::ty_i64), 'f' => return ty::mk_mach_float(ast::ty_f32), 'F' => return ty::mk_mach_float(ast::ty_f64), - _ => fail2!("parse_ty: bad numeric type") + _ => fail!("parse_ty: bad numeric type") } } 'c' => return ty::mk_char(), @@ -339,7 +339,7 @@ fn parse_ty(st: &mut PState, conv: conv_did) -> ty::t { } 'p' => { let did = parse_def(st, TypeParameter, conv); - debug2!("parsed ty_param: did={:?}", did); + debug!("parsed ty_param: did={:?}", did); return ty::mk_param(st.tcx, parse_uint(st), did); } 's' => { @@ -416,7 +416,7 @@ fn parse_ty(st: &mut PState, conv: conv_did) -> ty::t { assert_eq!(next(st), ']'); return ty::mk_struct(st.tcx, did, substs); } - c => { error2!("unexpected char in type string: {}", c); fail2!();} + c => { error!("unexpected char in type string: {}", c); fail!();} } } @@ -466,7 +466,7 @@ fn parse_purity(c: char) -> purity { 'u' => unsafe_fn, 'i' => impure_fn, 'c' => extern_fn, - _ => fail2!("parse_purity: bad purity {}", c) + _ => fail!("parse_purity: bad purity {}", c) } } @@ -487,7 +487,7 @@ fn parse_onceness(c: char) -> ast::Onceness { match c { 'o' => ast::Once, 'm' => ast::Many, - _ => fail2!("parse_onceness: bad onceness") + _ => fail!("parse_onceness: bad onceness") } } @@ -538,8 +538,8 @@ pub fn parse_def_id(buf: &[u8]) -> ast::DefId { let len = buf.len(); while colon_idx < len && buf[colon_idx] != ':' as u8 { colon_idx += 1u; } if colon_idx == len { - error2!("didn't find ':' when parsing def id"); - fail2!(); + error!("didn't find ':' when parsing def id"); + fail!(); } let crate_part = buf.slice(0u, colon_idx); @@ -547,12 +547,12 @@ pub fn parse_def_id(buf: &[u8]) -> ast::DefId { let crate_num = match uint::parse_bytes(crate_part, 10u) { Some(cn) => cn as int, - None => fail2!("internal error: parse_def_id: crate number expected, but found {:?}", + None => fail!("internal error: parse_def_id: crate number expected, but found {:?}", crate_part) }; let def_num = match uint::parse_bytes(def_part, 10u) { Some(dn) => dn as int, - None => fail2!("internal error: parse_def_id: id expected, but found {:?}", + None => fail!("internal error: parse_def_id: id expected, but found {:?}", def_part) }; ast::DefId { crate: crate_num, node: def_num } @@ -598,7 +598,7 @@ fn parse_bounds(st: &mut PState, conv: conv_did) -> ty::ParamBounds { return param_bounds; } _ => { - fail2!("parse_bounds: bad bounds") + fail!("parse_bounds: bad bounds") } } } diff --git a/src/librustc/metadata/tyencode.rs b/src/librustc/metadata/tyencode.rs index 146e3cd92009..33be1be89555 100644 --- a/src/librustc/metadata/tyencode.rs +++ b/src/librustc/metadata/tyencode.rs @@ -335,18 +335,18 @@ fn enc_sty(w: @io::Writer, cx: @ctxt, st: &ty::sty) { } ty::ty_opaque_box => w.write_char('B'), ty::ty_struct(def, ref substs) => { - debug2!("~~~~ {}", "a["); + debug!("~~~~ {}", "a["); w.write_str(&"a["); let s = (cx.ds)(def); - debug2!("~~~~ {}", s); + debug!("~~~~ {}", s); w.write_str(s); - debug2!("~~~~ {}", "|"); + debug!("~~~~ {}", "|"); w.write_char('|'); enc_substs(w, cx, substs); - debug2!("~~~~ {}", "]"); + debug!("~~~~ {}", "]"); w.write_char(']'); } - ty::ty_err => fail2!("Shouldn't encode error type") + ty::ty_err => fail!("Shouldn't encode error type") } } diff --git a/src/librustc/middle/astencode.rs b/src/librustc/middle/astencode.rs index b6a782c09b79..294bbcb46f7b 100644 --- a/src/librustc/middle/astencode.rs +++ b/src/librustc/middle/astencode.rs @@ -84,7 +84,7 @@ pub fn encode_inlined_item(ecx: &e::EncodeContext, path: &[ast_map::path_elt], ii: ast::inlined_item, maps: Maps) { - debug2!("> Encoding inlined item: {}::{} ({})", + debug!("> Encoding inlined item: {}::{} ({})", ast_map::path_to_str(path, token::get_ident_interner()), ecx.tcx.sess.str_of(ii.ident()), ebml_w.writer.tell()); @@ -97,7 +97,7 @@ pub fn encode_inlined_item(ecx: &e::EncodeContext, encode_side_tables_for_ii(ecx, maps, ebml_w, &ii); ebml_w.end_tag(); - debug2!("< Encoded inlined fn: {}::{} ({})", + debug!("< Encoded inlined fn: {}::{} ({})", ast_map::path_to_str(path, token::get_ident_interner()), ecx.tcx.sess.str_of(ii.ident()), ebml_w.writer.tell()); @@ -117,7 +117,7 @@ pub fn decode_inlined_item(cdata: @cstore::crate_metadata, match par_doc.opt_child(c::tag_ast) { None => None, Some(ast_doc) => { - debug2!("> Decoding inlined fn: {}::?", + debug!("> Decoding inlined fn: {}::?", ast_map::path_to_str(path, token::get_ident_interner())); let mut ast_dsr = reader::Decoder(ast_doc); let from_id_range = Decodable::decode(&mut ast_dsr); @@ -129,8 +129,8 @@ pub fn decode_inlined_item(cdata: @cstore::crate_metadata, }; let raw_ii = decode_ast(ast_doc); let ii = renumber_ast(xcx, raw_ii); - debug2!("Fn named: {}", tcx.sess.str_of(ii.ident())); - debug2!("< Decoded inlined fn: {}::{}", + debug!("Fn named: {}", tcx.sess.str_of(ii.ident())); + debug!("< Decoded inlined fn: {}::{}", ast_map::path_to_str(path, token::get_ident_interner()), tcx.sess.str_of(ii.ident())); ast_map::map_decoded_item(tcx.sess.diagnostic(), @@ -140,7 +140,7 @@ pub fn decode_inlined_item(cdata: @cstore::crate_metadata, decode_side_tables(xcx, ast_doc); match ii { ast::ii_item(i) => { - debug2!(">>> DECODED ITEM >>>\n{}\n<<< DECODED ITEM <<<", + debug!(">>> DECODED ITEM >>>\n{}\n<<< DECODED ITEM <<<", syntax::print::pprust::item_to_str(i, tcx.sess.intr())); } _ => { } @@ -305,7 +305,7 @@ impl fold::ast_fold for NestedItemsDropper { node: ast::DeclItem(_), span: _ }, _) => None, - ast::StmtMac(*) => fail2!("unexpanded macro in astencode") + ast::StmtMac(*) => fail!("unexpanded macro in astencode") } }.collect(); let blk_sans_items = ast::Block { @@ -741,7 +741,7 @@ impl vtable_decoder_helpers for reader::Decoder { ) } // hard to avoid - user input - _ => fail2!("bad enum variant") + _ => fail!("bad enum variant") } } } @@ -896,7 +896,7 @@ fn encode_side_tables_for_id(ecx: &e::EncodeContext, id: ast::NodeId) { let tcx = ecx.tcx; - debug2!("Encoding side tables for id {}", id); + debug!("Encoding side tables for id {}", id); { let r = tcx.def_map.find(&id); @@ -1091,7 +1091,7 @@ impl ebml_decoder_decoder_helpers for reader::Decoder { xcx.dcx.tcx, |s, a| this.convert_def_id(xcx, s, a)); - debug2!("read_ty({}) = {}", + debug!("read_ty({}) = {}", type_string(doc), ty_to_str(xcx.dcx.tcx, ty)); @@ -1176,7 +1176,7 @@ impl ebml_decoder_decoder_helpers for reader::Decoder { NominalType | TypeWithId => xcx.tr_def_id(did), TypeParameter => xcx.tr_intern_def_id(did) }; - debug2!("convert_def_id(source={:?}, did={:?})={:?}", source, did, r); + debug!("convert_def_id(source={:?}, did={:?})={:?}", source, did, r); return r; } } @@ -1189,7 +1189,7 @@ fn decode_side_tables(xcx: @ExtendedDecodeContext, let id0 = entry_doc.get(c::tag_table_id as uint).as_int(); let id = xcx.tr_id(id0); - debug2!(">> Side table document with tag 0x{:x} \ + debug!(">> Side table document with tag 0x{:x} \ found for id {} (orig {})", tag, id, id0); @@ -1210,7 +1210,7 @@ fn decode_side_tables(xcx: @ExtendedDecodeContext, } c::tag_table_node_type => { let ty = val_dsr.read_ty(xcx); - debug2!("inserting ty for node {:?}: {}", + debug!("inserting ty for node {:?}: {}", id, ty_to_str(dcx.tcx, ty)); dcx.tcx.node_types.insert(id as uint, ty); } @@ -1263,7 +1263,7 @@ fn decode_side_tables(xcx: @ExtendedDecodeContext, } } - debug2!(">< Side table doc loaded"); + debug!(">< Side table doc loaded"); true }; } @@ -1381,6 +1381,6 @@ fn test_simplification() { == pprust::item_to_str(item_exp, token::get_ident_interner())); } - _ => fail2!() + _ => fail!() } } diff --git a/src/librustc/middle/borrowck/check_loans.rs b/src/librustc/middle/borrowck/check_loans.rs index 47c294368569..b05bdaa20322 100644 --- a/src/librustc/middle/borrowck/check_loans.rs +++ b/src/librustc/middle/borrowck/check_loans.rs @@ -65,7 +65,7 @@ pub fn check_loans(bccx: &BorrowckCtxt, move_data: move_data::FlowedMoveData, all_loans: &[Loan], body: &ast::Block) { - debug2!("check_loans(body id={:?})", body.id); + debug!("check_loans(body id={:?})", body.id); let mut clcx = CheckLoanCtxt { bccx: bccx, @@ -197,10 +197,10 @@ impl<'self> CheckLoanCtxt<'self> { //! issued when we enter `scope_id` (for example, we do not //! permit two `&mut` borrows of the same variable). - debug2!("check_for_conflicting_loans(scope_id={:?})", scope_id); + debug!("check_for_conflicting_loans(scope_id={:?})", scope_id); let new_loan_indices = self.loans_generated_by(scope_id); - debug2!("new_loan_indices = {:?}", new_loan_indices); + debug!("new_loan_indices = {:?}", new_loan_indices); do self.each_issued_loan(scope_id) |issued_loan| { for &new_loan_index in new_loan_indices.iter() { @@ -225,7 +225,7 @@ impl<'self> CheckLoanCtxt<'self> { //! Checks whether `old_loan` and `new_loan` can safely be issued //! simultaneously. - debug2!("report_error_if_loans_conflict(old_loan={}, new_loan={})", + debug!("report_error_if_loans_conflict(old_loan={}, new_loan={})", old_loan.repr(self.tcx()), new_loan.repr(self.tcx())); @@ -249,7 +249,7 @@ impl<'self> CheckLoanCtxt<'self> { //! Checks whether the restrictions introduced by `loan1` would //! prohibit `loan2`. Returns false if an error is reported. - debug2!("report_error_if_loan_conflicts_with_restriction(\ + debug!("report_error_if_loan_conflicts_with_restriction(\ loan1={}, loan2={})", loan1.repr(self.tcx()), loan2.repr(self.tcx())); @@ -260,7 +260,7 @@ impl<'self> CheckLoanCtxt<'self> { ImmutableMutability => RESTR_ALIAS | RESTR_FREEZE, ConstMutability => RESTR_ALIAS, }; - debug2!("illegal_if={:?}", illegal_if); + debug!("illegal_if={:?}", illegal_if); for restr in loan1.restrictions.iter() { if !restr.set.intersects(illegal_if) { continue; } @@ -317,7 +317,7 @@ impl<'self> CheckLoanCtxt<'self> { * is using a moved/uninitialized value */ - debug2!("check_if_path_is_moved(id={:?}, use_kind={:?}, lp={})", + debug!("check_if_path_is_moved(id={:?}, use_kind={:?}, lp={})", id, use_kind, lp.repr(self.bccx.tcx)); do self.move_data.each_move_of(id, lp) |move, moved_lp| { self.bccx.report_use_of_moved_value( @@ -338,7 +338,7 @@ impl<'self> CheckLoanCtxt<'self> { Some(&adj) => self.bccx.cat_expr_autoderefd(expr, adj) }; - debug2!("check_assignment(cmt={})", cmt.repr(self.tcx())); + debug!("check_assignment(cmt={})", cmt.repr(self.tcx())); // Mutable values can be assigned, as long as they obey loans // and aliasing restrictions: @@ -387,7 +387,7 @@ impl<'self> CheckLoanCtxt<'self> { let mut cmt = cmt; loop { - debug2!("mark_writes_through_upvars_as_used_mut(cmt={})", + debug!("mark_writes_through_upvars_as_used_mut(cmt={})", cmt.repr(this.tcx())); match cmt.cat { mc::cat_local(id) | @@ -435,7 +435,7 @@ impl<'self> CheckLoanCtxt<'self> { //! Safety checks related to writes to aliasable, mutable locations let guarantor = cmt.guarantor(); - debug2!("check_for_aliasable_mutable_writes(cmt={}, guarantor={})", + debug!("check_for_aliasable_mutable_writes(cmt={}, guarantor={})", cmt.repr(this.tcx()), guarantor.repr(this.tcx())); match guarantor.cat { mc::cat_deref(b, _, mc::region_ptr(MutMutable, _)) => { @@ -451,7 +451,7 @@ impl<'self> CheckLoanCtxt<'self> { id: guarantor.id, derefs: deref_count }; - debug2!("Inserting write guard at {:?}", key); + debug!("Inserting write guard at {:?}", key); this.bccx.write_guard_map.insert(key); } @@ -690,7 +690,7 @@ impl<'self> CheckLoanCtxt<'self> { pub fn analyze_move_out_from(&self, expr_id: ast::NodeId, move_path: @LoanPath) -> MoveError { - debug2!("analyze_move_out_from(expr_id={:?}, move_path={})", + debug!("analyze_move_out_from(expr_id={:?}, move_path={})", expr_id, move_path.repr(self.tcx())); // FIXME(#4384) inadequare if/when we permit `move a.b` @@ -794,7 +794,7 @@ fn check_loans_in_expr<'a>(this: &mut CheckLoanCtxt<'a>, expr: @ast::Expr) { visit::walk_expr(this, expr, ()); - debug2!("check_loans_in_expr(expr={})", + debug!("check_loans_in_expr(expr={})", expr.repr(this.tcx())); this.check_for_conflicting_loans(expr.id); @@ -805,7 +805,7 @@ fn check_loans_in_expr<'a>(this: &mut CheckLoanCtxt<'a>, ast::ExprPath(*) => { if !this.move_data.is_assignee(expr.id) { let cmt = this.bccx.cat_expr_unadjusted(expr); - debug2!("path cmt={}", cmt.repr(this.tcx())); + debug!("path cmt={}", cmt.repr(this.tcx())); let r = opt_loan_path(cmt); for &lp in r.iter() { this.check_if_path_is_moved(expr.id, expr.span, MovedInUse, lp); diff --git a/src/librustc/middle/borrowck/gather_loans/lifetime.rs b/src/librustc/middle/borrowck/gather_loans/lifetime.rs index 485004a642cf..a0c6fdc32255 100644 --- a/src/librustc/middle/borrowck/gather_loans/lifetime.rs +++ b/src/librustc/middle/borrowck/gather_loans/lifetime.rs @@ -27,7 +27,7 @@ pub fn guarantee_lifetime(bccx: &BorrowckCtxt, cmt: mc::cmt, loan_region: ty::Region, loan_mutbl: LoanMutability) { - debug2!("guarantee_lifetime(cmt={}, loan_region={})", + debug!("guarantee_lifetime(cmt={}, loan_region={})", cmt.repr(bccx.tcx), loan_region.repr(bccx.tcx)); let ctxt = GuaranteeLifetimeContext {bccx: bccx, item_scope_id: item_scope_id, @@ -101,7 +101,7 @@ impl<'self> GuaranteeLifetimeContext<'self> { // L-Deref-Managed-Mut-Compiler-Root self.check_root(cmt, base, derefs, ptr_mutbl, discr_scope); } else { - debug2!("omitting root, base={}, base_scope={:?}", + debug!("omitting root, base={}, base_scope={:?}", base.repr(self.tcx()), base_scope); } } @@ -189,7 +189,7 @@ impl<'self> GuaranteeLifetimeContext<'self> { derefs: uint, ptr_mutbl: ast::Mutability, discr_scope: Option) { - debug2!("check_root(cmt_deref={}, cmt_base={}, derefs={:?}, ptr_mutbl={:?}, \ + debug!("check_root(cmt_deref={}, cmt_base={}, derefs={:?}, ptr_mutbl={:?}, \ discr_scope={:?})", cmt_deref.repr(self.tcx()), cmt_base.repr(self.tcx()), @@ -247,7 +247,7 @@ impl<'self> GuaranteeLifetimeContext<'self> { // FIXME(#3511) grow to the nearest cleanup scope---this can // cause observable errors if freezing! if !self.bccx.tcx.region_maps.is_cleanup_scope(root_scope) { - debug2!("{:?} is not a cleanup scope, adjusting", root_scope); + debug!("{:?} is not a cleanup scope, adjusting", root_scope); let cleanup_scope = self.bccx.tcx.region_maps.cleanup_scope(root_scope); @@ -277,7 +277,7 @@ impl<'self> GuaranteeLifetimeContext<'self> { let root_info = RootInfo {scope: root_scope, freeze: opt_dyna}; self.bccx.root_map.insert(rm_key, root_info); - debug2!("root_key: {:?} root_info: {:?}", rm_key, root_info); + debug!("root_key: {:?} root_info: {:?}", rm_key, root_info); } fn check_scope(&self, max_scope: ty::Region) { diff --git a/src/librustc/middle/borrowck/gather_loans/mod.rs b/src/librustc/middle/borrowck/gather_loans/mod.rs index 224c8bf6a6b5..6c927794dc81 100644 --- a/src/librustc/middle/borrowck/gather_loans/mod.rs +++ b/src/librustc/middle/borrowck/gather_loans/mod.rs @@ -136,7 +136,7 @@ fn gather_loans_in_fn(this: &mut GatherLoanCtxt, id: ast::NodeId) { match fk { &visit::fk_item_fn(*) | &visit::fk_method(*) => { - fail2!("cannot occur, due to visit_item override"); + fail!("cannot occur, due to visit_item override"); } // Visit closures as part of the containing item. @@ -196,7 +196,7 @@ fn gather_loans_in_expr(this: &mut GatherLoanCtxt, let bccx = this.bccx; let tcx = bccx.tcx; - debug2!("gather_loans_in_expr(expr={:?}/{})", + debug!("gather_loans_in_expr(expr={:?}/{})", ex.id, pprust::expr_to_str(ex, tcx.sess.intr())); this.id_range.add(ex.id); @@ -347,20 +347,20 @@ impl<'self> GatherLoanCtxt<'self> { pub fn guarantee_adjustments(&mut self, expr: @ast::Expr, adjustment: &ty::AutoAdjustment) { - debug2!("guarantee_adjustments(expr={}, adjustment={:?})", + debug!("guarantee_adjustments(expr={}, adjustment={:?})", expr.repr(self.tcx()), adjustment); let _i = indenter(); match *adjustment { ty::AutoAddEnv(*) => { - debug2!("autoaddenv -- no autoref"); + debug!("autoaddenv -- no autoref"); return; } ty::AutoDerefRef( ty::AutoDerefRef { autoref: None, _ }) => { - debug2!("no autoref"); + debug!("no autoref"); return; } @@ -372,7 +372,7 @@ impl<'self> GatherLoanCtxt<'self> { tcx: self.tcx(), method_map: self.bccx.method_map}; let cmt = mcx.cat_expr_autoderefd(expr, autoderefs); - debug2!("after autoderef, cmt={}", cmt.repr(self.tcx())); + debug!("after autoderef, cmt={}", cmt.repr(self.tcx())); match *autoref { ty::AutoPtr(r, m) => { @@ -429,7 +429,7 @@ impl<'self> GatherLoanCtxt<'self> { cmt: mc::cmt, req_mutbl: LoanMutability, loan_region: ty::Region) { - debug2!("guarantee_valid(borrow_id={:?}, cmt={}, \ + debug!("guarantee_valid(borrow_id={:?}, cmt={}, \ req_mutbl={:?}, loan_region={:?})", borrow_id, cmt.repr(self.tcx()), @@ -490,13 +490,13 @@ impl<'self> GatherLoanCtxt<'self> { format!("Invalid borrow lifetime: {:?}", loan_region)); } }; - debug2!("loan_scope = {:?}", loan_scope); + debug!("loan_scope = {:?}", loan_scope); let gen_scope = self.compute_gen_scope(borrow_id, loan_scope); - debug2!("gen_scope = {:?}", gen_scope); + debug!("gen_scope = {:?}", gen_scope); let kill_scope = self.compute_kill_scope(loan_scope, loan_path); - debug2!("kill_scope = {:?}", kill_scope); + debug!("kill_scope = {:?}", kill_scope); if req_mutbl == MutableMutability { self.mark_loan_path_as_mutated(loan_path); @@ -516,7 +516,7 @@ impl<'self> GatherLoanCtxt<'self> { } }; - debug2!("guarantee_valid(borrow_id={:?}), loan={}", + debug!("guarantee_valid(borrow_id={:?}), loan={}", borrow_id, loan.repr(self.tcx())); // let loan_path = loan.loan_path; diff --git a/src/librustc/middle/borrowck/mod.rs b/src/librustc/middle/borrowck/mod.rs index 8464c19cb015..2722fff12a82 100644 --- a/src/librustc/middle/borrowck/mod.rs +++ b/src/librustc/middle/borrowck/mod.rs @@ -135,7 +135,7 @@ fn borrowck_fn(this: &mut BorrowckCtxt, &visit::fk_item_fn(*) | &visit::fk_method(*) => { - debug2!("borrowck_fn(id={:?})", id); + debug!("borrowck_fn(id={:?})", id); // Check the body of fn items. let (id_range, all_loans, move_data) = diff --git a/src/librustc/middle/borrowck/move_data.rs b/src/librustc/middle/borrowck/move_data.rs index 239254e82dd5..e03142099678 100644 --- a/src/librustc/middle/borrowck/move_data.rs +++ b/src/librustc/middle/borrowck/move_data.rs @@ -244,7 +244,7 @@ impl MoveData { } }; - debug2!("move_path(lp={}, index={:?})", + debug!("move_path(lp={}, index={:?})", lp.repr(tcx), index); @@ -304,7 +304,7 @@ impl MoveData { * location `id` with kind `kind`. */ - debug2!("add_move(lp={}, id={:?}, kind={:?})", + debug!("add_move(lp={}, id={:?}, kind={:?})", lp.repr(tcx), id, kind); @@ -334,7 +334,7 @@ impl MoveData { * location `id` with the given `span`. */ - debug2!("add_assignment(lp={}, assign_id={:?}, assignee_id={:?}", + debug!("add_assignment(lp={}, assign_id={:?}, assignee_id={:?}", lp.repr(tcx), assign_id, assignee_id); let path_index = self.move_path(tcx, lp); @@ -348,12 +348,12 @@ impl MoveData { }; if self.is_var_path(path_index) { - debug2!("add_assignment[var](lp={}, assignment={}, path_index={:?})", + debug!("add_assignment[var](lp={}, assignment={}, path_index={:?})", lp.repr(tcx), self.var_assignments.len(), path_index); self.var_assignments.push(assignment); } else { - debug2!("add_assignment[path](lp={}, path_index={:?})", + debug!("add_assignment[path](lp={}, path_index={:?})", lp.repr(tcx), path_index); self.path_assignments.push(assignment); diff --git a/src/librustc/middle/cfg/construct.rs b/src/librustc/middle/cfg/construct.rs index 9e92bd3829c5..27fbecb59790 100644 --- a/src/librustc/middle/cfg/construct.rs +++ b/src/librustc/middle/cfg/construct.rs @@ -239,7 +239,7 @@ impl CFGBuilder { expr_exit } - ast::ExprForLoop(*) => fail2!("non-desugared expr_for_loop"), + ast::ExprForLoop(*) => fail!("non-desugared expr_for_loop"), ast::ExprLoop(ref body, _) => { // diff --git a/src/librustc/middle/check_const.rs b/src/librustc/middle/check_const.rs index dd624a882839..d12808c3a4da 100644 --- a/src/librustc/middle/check_const.rs +++ b/src/librustc/middle/check_const.rs @@ -153,7 +153,7 @@ pub fn check_expr(v: &mut CheckCrateVisitor, Some(&DefStruct(_)) => { } Some(&def) => { - debug2!("(checking const) found bad def: {:?}", def); + debug!("(checking const) found bad def: {:?}", def); sess.span_err( e.span, "paths in constants may only refer to \ @@ -266,7 +266,7 @@ impl Visitor<()> for CheckItemRecursionVisitor { ast_map::node_item(it, _) => { self.visit_item(it, ()); } - _ => fail2!("const not bound to an item") + _ => fail!("const not bound to an item") }, _ => () }, diff --git a/src/librustc/middle/check_match.rs b/src/librustc/middle/check_match.rs index 2d03b0c778d6..de5e00d241eb 100644 --- a/src/librustc/middle/check_match.rs +++ b/src/librustc/middle/check_match.rs @@ -181,14 +181,14 @@ fn check_exhaustive(cx: &MatchCheckCtxt, sp: Span, pats: ~[@Pat]) { ty::ty_enum(id, _) => { let vid = match *ctor { variant(id) => id, - _ => fail2!("check_exhaustive: non-variant ctor"), + _ => fail!("check_exhaustive: non-variant ctor"), }; let variants = ty::enum_variants(cx.tcx, id); match variants.iter().find(|v| v.id == vid) { Some(v) => Some(cx.tcx.sess.str_of(v.name)), None => { - fail2!("check_exhaustive: bad variant in ctor") + fail!("check_exhaustive: bad variant in ctor") } } } @@ -409,7 +409,7 @@ fn missing_ctor(cx: &MatchCheckCtxt, return Some(variant(v.id)); } } - fail2!(); + fail!(); } else { None } } ty::ty_nil => None, @@ -421,7 +421,7 @@ fn missing_ctor(cx: &MatchCheckCtxt, None => (), Some(val(const_bool(true))) => true_found = true, Some(val(const_bool(false))) => false_found = true, - _ => fail2!("impossible case") + _ => fail!("impossible case") } } if true_found && false_found { None } @@ -511,10 +511,10 @@ fn ctor_arity(cx: &MatchCheckCtxt, ctor: &ctor, ty: ty::t) -> uint { ty::ty_box(_) | ty::ty_uniq(_) | ty::ty_rptr(*) => 1u, ty::ty_enum(eid, _) => { let id = match *ctor { variant(id) => id, - _ => fail2!("impossible case") }; + _ => fail!("impossible case") }; match ty::enum_variants(cx.tcx, eid).iter().find(|v| v.id == id ) { Some(v) => v.args.len(), - None => fail2!("impossible case") + None => fail!("impossible case") } } ty::ty_struct(cid, _) => ty::lookup_struct_fields(cx.tcx, cid).len(), @@ -585,7 +585,7 @@ fn specialize(cx: &MatchCheckCtxt, } } single => true, - _ => fail2!("type error") + _ => fail!("type error") }; if match_ { Some(r.tail().to_owned()) @@ -632,7 +632,7 @@ fn specialize(cx: &MatchCheckCtxt, } } single => true, - _ => fail2!("type error") + _ => fail!("type error") }; if match_ { Some(r.tail().to_owned()) @@ -739,7 +739,7 @@ fn specialize(cx: &MatchCheckCtxt, } } single => true, - _ => fail2!("type error") + _ => fail!("type error") }; if match_ { Some(r.tail().to_owned()) } else { None } } @@ -748,7 +748,7 @@ fn specialize(cx: &MatchCheckCtxt, val(ref v) => (*v, *v), range(ref lo, ref hi) => (*lo, *hi), single => return Some(r.tail().to_owned()), - _ => fail2!("type error") + _ => fail!("type error") }; let v_lo = eval_const_expr(cx.tcx, lo); let v_hi = eval_const_expr(cx.tcx, hi); diff --git a/src/librustc/middle/dataflow.rs b/src/librustc/middle/dataflow.rs index b9355d326637..22fd1d393e97 100644 --- a/src/librustc/middle/dataflow.rs +++ b/src/librustc/middle/dataflow.rs @@ -131,7 +131,7 @@ impl DataFlowContext { bits_per_id: uint) -> DataFlowContext { let words_per_id = (bits_per_id + uint::bits - 1) / uint::bits; - debug2!("DataFlowContext::new(id_range={:?}, bits_per_id={:?}, words_per_id={:?})", + debug!("DataFlowContext::new(id_range={:?}, bits_per_id={:?}, words_per_id={:?})", id_range, bits_per_id, words_per_id); let gens = ~[]; @@ -154,7 +154,7 @@ impl DataFlowContext { pub fn add_gen(&mut self, id: ast::NodeId, bit: uint) { //! Indicates that `id` generates `bit` - debug2!("add_gen(id={:?}, bit={:?})", id, bit); + debug!("add_gen(id={:?}, bit={:?})", id, bit); let (start, end) = self.compute_id_range(id); { let gens = self.gens.mut_slice(start, end); @@ -165,7 +165,7 @@ impl DataFlowContext { pub fn add_kill(&mut self, id: ast::NodeId, bit: uint) { //! Indicates that `id` kills `bit` - debug2!("add_kill(id={:?}, bit={:?})", id, bit); + debug!("add_kill(id={:?}, bit={:?})", id, bit); let (start, end) = self.compute_id_range(id); { let kills = self.kills.mut_slice(start, end); @@ -176,7 +176,7 @@ impl DataFlowContext { fn apply_gen_kill(&mut self, id: ast::NodeId, bits: &mut [uint]) { //! Applies the gen and kill sets for `id` to `bits` - debug2!("apply_gen_kill(id={:?}, bits={}) [before]", + debug!("apply_gen_kill(id={:?}, bits={}) [before]", id, mut_bits_to_str(bits)); let (start, end) = self.compute_id_range(id); let gens = self.gens.slice(start, end); @@ -184,17 +184,17 @@ impl DataFlowContext { let kills = self.kills.slice(start, end); bitwise(bits, kills, |a, b| a & !b); - debug2!("apply_gen_kill(id={:?}, bits={}) [after]", + debug!("apply_gen_kill(id={:?}, bits={}) [after]", id, mut_bits_to_str(bits)); } fn apply_kill(&mut self, id: ast::NodeId, bits: &mut [uint]) { - debug2!("apply_kill(id={:?}, bits={}) [before]", + debug!("apply_kill(id={:?}, bits={}) [before]", id, mut_bits_to_str(bits)); let (start, end) = self.compute_id_range(id); let kills = self.kills.slice(start, end); bitwise(bits, kills, |a, b| a & !b); - debug2!("apply_kill(id={:?}, bits={}) [after]", + debug!("apply_kill(id={:?}, bits={}) [after]", id, mut_bits_to_str(bits)); } @@ -242,7 +242,7 @@ impl DataFlowContext { } let (start, end) = self.compute_id_range_frozen(id); let on_entry = self.on_entry.slice(start, end); - debug2!("each_bit_on_entry_frozen(id={:?}, on_entry={})", + debug!("each_bit_on_entry_frozen(id={:?}, on_entry={})", id, bits_to_str(on_entry)); self.each_bit(on_entry, f) } @@ -255,7 +255,7 @@ impl DataFlowContext { let (start, end) = self.compute_id_range(id); let on_entry = self.on_entry.slice(start, end); - debug2!("each_bit_on_entry(id={:?}, on_entry={})", + debug!("each_bit_on_entry(id={:?}, on_entry={})", id, bits_to_str(on_entry)); self.each_bit(on_entry, f) } @@ -267,7 +267,7 @@ impl DataFlowContext { let (start, end) = self.compute_id_range(id); let gens = self.gens.slice(start, end); - debug2!("each_gen_bit(id={:?}, gens={})", + debug!("each_gen_bit(id={:?}, gens={})", id, bits_to_str(gens)); self.each_bit(gens, f) } @@ -281,7 +281,7 @@ impl DataFlowContext { } let (start, end) = self.compute_id_range_frozen(id); let gens = self.gens.slice(start, end); - debug2!("each_gen_bit(id={:?}, gens={})", + debug!("each_gen_bit(id={:?}, gens={})", id, bits_to_str(gens)); self.each_bit(gens, f) } @@ -346,8 +346,8 @@ impl DataFlowContext { } } - debug2!("Dataflow result:"); - debug2!("{}", { + debug!("Dataflow result:"); + debug!("{}", { let this = @(*self).clone(); this.pretty_print_to(io::stderr(), blk); "" @@ -374,7 +374,7 @@ impl<'self, O:DataFlowOperator> PropagationContext<'self, O> { blk: &ast::Block, in_out: &mut [uint], loop_scopes: &mut ~[LoopScope]) { - debug2!("DataFlowContext::walk_block(blk.id={:?}, in_out={})", + debug!("DataFlowContext::walk_block(blk.id={:?}, in_out={})", blk.id, bits_to_str(reslice(in_out))); self.merge_with_entry_set(blk.id, in_out); @@ -425,7 +425,7 @@ impl<'self, O:DataFlowOperator> PropagationContext<'self, O> { expr: &ast::Expr, in_out: &mut [uint], loop_scopes: &mut ~[LoopScope]) { - debug2!("DataFlowContext::walk_expr(expr={}, in_out={})", + debug!("DataFlowContext::walk_expr(expr={}, in_out={})", expr.repr(self.dfcx.tcx), bits_to_str(reslice(in_out))); self.merge_with_entry_set(expr.id, in_out); @@ -569,7 +569,7 @@ impl<'self, O:DataFlowOperator> PropagationContext<'self, O> { copy_bits(new_loop_scope.break_bits, in_out); } - ast::ExprForLoop(*) => fail2!("non-desugared expr_for_loop"), + ast::ExprForLoop(*) => fail!("non-desugared expr_for_loop"), ast::ExprLoop(ref blk, _) => { // @@ -756,7 +756,7 @@ impl<'self, O:DataFlowOperator> PropagationContext<'self, O> { let tcx = self.tcx(); let region_maps = tcx.region_maps; - debug2!("pop_scopes(from_expr={}, to_scope={:?}, in_out={})", + debug!("pop_scopes(from_expr={}, to_scope={:?}, in_out={})", from_expr.repr(tcx), to_scope.loop_id, bits_to_str(reslice(in_out))); @@ -784,7 +784,7 @@ impl<'self, O:DataFlowOperator> PropagationContext<'self, O> { self.pop_scopes(from_expr, to_scope, in_out); self.dfcx.apply_kill(from_expr.id, in_out); join_bits(&self.dfcx.oper, reslice(in_out), to_scope.break_bits); - debug2!("break_from_to(from_expr={}, to_scope={:?}) final break_bits={}", + debug!("break_from_to(from_expr={}, to_scope={:?}) final break_bits={}", from_expr.repr(self.tcx()), to_scope.loop_id, bits_to_str(reslice(in_out))); @@ -833,11 +833,11 @@ impl<'self, O:DataFlowOperator> PropagationContext<'self, O> { pat: @ast::Pat, in_out: &mut [uint], _loop_scopes: &mut ~[LoopScope]) { - debug2!("DataFlowContext::walk_pat(pat={}, in_out={})", + debug!("DataFlowContext::walk_pat(pat={}, in_out={})", pat.repr(self.dfcx.tcx), bits_to_str(reslice(in_out))); do ast_util::walk_pat(pat) |p| { - debug2!(" p.id={:?} in_out={}", p.id, bits_to_str(reslice(in_out))); + debug!(" p.id={:?} in_out={}", p.id, bits_to_str(reslice(in_out))); self.merge_with_entry_set(p.id, in_out); self.dfcx.apply_gen_kill(p.id, in_out); true @@ -909,7 +909,7 @@ impl<'self, O:DataFlowOperator> PropagationContext<'self, O> { } fn add_to_entry_set(&mut self, id: ast::NodeId, pred_bits: &[uint]) { - debug2!("add_to_entry_set(id={:?}, pred_bits={})", + debug!("add_to_entry_set(id={:?}, pred_bits={})", id, bits_to_str(pred_bits)); let (start, end) = self.dfcx.compute_id_range(id); let changed = { // FIXME(#5074) awkward construction @@ -917,7 +917,7 @@ impl<'self, O:DataFlowOperator> PropagationContext<'self, O> { join_bits(&self.dfcx.oper, pred_bits, on_entry) }; if changed { - debug2!("changed entry set for {:?} to {}", + debug!("changed entry set for {:?} to {}", id, bits_to_str(self.dfcx.on_entry.slice(start, end))); self.changed = true; } @@ -926,7 +926,7 @@ impl<'self, O:DataFlowOperator> PropagationContext<'self, O> { fn merge_with_entry_set(&mut self, id: ast::NodeId, pred_bits: &mut [uint]) { - debug2!("merge_with_entry_set(id={:?}, pred_bits={})", + debug!("merge_with_entry_set(id={:?}, pred_bits={})", id, mut_bits_to_str(pred_bits)); let (start, end) = self.dfcx.compute_id_range(id); let changed = { // FIXME(#5074) awkward construction @@ -936,7 +936,7 @@ impl<'self, O:DataFlowOperator> PropagationContext<'self, O> { changed }; if changed { - debug2!("changed entry set for {:?} to {}", + debug!("changed entry set for {:?} to {}", id, bits_to_str(self.dfcx.on_entry.slice(start, end))); self.changed = true; } @@ -992,12 +992,12 @@ fn bitwise(out_vec: &mut [uint], } fn set_bit(words: &mut [uint], bit: uint) -> bool { - debug2!("set_bit: words={} bit={}", + debug!("set_bit: words={} bit={}", mut_bits_to_str(words), bit_str(bit)); let word = bit / uint::bits; let bit_in_word = bit % uint::bits; let bit_mask = 1 << bit_in_word; - debug2!("word={} bit_in_word={} bit_mask={}", word, bit_in_word, word); + debug!("word={} bit_in_word={} bit_mask={}", word, bit_in_word, word); let oldv = words[word]; let newv = oldv | bit_mask; words[word] = newv; diff --git a/src/librustc/middle/effect.rs b/src/librustc/middle/effect.rs index 8cc4c23bd1c7..c0ac48bfee8c 100644 --- a/src/librustc/middle/effect.rs +++ b/src/librustc/middle/effect.rs @@ -55,7 +55,7 @@ impl EffectCheckVisitor { } UnsafeBlock(block_id) => { // OK, but record this. - debug2!("effect: recording unsafe block as used: {:?}", block_id); + debug!("effect: recording unsafe block as used: {:?}", block_id); let _ = self.tcx.used_unsafe.insert(block_id); } UnsafeFn => {} @@ -67,7 +67,7 @@ impl EffectCheckVisitor { ast::ExprIndex(_, base, _) => ty::node_id_to_type(self.tcx, base.id), _ => return }; - debug2!("effect: checking index with base type {}", + debug!("effect: checking index with base type {}", ppaux::ty_to_str(self.tcx, base_type)); match ty::get(base_type).sty { ty::ty_estr(*) => { @@ -121,7 +121,7 @@ impl Visitor<()> for EffectCheckVisitor { match expr.node { ast::ExprMethodCall(callee_id, _, _, _, _, _) => { let base_type = ty::node_id_to_type(self.tcx, callee_id); - debug2!("effect: method call case, base type is {}", + debug!("effect: method call case, base type is {}", ppaux::ty_to_str(self.tcx, base_type)); if type_is_unsafe_function(base_type) { self.require_unsafe(expr.span, @@ -130,7 +130,7 @@ impl Visitor<()> for EffectCheckVisitor { } ast::ExprCall(base, _, _) => { let base_type = ty::node_id_to_type(self.tcx, base.id); - debug2!("effect: call case, base type is {}", + debug!("effect: call case, base type is {}", ppaux::ty_to_str(self.tcx, base_type)); if type_is_unsafe_function(base_type) { self.require_unsafe(expr.span, "call to unsafe function") @@ -138,7 +138,7 @@ impl Visitor<()> for EffectCheckVisitor { } ast::ExprUnary(_, ast::UnDeref, base) => { let base_type = ty::node_id_to_type(self.tcx, base.id); - debug2!("effect: unary case, base type is {}", + debug!("effect: unary case, base type is {}", ppaux::ty_to_str(self.tcx, base_type)); match ty::get(base_type).sty { ty::ty_ptr(_) => { diff --git a/src/librustc/middle/freevars.rs b/src/librustc/middle/freevars.rs index 383c37952d7a..9aaddab69a10 100644 --- a/src/librustc/middle/freevars.rs +++ b/src/librustc/middle/freevars.rs @@ -53,7 +53,7 @@ impl Visitor for CollectFreevarsVisitor { ast::ExprPath(*) | ast::ExprSelf => { let mut i = 0; match self.def_map.find(&expr.id) { - None => fail2!("path not found"), + None => fail!("path not found"), Some(&df) => { let mut def = df; while i < depth { @@ -137,7 +137,7 @@ pub fn annotate_freevars(def_map: resolve::DefMap, crate: &ast::Crate) -> pub fn get_freevars(tcx: ty::ctxt, fid: ast::NodeId) -> freevar_info { match tcx.freevars.find(&fid) { - None => fail2!("get_freevars: {} has no freevars", fid), + None => fail!("get_freevars: {} has no freevars", fid), Some(&d) => return d } } diff --git a/src/librustc/middle/graph.rs b/src/librustc/middle/graph.rs index 98912b57572a..87dce84d23dc 100644 --- a/src/librustc/middle/graph.rs +++ b/src/librustc/middle/graph.rs @@ -343,7 +343,7 @@ mod test { do graph.each_incoming_edge(start_index) |edge_index, edge| { assert_eq!(graph.edge_data(edge_index), &edge.data); assert!(counter < expected_incoming.len()); - debug2!("counter={:?} expected={:?} edge_index={:?} edge={:?}", + debug!("counter={:?} expected={:?} edge_index={:?} edge={:?}", counter, expected_incoming[counter], edge_index, edge); match expected_incoming[counter] { (ref e, ref n) => { @@ -361,7 +361,7 @@ mod test { do graph.each_outgoing_edge(start_index) |edge_index, edge| { assert_eq!(graph.edge_data(edge_index), &edge.data); assert!(counter < expected_outgoing.len()); - debug2!("counter={:?} expected={:?} edge_index={:?} edge={:?}", + debug!("counter={:?} expected={:?} edge_index={:?} edge={:?}", counter, expected_outgoing[counter], edge_index, edge); match expected_outgoing[counter] { (ref e, ref n) => { diff --git a/src/librustc/middle/kind.rs b/src/librustc/middle/kind.rs index b20cb8ed809b..5737039f83c3 100644 --- a/src/librustc/middle/kind.rs +++ b/src/librustc/middle/kind.rs @@ -124,7 +124,7 @@ fn check_impl_of_trait(cx: &mut Context, it: @item, trait_ref: &trait_ref, self_ // If this trait has builtin-kind supertraits, meet them. let self_ty: ty::t = ty::node_id_to_type(cx.tcx, it.id); - debug2!("checking impl with self type {:?}", ty::get(self_ty).sty); + debug!("checking impl with self type {:?}", ty::get(self_ty).sty); do check_builtin_bounds(cx, self_ty, trait_def.bounds) |missing| { cx.tcx.sess.span_err(self_type.span, format!("the type `{}', which does not fulfill `{}`, cannot implement this \ @@ -265,7 +265,7 @@ fn check_fn( } pub fn check_expr(cx: &mut Context, e: @Expr) { - debug2!("kind::check_expr({})", expr_to_str(e, cx.tcx.sess.intr())); + debug!("kind::check_expr({})", expr_to_str(e, cx.tcx.sess.intr())); // Handle any kind bounds on type parameters let type_parameter_id = match e.get_callee_id() { @@ -292,7 +292,7 @@ pub fn check_expr(cx: &mut Context, e: @Expr) { }; if ts.len() != type_param_defs.len() { // Fail earlier to make debugging easier - fail2!("internal error: in kind::check_expr, length \ + fail!("internal error: in kind::check_expr, length \ mismatch between actual and declared bounds: actual = \ {}, declared = {}", ts.repr(cx.tcx), @@ -451,7 +451,7 @@ fn check_imm_free_var(cx: &Context, def: Def, sp: Span) { } fn check_copy(cx: &Context, ty: ty::t, sp: Span, reason: &str) { - debug2!("type_contents({})={}", + debug!("type_contents({})={}", ty_to_str(cx.tcx, ty), ty::type_contents(cx.tcx, ty).to_str()); if ty::type_moves_by_default(cx.tcx, ty) { diff --git a/src/librustc/middle/lint.rs b/src/librustc/middle/lint.rs index 8b21ce320243..b0cdd53de922 100644 --- a/src/librustc/middle/lint.rs +++ b/src/librustc/middle/lint.rs @@ -359,7 +359,7 @@ impl Context { return *k; } } - fail2!("unregistered lint {:?}", lint); + fail!("unregistered lint {:?}", lint); } fn span_lint(&self, lint: lint, span: Span, msg: &str) { @@ -380,7 +380,7 @@ impl Context { format!("{} [-{} {}]", msg, match level { warn => 'W', deny => 'D', forbid => 'F', - allow => fail2!() + allow => fail!() }, self.lint_to_str(lint).replace("_", "-")) }, Node(src) => { @@ -391,7 +391,7 @@ impl Context { match level { warn => { self.tcx.sess.span_warn(span, msg); } deny | forbid => { self.tcx.sess.span_err(span, msg); } - allow => fail2!(), + allow => fail!(), } for &span in note.iter() { @@ -526,7 +526,7 @@ fn check_type_limits(cx: &Context, e: &ast::Expr) { ast::BiGt => v >= min, ast::BiGe => v > min, ast::BiEq | ast::BiNe => v >= min && v <= max, - _ => fail2!() + _ => fail!() } } @@ -582,7 +582,7 @@ fn check_type_limits(cx: &Context, e: &ast::Expr) { ast::lit_int_unsuffixed(v) => v, _ => return true }, - _ => fail2!() + _ => fail!() }; is_valid(norm_binop, lit_val, min, max) } @@ -595,7 +595,7 @@ fn check_type_limits(cx: &Context, e: &ast::Expr) { ast::lit_int_unsuffixed(v) => v as u64, _ => return true }, - _ => fail2!() + _ => fail!() }; is_valid(norm_binop, lit_val, min, max) } diff --git a/src/librustc/middle/liveness.rs b/src/librustc/middle/liveness.rs index 824dbb5b5610..6c53fc1602f2 100644 --- a/src/librustc/middle/liveness.rs +++ b/src/librustc/middle/liveness.rs @@ -276,7 +276,7 @@ impl IrMaps { self.lnks.push(lnk); self.num_live_nodes += 1; - debug2!("{} is of kind {}", ln.to_str(), + debug!("{} is of kind {}", ln.to_str(), live_node_kind_to_str(lnk, self.tcx)); ln @@ -288,7 +288,7 @@ impl IrMaps { let ln = self.add_live_node(lnk); self.live_node_map.insert(node_id, ln); - debug2!("{} is node {}", ln.to_str(), node_id); + debug!("{} is node {}", ln.to_str(), node_id); } pub fn add_variable(&mut self, vk: VarKind) -> Variable { @@ -303,7 +303,7 @@ impl IrMaps { ImplicitRet => {} } - debug2!("{} is {:?}", v.to_str(), vk); + debug!("{} is {:?}", v.to_str(), vk); v } @@ -367,7 +367,7 @@ fn visit_fn(v: &mut LivenessVisitor, sp: Span, id: NodeId, this: @mut IrMaps) { - debug2!("visit_fn: id={}", id); + debug!("visit_fn: id={}", id); let _i = ::util::common::indenter(); // swap in a new set of IR maps for this function body: @@ -376,13 +376,13 @@ fn visit_fn(v: &mut LivenessVisitor, this.capture_map); unsafe { - debug2!("creating fn_maps: {}", transmute::<&IrMaps, *IrMaps>(fn_maps)); + debug!("creating fn_maps: {}", transmute::<&IrMaps, *IrMaps>(fn_maps)); } for arg in decl.inputs.iter() { do pat_util::pat_bindings(this.tcx.def_map, arg.pat) |_bm, arg_id, _x, path| { - debug2!("adding argument {}", arg_id); + debug!("adding argument {}", arg_id); let ident = ast_util::path_to_ident(path); fn_maps.add_variable(Arg(arg_id, ident)); } @@ -429,7 +429,7 @@ fn visit_fn(v: &mut LivenessVisitor, fn visit_local(v: &mut LivenessVisitor, local: @Local, this: @mut IrMaps) { let def_map = this.tcx.def_map; do pat_util::pat_bindings(def_map, local.pat) |_bm, p_id, sp, path| { - debug2!("adding local variable {}", p_id); + debug!("adding local variable {}", p_id); let name = ast_util::path_to_ident(path); this.add_live_node_for_node(p_id, VarDefNode(sp)); let kind = match local.init { @@ -450,7 +450,7 @@ fn visit_arm(v: &mut LivenessVisitor, arm: &Arm, this: @mut IrMaps) { let def_map = this.tcx.def_map; for pat in arm.pats.iter() { do pat_util::pat_bindings(def_map, *pat) |bm, p_id, sp, path| { - debug2!("adding local variable {} from match with bm {:?}", + debug!("adding local variable {} from match with bm {:?}", p_id, bm); let name = ast_util::path_to_ident(path); this.add_live_node_for_node(p_id, VarDefNode(sp)); @@ -470,7 +470,7 @@ fn visit_expr(v: &mut LivenessVisitor, expr: @Expr, this: @mut IrMaps) { // live nodes required for uses or definitions of variables: ExprPath(_) | ExprSelf => { let def = this.tcx.def_map.get_copy(&expr.id); - debug2!("expr {}: path that leads to {:?}", expr.id, def); + debug!("expr {}: path that leads to {:?}", expr.id, def); if moves::moved_variable_node_id_from_def(def).is_some() { this.add_live_node_for_node(expr.id, ExprNode(expr.span)); } @@ -515,7 +515,7 @@ fn visit_expr(v: &mut LivenessVisitor, expr: @Expr, this: @mut IrMaps) { this.add_live_node_for_node(expr.id, ExprNode(expr.span)); visit::walk_expr(v, expr, this); } - ExprForLoop(*) => fail2!("non-desugared expr_for_loop"), + ExprForLoop(*) => fail!("non-desugared expr_for_loop"), ExprBinary(_, op, _, _) if ast_util::lazy_binop(op) => { this.add_live_node_for_node(expr.id, ExprNode(expr.span)); visit::walk_expr(v, expr, this); @@ -819,7 +819,7 @@ impl Liveness { self.indices2(ln, succ_ln, |idx, succ_idx| { self.users[idx] = self.users[succ_idx] }); - debug2!("init_from_succ(ln={}, succ={})", + debug!("init_from_succ(ln={}, succ={})", self.ln_str(ln), self.ln_str(succ_ln)); } @@ -843,7 +843,7 @@ impl Liveness { } } - debug2!("merge_from_succ(ln={}, succ={}, first_merge={}, changed={})", + debug!("merge_from_succ(ln={}, succ={}, first_merge={}, changed={})", ln.to_str(), self.ln_str(succ_ln), first_merge, changed); return changed; @@ -866,7 +866,7 @@ impl Liveness { self.users[idx].reader = invalid_node(); self.users[idx].writer = invalid_node(); - debug2!("{} defines {} (idx={}): {}", writer.to_str(), var.to_str(), + debug!("{} defines {} (idx={}): {}", writer.to_str(), var.to_str(), idx, self.ln_str(writer)); } @@ -891,7 +891,7 @@ impl Liveness { user.used = true; } - debug2!("{} accesses[{:x}] {}: {}", + debug!("{} accesses[{:x}] {}: {}", ln.to_str(), acc, var.to_str(), self.ln_str(ln)); } @@ -902,18 +902,18 @@ impl Liveness { // effectively a return---this only occurs in `for` loops, // where the body is really a closure. - debug2!("compute: using id for block, {}", block_to_str(body, + debug!("compute: using id for block, {}", block_to_str(body, self.tcx.sess.intr())); let entry_ln: LiveNode = self.with_loop_nodes(body.id, self.s.exit_ln, self.s.exit_ln, || { self.propagate_through_fn_block(decl, body) }); - // hack to skip the loop unless debug2! is enabled: - debug2!("^^ liveness computation results for body {} (entry={})", + // hack to skip the loop unless debug! is enabled: + debug!("^^ liveness computation results for body {} (entry={})", { for ln_idx in range(0u, self.ir.num_live_nodes) { - debug2!("{}", self.ln_str(LiveNode(ln_idx))); + debug!("{}", self.ln_str(LiveNode(ln_idx))); } body.id }, @@ -1007,7 +1007,7 @@ impl Liveness { pub fn propagate_through_expr(&self, expr: @Expr, succ: LiveNode) -> LiveNode { - debug2!("propagate_through_expr: {}", + debug!("propagate_through_expr: {}", expr_to_str(expr, self.tcx.sess.intr())); match expr.node { @@ -1022,7 +1022,7 @@ impl Liveness { } ExprFnBlock(_, ref blk) => { - debug2!("{} is an expr_fn_block", + debug!("{} is an expr_fn_block", expr_to_str(expr, self.tcx.sess.intr())); /* @@ -1070,7 +1070,7 @@ impl Liveness { self.propagate_through_loop(expr, Some(cond), blk, succ) } - ExprForLoop(*) => fail2!("non-desugared expr_for_loop"), + ExprForLoop(*) => fail!("non-desugared expr_for_loop"), // Note that labels have been resolved, so we don't need to look // at the label ident @@ -1382,7 +1382,7 @@ impl Liveness { self.merge_from_succ(ln, succ, first_merge); first_merge = false; } - debug2!("propagate_through_loop: using id for loop body {} {}", + debug!("propagate_through_loop: using id for loop body {} {}", expr.id, block_to_str(body, self.tcx.sess.intr())); let cond_ln = self.propagate_through_opt_expr(cond, ln); @@ -1410,7 +1410,7 @@ impl Liveness { cont_ln: LiveNode, f: &fn() -> R) -> R { - debug2!("with_loop_nodes: {} {}", loop_node_id, *break_ln); + debug!("with_loop_nodes: {} {}", loop_node_id, *break_ln); self.loop_scope.push(loop_node_id); self.break_ln.insert(loop_node_id, break_ln); self.cont_ln.insert(loop_node_id, cont_ln); @@ -1433,7 +1433,7 @@ fn check_local(this: &mut Liveness, local: @Local) { // No initializer: the variable might be unused; if not, it // should not be live at this point. - debug2!("check_local() with no initializer"); + debug!("check_local() with no initializer"); do this.pat_bindings(local.pat) |ln, var, sp, id| { if !this.warn_about_unused(sp, id, ln, var) { match this.live_on_exit(ln, var) { @@ -1499,7 +1499,7 @@ fn check_expr(this: &mut Liveness, expr: @Expr) { ExprParen(*) | ExprFnBlock(*) | ExprPath(*) | ExprSelf(*) => { visit::walk_expr(this, expr, ()); } - ExprForLoop(*) => fail2!("non-desugared expr_for_loop") + ExprForLoop(*) => fail!("non-desugared expr_for_loop") } } diff --git a/src/librustc/middle/mem_categorization.rs b/src/librustc/middle/mem_categorization.rs index 3b8ea2c33ec9..37e89e58fa56 100644 --- a/src/librustc/middle/mem_categorization.rs +++ b/src/librustc/middle/mem_categorization.rs @@ -383,7 +383,7 @@ impl mem_categorization_ctxt { } pub fn cat_expr_unadjusted(&self, expr: @ast::Expr) -> cmt { - debug2!("cat_expr: id={} expr={}", + debug!("cat_expr: id={} expr={}", expr.id, pprust::expr_to_str(expr, self.tcx.sess.intr())); let expr_ty = self.expr_ty(expr); @@ -436,7 +436,7 @@ impl mem_categorization_ctxt { return self.cat_rvalue_node(expr, expr_ty); } - ast::ExprForLoop(*) => fail2!("non-desugared expr_for_loop") + ast::ExprForLoop(*) => fail!("non-desugared expr_for_loop") } } @@ -870,7 +870,7 @@ impl mem_categorization_ctxt { // get the type of the *subpattern* and use that. let tcx = self.tcx; - debug2!("cat_pattern: id={} pat={} cmt={}", + debug!("cat_pattern: id={} pat={} cmt={}", pat.id, pprust::pat_to_str(pat, tcx.sess.intr()), cmt.repr(tcx)); let _i = indenter(); diff --git a/src/librustc/middle/moves.rs b/src/librustc/middle/moves.rs index 71d0621fc16a..1ed517c95129 100644 --- a/src/librustc/middle/moves.rs +++ b/src/librustc/middle/moves.rs @@ -275,7 +275,7 @@ impl VisitContext { * meaning either copied or moved depending on its type. */ - debug2!("consume_expr(expr={})", + debug!("consume_expr(expr={})", expr.repr(self.tcx)); let expr_ty = ty::expr_ty_adjusted(self.tcx, expr); @@ -293,7 +293,7 @@ impl VisitContext { * meaning either copied or moved depending on its type. */ - debug2!("consume_block(blk.id={:?})", blk.id); + debug!("consume_block(blk.id={:?})", blk.id); for stmt in blk.stmts.iter() { self.visit_stmt(*stmt, ()); @@ -312,7 +312,7 @@ impl VisitContext { * in turn trigger calls to the subcomponents of `expr`. */ - debug2!("use_expr(expr={}, mode={:?})", + debug!("use_expr(expr={}, mode={:?})", expr.repr(self.tcx), expr_mode); @@ -326,7 +326,7 @@ impl VisitContext { _ => expr_mode }; - debug2!("comp_mode = {:?}", comp_mode); + debug!("comp_mode = {:?}", comp_mode); match expr.node { ExprPath(*) | ExprSelf => { @@ -500,7 +500,7 @@ impl VisitContext { self.consume_block(blk); } - ExprForLoop(*) => fail2!("non-desugared expr_for_loop"), + ExprForLoop(*) => fail!("non-desugared expr_for_loop"), ExprUnary(_, _, lhs) => { if !self.use_overloaded_operator(expr, lhs, []) @@ -620,7 +620,7 @@ impl VisitContext { BindByRef(_) => false, BindInfer => { let pat_ty = ty::node_id_to_type(self.tcx, id); - debug2!("pattern {:?} {} type is {}", + debug!("pattern {:?} {} type is {}", id, ast_util::path_to_ident(path).repr(self.tcx), pat_ty.repr(self.tcx)); @@ -628,7 +628,7 @@ impl VisitContext { } }; - debug2!("pattern binding {:?}: bm={:?}, binding_moves={}", + debug!("pattern binding {:?}: bm={:?}, binding_moves={}", id, bm, binding_moves); if binding_moves { @@ -678,7 +678,7 @@ impl VisitContext { } pub fn compute_captures(&mut self, fn_expr_id: NodeId) -> @[CaptureVar] { - debug2!("compute_capture_vars(fn_expr_id={:?})", fn_expr_id); + debug!("compute_capture_vars(fn_expr_id={:?})", fn_expr_id); let _indenter = indenter(); let fn_ty = ty::node_id_to_type(self.tcx, fn_expr_id); @@ -696,7 +696,7 @@ impl VisitContext { let fvar = &freevars[i]; let fvar_def_id = ast_util::def_id_of_def(fvar.def).node; let fvar_ty = ty::node_id_to_type(self.tcx, fvar_def_id); - debug2!("fvar_def_id={:?} fvar_ty={}", + debug!("fvar_def_id={:?} fvar_ty={}", fvar_def_id, ppaux::ty_to_str(self.tcx, fvar_ty)); let mode = if ty::type_moves_by_default(self.tcx, fvar_ty) { CapMove diff --git a/src/librustc/middle/privacy.rs b/src/librustc/middle/privacy.rs index c502dac7db01..17aab5982898 100644 --- a/src/librustc/middle/privacy.rs +++ b/src/librustc/middle/privacy.rs @@ -192,7 +192,7 @@ impl<'self> Visitor<()> for EmbargoVisitor<'self> { // Trait implementation methods are all completely public ast::item_impl(_, Some(*), _, ref methods) => { for method in methods.iter() { - debug2!("exporting: {}", method.id); + debug!("exporting: {}", method.id); self.exported_items.insert(method.id); } } @@ -203,11 +203,11 @@ impl<'self> Visitor<()> for EmbargoVisitor<'self> { for method in methods.iter() { match *method { ast::provided(ref m) => { - debug2!("provided {}", m.id); + debug!("provided {}", m.id); self.exported_items.insert(m.id); } ast::required(ref m) => { - debug2!("required {}", m.id); + debug!("required {}", m.id); self.exported_items.insert(m.id); } } @@ -267,26 +267,26 @@ impl<'self> PrivacyVisitor<'self> { fn def_privacy(&self, did: ast::DefId) -> PrivacyResult { if !is_local(did) { if self.external_exports.contains(&did) { - debug2!("privacy - {:?} was externally exported", did); + debug!("privacy - {:?} was externally exported", did); return Allowable; } - debug2!("privacy - is {:?} a public method", did); + debug!("privacy - is {:?} a public method", did); return match self.tcx.methods.find(&did) { Some(meth) => { - debug2!("privacy - well at least it's a method: {:?}", meth); + debug!("privacy - well at least it's a method: {:?}", meth); match meth.container { ty::TraitContainer(id) => { - debug2!("privacy - recursing on trait {:?}", id); + debug!("privacy - recursing on trait {:?}", id); self.def_privacy(id) } ty::ImplContainer(id) => { match ty::impl_trait_ref(self.tcx, id) { Some(t) => { - debug2!("privacy - impl of trait {:?}", id); + debug!("privacy - impl of trait {:?}", id); self.def_privacy(t.def_id) } None => { - debug2!("privacy - found a method {:?}", + debug!("privacy - found a method {:?}", meth.vis); if meth.vis == ast::public { Allowable @@ -299,19 +299,19 @@ impl<'self> PrivacyVisitor<'self> { } } None => { - debug2!("privacy - nope, not even a method"); + debug!("privacy - nope, not even a method"); ExternallyDenied } }; } else if self.exported_items.contains(&did.node) { - debug2!("privacy - exported item {}", self.nodestr(did.node)); + debug!("privacy - exported item {}", self.nodestr(did.node)); return Allowable; } - debug2!("privacy - local {:?} not public all the way down", did); + debug!("privacy - local {:?} not public all the way down", did); // return quickly for things in the same module if self.parents.find(&did.node) == self.parents.find(&self.curitem) { - debug2!("privacy - same parent, we're done here"); + debug!("privacy - same parent, we're done here"); return Allowable; } @@ -319,7 +319,7 @@ impl<'self> PrivacyVisitor<'self> { // destination and the root. let mut closest_private_id = did.node; loop { - debug2!("privacy - examining {}", self.nodestr(closest_private_id)); + debug!("privacy - examining {}", self.nodestr(closest_private_id)); let vis = match self.tcx.items.find(&closest_private_id) { Some(&ast_map::node_item(it, _)) => it.vis, Some(&ast_map::node_method(ref m, _, _)) => m.vis, @@ -339,7 +339,7 @@ impl<'self> PrivacyVisitor<'self> { // way down in the first place... assert!(closest_private_id != ast::DUMMY_NODE_ID); } - debug2!("privacy - closest priv {}", self.nodestr(closest_private_id)); + debug!("privacy - closest priv {}", self.nodestr(closest_private_id)); if self.private_accessible(closest_private_id) { Allowable } else { @@ -352,7 +352,7 @@ impl<'self> PrivacyVisitor<'self> { /// inside. fn private_accessible(&self, id: ast::NodeId) -> bool { let parent = *self.parents.get(&id); - debug2!("privacy - accessible parent {}", self.nodestr(parent)); + debug!("privacy - accessible parent {}", self.nodestr(parent)); // After finding `did`'s closest private member, we roll ourselves back // to see if this private member's parent is anywhere in our ancestry. @@ -360,7 +360,7 @@ impl<'self> PrivacyVisitor<'self> { // members, so that's why we test the parent, and not the did itself. let mut cur = self.curitem; loop { - debug2!("privacy - questioning {}", self.nodestr(cur)); + debug!("privacy - questioning {}", self.nodestr(cur)); match cur { // If the relevant parent is in our history, then we're allowed // to look inside any of our ancestor's immediate private items, @@ -458,7 +458,7 @@ impl<'self> PrivacyVisitor<'self> { // Checks that a path is in scope. fn check_path(&mut self, span: Span, path_id: ast::NodeId, path: &ast::Path) { - debug2!("privacy - path {}", self.nodestr(path_id)); + debug!("privacy - path {}", self.nodestr(path_id)); let def = self.tcx.def_map.get_copy(&path_id); let ck = |tyname: &str| { let origdid = def_id_of_def(def); @@ -703,7 +703,7 @@ impl<'self> Visitor<()> for PrivacyVisitor<'self> { } Some(entry) => entry }; - debug2!("(privacy checking) checking impl method"); + debug!("(privacy checking) checking impl method"); self.check_method(expr.span, &entry.origin, ident); } _ => {} @@ -773,12 +773,12 @@ impl<'self> Visitor<()> for PrivacyVisitor<'self> { match vpath.node { ast::view_path_simple(_, ref path, id) | ast::view_path_glob(ref path, id) => { - debug2!("privacy - glob/simple {}", id); + debug!("privacy - glob/simple {}", id); self.check_path(vpath.span, id, path); } ast::view_path_list(_, ref list, _) => { for pid in list.iter() { - debug2!("privacy - list {}", pid.node.id); + debug!("privacy - list {}", pid.node.id); let seg = ast::PathSegment { identifier: pid.node.name, lifetime: None, diff --git a/src/librustc/middle/region.rs b/src/librustc/middle/region.rs index 0ae8e01fe9d4..29acfe143813 100644 --- a/src/librustc/middle/region.rs +++ b/src/librustc/middle/region.rs @@ -93,13 +93,13 @@ impl RegionMaps { None => {} } - debug2!("relate_free_regions(sub={:?}, sup={:?})", sub, sup); + debug!("relate_free_regions(sub={:?}, sup={:?})", sub, sup); self.free_region_map.insert(sub, ~[sup]); } pub fn record_parent(&mut self, sub: ast::NodeId, sup: ast::NodeId) { - debug2!("record_parent(sub={:?}, sup={:?})", sub, sup); + debug!("record_parent(sub={:?}, sup={:?})", sub, sup); assert!(sub != sup); self.scope_map.insert(sub, sup); @@ -125,7 +125,7 @@ impl RegionMaps { match self.scope_map.find(&id) { Some(&r) => r, - None => { fail2!("No enclosing scope for id {:?}", id); } + None => { fail!("No enclosing scope for id {:?}", id); } } } @@ -168,7 +168,7 @@ impl RegionMaps { while superscope != s { match self.scope_map.find(&s) { None => { - debug2!("is_subscope_of({:?}, {:?}, s={:?})=false", + debug!("is_subscope_of({:?}, {:?}, s={:?})=false", subscope, superscope, s); return false; @@ -177,7 +177,7 @@ impl RegionMaps { } } - debug2!("is_subscope_of({:?}, {:?})=true", + debug!("is_subscope_of({:?}, {:?})=true", subscope, superscope); return true; @@ -231,7 +231,7 @@ impl RegionMaps { * duplicated with the code in infer.rs. */ - debug2!("is_subregion_of(sub_region={:?}, super_region={:?})", + debug!("is_subregion_of(sub_region={:?}, super_region={:?})", sub_region, super_region); sub_region == super_region || { @@ -303,7 +303,7 @@ impl RegionMaps { fn ancestors_of(this: &RegionMaps, scope: ast::NodeId) -> ~[ast::NodeId] { - // debug2!("ancestors_of(scope={})", scope); + // debug!("ancestors_of(scope={})", scope); let mut result = ~[scope]; let mut scope = scope; loop { @@ -314,7 +314,7 @@ impl RegionMaps { scope = superscope; } } - // debug2!("ancestors_of_loop(scope={})", scope); + // debug!("ancestors_of_loop(scope={})", scope); } } } @@ -323,7 +323,7 @@ impl RegionMaps { /// Records the current parent (if any) as the parent of `child_id`. fn parent_to_expr(visitor: &mut RegionResolutionVisitor, cx: Context, child_id: ast::NodeId, sp: Span) { - debug2!("region::parent_to_expr(span={:?})", + debug!("region::parent_to_expr(span={:?})", visitor.sess.codemap.span_to_str(sp)); for parent_id in cx.parent.iter() { visitor.region_maps.record_parent(child_id, *parent_id); @@ -437,7 +437,7 @@ fn resolve_fn(visitor: &mut RegionResolutionVisitor, sp: Span, id: ast::NodeId, cx: Context) { - debug2!("region::resolve_fn(id={:?}, \ + debug!("region::resolve_fn(id={:?}, \ span={:?}, \ body.id={:?}, \ cx.parent={:?})", @@ -619,7 +619,7 @@ impl DetermineRpCtxt { Some(v) => join_variance(v, variance) }; - debug2!("add_rp() variance for {}: {:?} == {:?} ^ {:?}", + debug!("add_rp() variance for {}: {:?} == {:?} ^ {:?}", ast_map::node_id_to_str(self.ast_map, id, token::get_ident_interner()), joined_variance, old_variance, variance); @@ -637,7 +637,7 @@ impl DetermineRpCtxt { /// contains a value of type `from`, so if `from` is /// region-parameterized, so is the current item. pub fn add_dep(&mut self, from: ast::NodeId) { - debug2!("add dependency from {} -> {} ({} -> {}) with variance {:?}", + debug!("add dependency from {} -> {} ({} -> {}) with variance {:?}", from, self.item_id, ast_map::node_id_to_str(self.ast_map, from, token::get_ident_interner()), @@ -715,7 +715,7 @@ impl DetermineRpCtxt { let old_anon_implies_rp = self.anon_implies_rp; self.item_id = item_id; self.anon_implies_rp = anon_implies_rp; - debug2!("with_item_id({}, {})", + debug!("with_item_id({}, {})", item_id, anon_implies_rp); let _i = ::util::common::indenter(); @@ -787,7 +787,7 @@ fn determine_rp_in_ty(visitor: &mut DetermineRpVisitor, let sess = cx.sess; match ty.node { ast::ty_rptr(ref r, _) => { - debug2!("referenced rptr type {}", + debug!("referenced rptr type {}", pprust::ty_to_str(ty, sess.intr())); if cx.region_is_relevant(r) { @@ -797,7 +797,7 @@ fn determine_rp_in_ty(visitor: &mut DetermineRpVisitor, } ast::ty_closure(ref f) => { - debug2!("referenced fn type: {}", + debug!("referenced fn type: {}", pprust::ty_to_str(ty, sess.intr())); match f.region { Some(_) => { @@ -837,7 +837,7 @@ fn determine_rp_in_ty(visitor: &mut DetermineRpVisitor, match csearch::get_region_param(cstore, did) { None => {} Some(variance) => { - debug2!("reference to external, rp'd type {}", + debug!("reference to external, rp'd type {}", pprust::ty_to_str(ty, sess.intr())); if cx.region_is_relevant(&path.segments.last().lifetime) { let rv = cx.add_variance(variance); @@ -967,7 +967,7 @@ pub fn determine_rp_in_crate(sess: Session, while cx.worklist.len() != 0 { let c_id = cx.worklist.pop(); let c_variance = cx.region_paramd_items.get_copy(&c_id); - debug2!("popped {} from worklist", c_id); + debug!("popped {} from worklist", c_id); match cx.dep_map.find(&c_id) { None => {} Some(deps) => { @@ -980,11 +980,11 @@ pub fn determine_rp_in_crate(sess: Session, } } - debug2!("{}", { - debug2!("Region variance results:"); + debug!("{}", { + debug!("Region variance results:"); let region_paramd_items = cx.region_paramd_items; for (&key, &value) in region_paramd_items.iter() { - debug2!("item {:?} ({}) is parameterized with variance {:?}", + debug!("item {:?} ({}) is parameterized with variance {:?}", key, ast_map::node_id_to_str(ast_map, key, token::get_ident_interner()), diff --git a/src/librustc/middle/resolve.rs b/src/librustc/middle/resolve.rs index a6c22bd57426..b480aaac1acb 100644 --- a/src/librustc/middle/resolve.rs +++ b/src/librustc/middle/resolve.rs @@ -665,7 +665,7 @@ impl NameBindings { fn get_module(&mut self) -> @mut Module { match self.get_module_if_available() { None => { - fail2!("get_module called on a node with no module \ + fail!("get_module called on a node with no module \ definition!") } Some(module_def) => module_def @@ -1405,7 +1405,7 @@ impl Resolver { } match self.method_map.find_mut(name) { Some(s) => { s.insert(def_id); }, - _ => fail2!("Can't happen"), + _ => fail!("Can't happen"), } } @@ -1414,7 +1414,7 @@ impl Resolver { } item_mac(*) => { - fail2!("item macros unimplemented") + fail!("item macros unimplemented") } } } @@ -1596,7 +1596,7 @@ impl Resolver { if self.block_needs_anonymous_module(block) { let block_id = block.id; - debug2!("(building reduced graph for block) creating a new \ + debug!("(building reduced graph for block) creating a new \ anonymous module for block {}", block_id); @@ -1621,7 +1621,7 @@ impl Resolver { final_ident: &str, ident: Ident, new_parent: ReducedGraphParent) { - debug2!("(building reduced graph for \ + debug!("(building reduced graph for \ external crate) building external def, priv {:?}", vis); let is_public = vis == ast::public; @@ -1641,12 +1641,12 @@ impl Resolver { DefTy(def_id) => { match child_name_bindings.type_def { Some(TypeNsDef { module_def: Some(module_def), _ }) => { - debug2!("(building reduced graph for external crate) \ + debug!("(building reduced graph for external crate) \ already created module"); module_def.def_id = Some(def_id); } Some(_) | None => { - debug2!("(building reduced graph for \ + debug!("(building reduced graph for \ external crate) building module \ {}", final_ident); let parent_link = self.get_parent_link(new_parent, ident); @@ -1666,7 +1666,7 @@ impl Resolver { match def { DefMod(_) | DefForeignMod(_) => {} DefVariant(_, variant_id, is_struct) => { - debug2!("(building reduced graph for external crate) building \ + debug!("(building reduced graph for external crate) building \ variant {}", final_ident); // We assume the parent is visible, or else we wouldn't have seen @@ -1681,12 +1681,12 @@ impl Resolver { } } DefFn(*) | DefStaticMethod(*) | DefStatic(*) => { - debug2!("(building reduced graph for external \ + debug!("(building reduced graph for external \ crate) building value (fn/static) {}", final_ident); child_name_bindings.define_value(def, dummy_sp(), is_public); } DefTrait(def_id) => { - debug2!("(building reduced graph for external \ + debug!("(building reduced graph for external \ crate) building type {}", final_ident); // If this is a trait, add all the method names @@ -1700,7 +1700,7 @@ impl Resolver { get_method_name_and_explicit_self(self.session.cstore, method_def_id); - debug2!("(building reduced graph for \ + debug!("(building reduced graph for \ external crate) ... adding \ trait method '{}'", self.session.str_of(method_name)); @@ -1719,7 +1719,7 @@ impl Resolver { } match self.method_map.find_mut(name) { Some(s) => { s.insert(def_id); }, - _ => fail2!("Can't happen"), + _ => fail!("Can't happen"), } } @@ -1735,13 +1735,13 @@ impl Resolver { dummy_sp()) } DefTy(_) => { - debug2!("(building reduced graph for external \ + debug!("(building reduced graph for external \ crate) building type {}", final_ident); child_name_bindings.define_type(def, dummy_sp(), is_public); } DefStruct(def_id) => { - debug2!("(building reduced graph for external \ + debug!("(building reduced graph for external \ crate) building type and value for {}", final_ident); child_name_bindings.define_type(def, dummy_sp(), is_public); @@ -1751,7 +1751,7 @@ impl Resolver { self.structs.insert(def_id); } DefMethod(*) => { - debug2!("(building reduced graph for external crate) \ + debug!("(building reduced graph for external crate) \ ignoring {:?}", def); // Ignored; handled elsewhere. } @@ -1759,7 +1759,7 @@ impl Resolver { DefPrimTy(*) | DefTyParam(*) | DefBinding(*) | DefUse(*) | DefUpvar(*) | DefRegion(*) | DefTyParamBinder(*) | DefLabel(*) | DefSelfTy(*) => { - fail2!("didn't expect `{:?}`", def); + fail!("didn't expect `{:?}`", def); } } } @@ -1814,7 +1814,7 @@ impl Resolver { match static_methods_opt { Some(ref static_methods) if static_methods.len() >= 1 => { - debug2!("(building reduced graph for \ + debug!("(building reduced graph for \ external crate) processing \ static methods for type name {}", self.session.str_of( @@ -1866,7 +1866,7 @@ impl Resolver { for static_method_info in static_methods.iter() { let ident = static_method_info.ident; - debug2!("(building reduced graph for \ + debug!("(building reduced graph for \ external crate) creating \ static method '{}'", self.session.str_of(ident)); @@ -1893,7 +1893,7 @@ impl Resolver { } } DlField => { - debug2!("(building reduced graph for external crate) \ + debug!("(building reduced graph for external crate) \ ignoring field"); } } @@ -1901,12 +1901,12 @@ impl Resolver { /// Builds the reduced graph rooted at the given external module. fn populate_external_module(&mut self, module: @mut Module) { - debug2!("(populating external module) attempting to populate {}", + debug!("(populating external module) attempting to populate {}", self.module_to_str(module)); let def_id = match module.def_id { None => { - debug2!("(populating external module) ... no def ID!"); + debug!("(populating external module) ... no def ID!"); return } Some(def_id) => def_id, @@ -1914,7 +1914,7 @@ impl Resolver { do csearch::each_child_of_item(self.session.cstore, def_id) |def_like, child_ident, visibility| { - debug2!("(populating external module) ... found ident: {}", + debug!("(populating external module) ... found ident: {}", token::ident_to_str(&child_ident)); self.build_reduced_graph_for_external_crate_def(module, def_like, @@ -1965,14 +1965,14 @@ impl Resolver { match *subclass { SingleImport(target, _) => { - debug2!("(building import directive) building import \ + debug!("(building import directive) building import \ directive: {}::{}", self.idents_to_str(directive.module_path), self.session.str_of(target)); match module_.import_resolutions.find(&target.name) { Some(&resolution) => { - debug2!("(building import directive) bumping \ + debug!("(building import directive) bumping \ reference"); resolution.outstanding_references += 1; @@ -1981,7 +1981,7 @@ impl Resolver { resolution.value_id = id; } None => { - debug2!("(building import directive) creating new"); + debug!("(building import directive) creating new"); let resolution = @mut ImportResolution::new(id, is_public); resolution.outstanding_references = 1; module_.import_resolutions.insert(target.name, resolution); @@ -2013,14 +2013,14 @@ impl Resolver { let mut i = 0; let mut prev_unresolved_imports = 0; loop { - debug2!("(resolving imports) iteration {}, {} imports left", + debug!("(resolving imports) iteration {}, {} imports left", i, self.unresolved_imports); let module_root = self.graph_root.get_module(); self.resolve_imports_for_module_subtree(module_root); if self.unresolved_imports == 0 { - debug2!("(resolving imports) success"); + debug!("(resolving imports) success"); break; } @@ -2038,7 +2038,7 @@ impl Resolver { /// submodules. fn resolve_imports_for_module_subtree(&mut self, module_: @mut Module) { - debug2!("(resolving imports for module subtree) resolving {}", + debug!("(resolving imports for module subtree) resolving {}", self.module_to_str(module_)); self.resolve_imports_for_module(module_); @@ -2062,7 +2062,7 @@ impl Resolver { /// Attempts to resolve imports for the given module only. fn resolve_imports_for_module(&mut self, module: @mut Module) { if module.all_imports_resolved() { - debug2!("(resolving imports for module) all imports resolved for \ + debug!("(resolving imports for module) all imports resolved for \ {}", self.module_to_str(module)); return; @@ -2151,7 +2151,7 @@ impl Resolver { let mut resolution_result = Failed; let module_path = &import_directive.module_path; - debug2!("(resolving import for module) resolving import `{}::...` in \ + debug!("(resolving import for module) resolving import `{}::...` in \ `{}`", self.idents_to_str(*module_path), self.module_to_str(module_)); @@ -2256,7 +2256,7 @@ impl Resolver { directive: &ImportDirective, lp: LastPrivate) -> ResolveResult<()> { - debug2!("(resolving single import) resolving `{}` = `{}::{}` from \ + debug!("(resolving single import) resolving `{}` = `{}::{}` from \ `{}` id {}, last private {:?}", self.session.str_of(target), self.module_to_str(containing_module), @@ -2300,7 +2300,7 @@ impl Resolver { // able to resolve this import. if containing_module.glob_count > 0 { - debug2!("(resolving single import) unresolved glob; \ + debug!("(resolving single import) unresolved glob; \ bailing out"); return Indeterminate; } @@ -2368,7 +2368,7 @@ impl Resolver { } Some(_) => { // The import is unresolved. Bail out. - debug2!("(resolving single import) unresolved import; \ + debug!("(resolving single import) unresolved import; \ bailing out"); return Indeterminate; } @@ -2403,7 +2403,7 @@ impl Resolver { match value_result { BoundResult(target_module, name_bindings) => { - debug2!("(resolving single import) found value target"); + debug!("(resolving single import) found value target"); import_resolution.value_target = Some(Target::new(target_module, name_bindings)); import_resolution.value_id = directive.id; @@ -2411,12 +2411,12 @@ impl Resolver { } UnboundResult => { /* Continue. */ } UnknownResult => { - fail2!("value result should be known at this point"); + fail!("value result should be known at this point"); } } match type_result { BoundResult(target_module, name_bindings) => { - debug2!("(resolving single import) found type target: {:?}", + debug!("(resolving single import) found type target: {:?}", name_bindings.type_def.unwrap().type_def); import_resolution.type_target = Some(Target::new(target_module, name_bindings)); @@ -2425,7 +2425,7 @@ impl Resolver { } UnboundResult => { /* Continue. */ } UnknownResult => { - fail2!("type result should be known at this point"); + fail!("type result should be known at this point"); } } @@ -2467,7 +2467,7 @@ impl Resolver { None => {} } - debug2!("(resolving single import) successfully resolved import"); + debug!("(resolving single import) successfully resolved import"); return Success(()); } @@ -2484,12 +2484,12 @@ impl Resolver { // This function works in a highly imperative manner; it eagerly adds // everything it can to the list of import resolutions of the module // node. - debug2!("(resolving glob import) resolving glob import {}", id); + debug!("(resolving glob import) resolving glob import {}", id); // We must bail out if the node has unresolved imports of any kind // (including globs). if !(*containing_module).all_imports_resolved() { - debug2!("(resolving glob import) target module has unresolved \ + debug!("(resolving glob import) target module has unresolved \ imports; bailing out"); return Indeterminate; } @@ -2499,13 +2499,13 @@ impl Resolver { // Add all resolved imports from the containing module. for (ident, target_import_resolution) in containing_module.import_resolutions.iter() { - debug2!("(resolving glob import) writing module resolution \ + debug!("(resolving glob import) writing module resolution \ {:?} into `{}`", target_import_resolution.type_target.is_none(), self.module_to_str(module_)); if !target_import_resolution.is_public { - debug2!("(resolving glob import) nevermind, just kidding"); + debug!("(resolving glob import) nevermind, just kidding"); continue } @@ -2566,7 +2566,7 @@ impl Resolver { } } - debug2!("(resolving glob import) writing resolution `{}` in `{}` \ + debug!("(resolving glob import) writing resolution `{}` in `{}` \ to `{}`", interner_get(name), self.module_to_str(containing_module), @@ -2574,13 +2574,13 @@ impl Resolver { // Merge the child item into the import resolution. if name_bindings.defined_in_public_namespace(ValueNS) { - debug2!("(resolving glob import) ... for value target"); + debug!("(resolving glob import) ... for value target"); dest_import_resolution.value_target = Some(Target::new(containing_module, name_bindings)); dest_import_resolution.value_id = id; } if name_bindings.defined_in_public_namespace(TypeNS) { - debug2!("(resolving glob import) ... for type target"); + debug!("(resolving glob import) ... for type target"); dest_import_resolution.type_target = Some(Target::new(containing_module, name_bindings)); dest_import_resolution.type_id = id; @@ -2610,7 +2610,7 @@ impl Resolver { None => {} } - debug2!("(resolving glob import) successfully resolved import"); + debug!("(resolving glob import) successfully resolved import"); return Success(()); } @@ -2658,7 +2658,7 @@ impl Resolver { return Failed; } Indeterminate => { - debug2!("(resolving module path for import) module \ + debug!("(resolving module path for import) module \ resolution is indeterminate: {}", self.session.str_of(name)); return Indeterminate; @@ -2747,7 +2747,7 @@ impl Resolver { let module_path_len = module_path.len(); assert!(module_path_len > 0); - debug2!("(resolving module path for import) processing `{}` rooted at \ + debug!("(resolving module path for import) processing `{}` rooted at \ `{}`", self.idents_to_str(module_path), self.module_to_str(module_)); @@ -2776,7 +2776,7 @@ impl Resolver { return Failed; } Indeterminate => { - debug2!("(resolving module path for import) indeterminate; \ + debug!("(resolving module path for import) indeterminate; \ bailing"); return Indeterminate; } @@ -2805,7 +2805,7 @@ impl Resolver { return Failed; } Indeterminate => { - debug2!("(resolving module path for import) \ + debug!("(resolving module path for import) \ indeterminate; bailing"); return Indeterminate; } @@ -2842,7 +2842,7 @@ impl Resolver { search_through_modules: SearchThroughModulesFlag) -> ResolveResult<(Target, bool)> { - debug2!("(resolving item in lexical scope) resolving `{}` in \ + debug!("(resolving item in lexical scope) resolving `{}` in \ namespace {:?} in `{}`", self.session.str_of(name), namespace, @@ -2854,7 +2854,7 @@ impl Resolver { match module_.children.find(&name.name) { Some(name_bindings) if name_bindings.defined_in_namespace(namespace) => { - debug2!("top name bindings succeeded"); + debug!("top name bindings succeeded"); return Success((Target::new(module_, *name_bindings), false)); } Some(_) | None => { /* Not found; continue. */ } @@ -2872,12 +2872,12 @@ impl Resolver { match (*import_resolution).target_for_namespace(namespace) { None => { // Not found; continue. - debug2!("(resolving item in lexical scope) found \ + debug!("(resolving item in lexical scope) found \ import resolution, but not in namespace {:?}", namespace); } Some(target) => { - debug2!("(resolving item in lexical scope) using \ + debug!("(resolving item in lexical scope) using \ import resolution"); self.used_imports.insert(import_resolution.id(namespace)); return Success((target, false)); @@ -2894,7 +2894,7 @@ impl Resolver { let name_bindings = @mut Resolver::create_name_bindings_from_module( *module); - debug2!("lower name bindings succeeded"); + debug!("lower name bindings succeeded"); return Success((Target::new(module_, name_bindings), false)); } } @@ -2907,7 +2907,7 @@ impl Resolver { match search_module.parent_link { NoParentLink => { // No more parents. This module was unresolved. - debug2!("(resolving item in lexical scope) unresolved \ + debug!("(resolving item in lexical scope) unresolved \ module"); return Failed; } @@ -2917,7 +2917,7 @@ impl Resolver { match search_module.kind { NormalModuleKind => { // We stop the search here. - debug2!("(resolving item in lexical \ + debug!("(resolving item in lexical \ scope) unresolved module: not \ searching through module \ parents"); @@ -2953,13 +2953,13 @@ impl Resolver { // We couldn't see through the higher scope because of an // unresolved import higher up. Bail. - debug2!("(resolving item in lexical scope) indeterminate \ + debug!("(resolving item in lexical scope) indeterminate \ higher scope; bailing"); return Indeterminate; } Success((target, used_reexport)) => { // We found the module. - debug2!("(resolving item in lexical scope) found name \ + debug!("(resolving item in lexical scope) found name \ in module, done"); return Success((target, used_reexport)); } @@ -2983,7 +2983,7 @@ impl Resolver { Some(ref type_def) => { match (*type_def).module_def { None => { - error2!("!!! (resolving module in lexical \ + error!("!!! (resolving module in lexical \ scope) module wasn't actually a \ module!"); return Failed; @@ -2994,19 +2994,19 @@ impl Resolver { } } None => { - error2!("!!! (resolving module in lexical scope) module + error!("!!! (resolving module in lexical scope) module wasn't actually a module!"); return Failed; } } } Indeterminate => { - debug2!("(resolving module in lexical scope) indeterminate; \ + debug!("(resolving module in lexical scope) indeterminate; \ bailing"); return Indeterminate; } Failed => { - debug2!("(resolving module in lexical scope) failed to \ + debug!("(resolving module in lexical scope) failed to \ resolve"); return Failed; } @@ -3079,7 +3079,7 @@ impl Resolver { // Now loop through all the `super`s we find. while i < module_path.len() && "super" == token::ident_to_str(&module_path[i]) { - debug2!("(resolving module prefix) resolving `super` at {}", + debug!("(resolving module prefix) resolving `super` at {}", self.module_to_str(containing_module)); match self.get_nearest_normal_module_parent(containing_module) { None => return Failed, @@ -3090,7 +3090,7 @@ impl Resolver { } } - debug2!("(resolving module prefix) finished resolving prefix at {}", + debug!("(resolving module prefix) finished resolving prefix at {}", self.module_to_str(containing_module)); return Success(PrefixFound(containing_module, i)); @@ -3108,7 +3108,7 @@ impl Resolver { namespace: Namespace, name_search_type: NameSearchType) -> ResolveResult<(Target, bool)> { - debug2!("(resolving name in module) resolving `{}` in `{}`", + debug!("(resolving name in module) resolving `{}` in `{}`", self.session.str_of(name), self.module_to_str(module_)); @@ -3117,7 +3117,7 @@ impl Resolver { match module_.children.find(&name.name) { Some(name_bindings) if name_bindings.defined_in_namespace(namespace) => { - debug2!("(resolving name in module) found node as child"); + debug!("(resolving name in module) found node as child"); return Success((Target::new(module_, *name_bindings), false)); } Some(_) | None => { @@ -3138,18 +3138,18 @@ impl Resolver { Some(import_resolution) => { if import_resolution.is_public && import_resolution.outstanding_references != 0 { - debug2!("(resolving name in module) import \ + debug!("(resolving name in module) import \ unresolved; bailing out"); return Indeterminate; } match import_resolution.target_for_namespace(namespace) { None => { - debug2!("(resolving name in module) name found, \ + debug!("(resolving name in module) name found, \ but not in namespace {:?}", namespace); } Some(target) => { - debug2!("(resolving name in module) resolved to \ + debug!("(resolving name in module) resolved to \ import"); self.used_imports.insert(import_resolution.id(namespace)); return Success((target, true)); @@ -3173,7 +3173,7 @@ impl Resolver { } // We're out of luck. - debug2!("(resolving name in module) failed to resolve `{}`", + debug!("(resolving name in module) failed to resolve `{}`", self.session.str_of(name)); return Failed; } @@ -3233,19 +3233,19 @@ impl Resolver { match module_.def_id { Some(def_id) if def_id.crate == LOCAL_CRATE => { // OK. Continue. - debug2!("(recording exports for module subtree) recording \ + debug!("(recording exports for module subtree) recording \ exports for local module `{}`", self.module_to_str(module_)); } None => { // Record exports for the root module. - debug2!("(recording exports for module subtree) recording \ + debug!("(recording exports for module subtree) recording \ exports for root module `{}`", self.module_to_str(module_)); } Some(_) => { // Bail out. - debug2!("(recording exports for module subtree) not recording \ + debug!("(recording exports for module subtree) not recording \ exports for `{}`", self.module_to_str(module_)); return; @@ -3278,7 +3278,7 @@ impl Resolver { match module_.def_id { Some(def_id) => { self.export_map2.insert(def_id.node, exports2); - debug2!("(computing exports) writing exports for {} (some)", + debug!("(computing exports) writing exports for {} (some)", def_id.node); } None => {} @@ -3293,7 +3293,7 @@ impl Resolver { reexport: bool) { match namebindings.def_for_namespace(ns) { Some(d) => { - debug2!("(computing exports) YES: {} '{}' => {:?}", + debug!("(computing exports) YES: {} '{}' => {:?}", if reexport { ~"reexport" } else { ~"export"}, interner_get(name), def_id_of_def(d)); @@ -3304,7 +3304,7 @@ impl Resolver { }); } d_opt => { - debug2!("(computing reexports) NO: {:?}", d_opt); + debug!("(computing reexports) NO: {:?}", d_opt); } } } @@ -3318,7 +3318,7 @@ impl Resolver { for &ns in xs.iter() { match importresolution.target_for_namespace(ns) { Some(target) => { - debug2!("(computing exports) maybe reexport '{}'", + debug!("(computing exports) maybe reexport '{}'", interner_get(*name)); self.add_exports_of_namebindings(exports2, *name, @@ -3362,14 +3362,14 @@ impl Resolver { self.populate_module_if_necessary(orig_module); match orig_module.children.find(&name.name) { None => { - debug2!("!!! (with scope) didn't find `{}` in `{}`", + debug!("!!! (with scope) didn't find `{}` in `{}`", self.session.str_of(name), self.module_to_str(orig_module)); } Some(name_bindings) => { match (*name_bindings).get_module_if_available() { None => { - debug2!("!!! (with scope) didn't find module \ + debug!("!!! (with scope) didn't find module \ for `{}` in `{}`", self.session.str_of(name), self.module_to_str(orig_module)); @@ -3529,13 +3529,13 @@ impl Resolver { } fn resolve_crate(&mut self, crate: &ast::Crate) { - debug2!("(resolving crate) starting"); + debug!("(resolving crate) starting"); visit::walk_crate(self, crate, ()); } fn resolve_item(&mut self, item: @item) { - debug2!("(resolving item) resolving {}", + debug!("(resolving item) resolving {}", self.session.str_of(item.ident)); // Items with the !resolve_unexported attribute are X-ray contexts. @@ -3705,7 +3705,7 @@ impl Resolver { } item_mac(*) => { - fail2!("item macros unimplemented") + fail!("item macros unimplemented") } } @@ -3724,7 +3724,7 @@ impl Resolver { for (index, type_parameter) in generics.ty_params.iter().enumerate() { let ident = type_parameter.ident; - debug2!("with_type_parameter_rib: {} {}", node_id, + debug!("with_type_parameter_rib: {} {}", node_id, type_parameter.id); let def_like = DlDef(DefTyParam (local_def(type_parameter.id), @@ -3822,7 +3822,7 @@ impl Resolver { this.resolve_type(&argument.ty); - debug2!("(resolving function) recorded argument"); + debug!("(resolving function) recorded argument"); } this.resolve_type(&declaration.output); @@ -3832,7 +3832,7 @@ impl Resolver { // Resolve the function body. this.resolve_block(block); - debug2!("(resolving function) leaving function"); + debug!("(resolving function) leaving function"); } self.label_ribs.pop(); @@ -3876,7 +3876,7 @@ impl Resolver { self.resolve_error(trait_reference.path.span, msg); } Some(def) => { - debug2!("(resolving trait) found trait def: {:?}", def); + debug!("(resolving trait) found trait def: {:?}", def); self.record_def(trait_reference.ref_id, def); } } @@ -4027,7 +4027,7 @@ impl Resolver { _name: Ident, id: NodeId) { // Write the implementations in scope into the module metadata. - debug2!("(resolving module) resolving module ID {}", id); + debug!("(resolving module) resolving module ID {}", id); visit::walk_mod(self, module_, ()); } @@ -4127,7 +4127,7 @@ impl Resolver { } fn resolve_block(&mut self, block: &Block) { - debug2!("(resolving block) entering block"); + debug!("(resolving block) entering block"); self.value_ribs.push(@Rib::new(NormalRibKind)); // Move down in the graph, if there's an anonymous module rooted here. @@ -4135,7 +4135,7 @@ impl Resolver { match self.current_module.anonymous_children.find(&block.id) { None => { /* Nothing to do. */ } Some(&anonymous_module) => { - debug2!("(resolving block) found anonymous module, moving \ + debug!("(resolving block) found anonymous module, moving \ down"); self.current_module = anonymous_module; } @@ -4148,7 +4148,7 @@ impl Resolver { self.current_module = orig_module; self.value_ribs.pop(); - debug2!("(resolving block) leaving block"); + debug!("(resolving block) leaving block"); } fn resolve_type(&mut self, ty: &Ty) { @@ -4199,7 +4199,7 @@ impl Resolver { None => { match self.resolve_path(ty.id, path, TypeNS, true) { Some(def) => { - debug2!("(resolving type) resolved `{}` to \ + debug!("(resolving type) resolved `{}` to \ type {:?}", self.session.str_of(path.segments .last() @@ -4218,7 +4218,7 @@ impl Resolver { match result_def { Some(def) => { // Write the result into the def map. - debug2!("(resolving type) writing resolution for `{}` \ + debug!("(resolving type) writing resolution for `{}` \ (id {})", self.path_idents_to_str(path), path_id); @@ -4282,7 +4282,7 @@ impl Resolver { match self.resolve_bare_identifier_pattern(ident) { FoundStructOrEnumVariant(def, lp) if mode == RefutableMode => { - debug2!("(resolving pattern) resolving `{}` to \ + debug!("(resolving pattern) resolving `{}` to \ struct or enum variant", interner_get(renamed)); @@ -4301,7 +4301,7 @@ impl Resolver { interner_get(renamed))); } FoundConst(def, lp) if mode == RefutableMode => { - debug2!("(resolving pattern) resolving `{}` to \ + debug!("(resolving pattern) resolving `{}` to \ constant", interner_get(renamed)); @@ -4317,7 +4317,7 @@ impl Resolver { allowed here"); } BareIdentifierPatternUnresolved => { - debug2!("(resolving pattern) binding `{}`", + debug!("(resolving pattern) binding `{}`", interner_get(renamed)); let is_mutable = mutability == Mutable; @@ -4490,7 +4490,7 @@ impl Resolver { self.record_def(pattern.id, definition); } result => { - debug2!("(resolving pattern) didn't find struct \ + debug!("(resolving pattern) didn't find struct \ def: {:?}", result); let msg = format!("`{}` does not name a structure", self.path_idents_to_str(path)); @@ -4515,12 +4515,12 @@ impl Resolver { ValueNS, SearchThroughModules) { Success((target, _)) => { - debug2!("(resolve bare identifier pattern) succeeded in \ + debug!("(resolve bare identifier pattern) succeeded in \ finding {} at {:?}", self.session.str_of(name), target.bindings.value_def); match target.bindings.value_def { None => { - fail2!("resolved name in the value namespace to a \ + fail!("resolved name in the value namespace to a \ set of name bindings with no def?!"); } Some(def) => { @@ -4543,11 +4543,11 @@ impl Resolver { } Indeterminate => { - fail2!("unexpected indeterminate result"); + fail!("unexpected indeterminate result"); } Failed => { - debug2!("(resolve bare identifier pattern) failed to find {}", + debug!("(resolve bare identifier pattern) failed to find {}", self.session.str_of(name)); return BareIdentifierPatternUnresolved; } @@ -4713,7 +4713,7 @@ impl Resolver { } Indeterminate => { - fail2!("indeterminate unexpected"); + fail!("indeterminate unexpected"); } Success((resulting_module, resulting_last_private)) => { @@ -4740,7 +4740,7 @@ impl Resolver { Some(s) => { match containing_module.def_id { Some(def_id) if s.contains(&def_id) => { - debug2!("containing module was a trait or impl \ + debug!("containing module was a trait or impl \ and name was a method -> not resolved"); return None; }, @@ -4781,7 +4781,7 @@ impl Resolver { } Indeterminate => { - fail2!("indeterminate unexpected"); + fail!("indeterminate unexpected"); } Success((resulting_module, resulting_last_private)) => { @@ -4827,7 +4827,7 @@ impl Resolver { match search_result { Some(DlDef(def)) => { - debug2!("(resolving path in local ribs) resolved `{}` to \ + debug!("(resolving path in local ribs) resolved `{}` to \ local: {:?}", self.session.str_of(ident), def); @@ -4885,13 +4885,13 @@ impl Resolver { None => { // This can happen if we were looking for a type and // found a module instead. Modules don't have defs. - debug2!("(resolving item path by identifier in lexical \ + debug!("(resolving item path by identifier in lexical \ scope) failed to resolve {} after success...", self.session.str_of(ident)); return None; } Some(def) => { - debug2!("(resolving item path in lexical scope) \ + debug!("(resolving item path in lexical scope) \ resolved `{}` to item", self.session.str_of(ident)); // This lookup is "all public" because it only searched @@ -4902,10 +4902,10 @@ impl Resolver { } } Indeterminate => { - fail2!("unexpected indeterminate result"); + fail!("unexpected indeterminate result"); } Failed => { - debug2!("(resolving item path by identifier in lexical scope) \ + debug!("(resolving item path by identifier in lexical scope) \ failed to resolve {}", self.session.str_of(ident)); return None; } @@ -4983,7 +4983,7 @@ impl Resolver { match self.resolve_path(expr.id, path, ValueNS, true) { Some(def) => { // Write the result into the def map. - debug2!("(resolving expr) resolved `{}`", + debug!("(resolving expr) resolved `{}`", self.path_idents_to_str(path)); // First-class methods are not supported yet; error @@ -5069,7 +5069,7 @@ impl Resolver { self.record_def(expr.id, definition); } result => { - debug2!("(resolving expression) didn't find struct \ + debug!("(resolving expression) didn't find struct \ def: {:?}", result); let msg = format!("`{}` does not name a structure", self.path_idents_to_str(path)); @@ -5091,7 +5091,7 @@ impl Resolver { } } - ExprForLoop(*) => fail2!("non-desugared expr_for_loop"), + ExprForLoop(*) => fail!("non-desugared expr_for_loop"), ExprBreak(Some(label)) | ExprAgain(Some(label)) => { match self.search_ribs(self.label_ribs, label, expr.span, @@ -5142,7 +5142,7 @@ impl Resolver { self.trait_map.insert(expr.id, @mut traits); } ExprMethodCall(_, _, ident, _, _, _) => { - debug2!("(recording candidate traits for expr) recording \ + debug!("(recording candidate traits for expr) recording \ traits for {}", expr.id); let traits = self.search_for_traits_containing_method(ident); @@ -5217,7 +5217,7 @@ impl Resolver { fn search_for_traits_containing_method(&mut self, name: Ident) -> ~[DefId] { - debug2!("(searching for traits containing method) looking for '{}'", + debug!("(searching for traits containing method) looking for '{}'", self.session.str_of(name)); let mut found_traits = ~[]; @@ -5319,7 +5319,7 @@ impl Resolver { found_traits: &mut ~[DefId], trait_def_id: DefId, name: Ident) { - debug2!("(adding trait info) found trait {}:{} for method '{}'", + debug!("(adding trait info) found trait {}:{} for method '{}'", trait_def_id.crate, trait_def_id.node, self.session.str_of(name)); @@ -5338,7 +5338,7 @@ impl Resolver { } fn record_def(&mut self, node_id: NodeId, (def, lp): (Def, LastPrivate)) { - debug2!("(recording def) recording {:?} for {:?}, last private {:?}", + debug!("(recording def) recording {:?} for {:?}, last private {:?}", def, node_id, lp); self.last_private.insert(node_id, lp); do self.def_map.insert_or_update_with(node_id, def) |_, old_value| { @@ -5449,15 +5449,15 @@ impl Resolver { } fn dump_module(&mut self, module_: @mut Module) { - debug2!("Dump of module `{}`:", self.module_to_str(module_)); + debug!("Dump of module `{}`:", self.module_to_str(module_)); - debug2!("Children:"); + debug!("Children:"); self.populate_module_if_necessary(module_); for (&name, _) in module_.children.iter() { - debug2!("* {}", interner_get(name)); + debug!("* {}", interner_get(name)); } - debug2!("Import resolutions:"); + debug!("Import resolutions:"); for (name, import_resolution) in module_.import_resolutions.iter() { let value_repr; match import_resolution.target_for_namespace(ValueNS) { @@ -5477,7 +5477,7 @@ impl Resolver { } } - debug2!("* {}:{}{}", interner_get(*name), + debug!("* {}:{}{}", interner_get(*name), value_repr, type_repr); } } diff --git a/src/librustc/middle/stack_check.rs b/src/librustc/middle/stack_check.rs index 1c572b2cbadb..fdb7f1508fb4 100644 --- a/src/librustc/middle/stack_check.rs +++ b/src/librustc/middle/stack_check.rs @@ -123,20 +123,20 @@ fn stack_check_fn<'a>(v: &mut StackCheckVisitor, } }; let new_cx = Context {safe_stack: safe_stack}; - debug2!("stack_check_fn(safe_stack={}, id={:?})", safe_stack, id); + debug!("stack_check_fn(safe_stack={}, id={:?})", safe_stack, id); visit::walk_fn(v, fk, decl, body, sp, id, new_cx); } fn stack_check_expr<'a>(v: &mut StackCheckVisitor, expr: @ast::Expr, cx: Context) { - debug2!("stack_check_expr(safe_stack={}, expr={})", + debug!("stack_check_expr(safe_stack={}, expr={})", cx.safe_stack, expr.repr(v.tcx)); if !cx.safe_stack { match expr.node { ast::ExprCall(callee, _, _) => { let callee_ty = ty::expr_ty(v.tcx, callee); - debug2!("callee_ty={}", callee_ty.repr(v.tcx)); + debug!("callee_ty={}", callee_ty.repr(v.tcx)); match ty::get(callee_ty).sty { ty::ty_bare_fn(ref fty) => { if !fty.abis.is_rust() && !fty.abis.is_intrinsic() { diff --git a/src/librustc/middle/trans/_match.rs b/src/librustc/middle/trans/_match.rs index 89dfa64511f8..6bb41929db1d 100644 --- a/src/librustc/middle/trans/_match.rs +++ b/src/librustc/middle/trans/_match.rs @@ -264,7 +264,7 @@ fn opt_eq(tcx: ty::ctxt, a: &Opt, b: &Opt) -> bool { a_expr = e.unwrap(); } UnitLikeStructLit(_) => { - fail2!("UnitLikeStructLit should have been handled \ + fail!("UnitLikeStructLit should have been handled \ above") } } @@ -277,14 +277,14 @@ fn opt_eq(tcx: ty::ctxt, a: &Opt, b: &Opt) -> bool { b_expr = e.unwrap(); } UnitLikeStructLit(_) => { - fail2!("UnitLikeStructLit should have been handled \ + fail!("UnitLikeStructLit should have been handled \ above") } } match const_eval::compare_lit_exprs(tcx, a_expr, b_expr) { Some(val1) => val1 == 0, - None => fail2!("compare_list_exprs: type mismatch"), + None => fail!("compare_list_exprs: type mismatch"), } } } @@ -294,7 +294,7 @@ fn opt_eq(tcx: ty::ctxt, a: &Opt, b: &Opt) -> bool { let m2 = const_eval::compare_lit_exprs(tcx, a2, b2); match (m1, m2) { (Some(val1), Some(val2)) => (val1 == 0 && val2 == 0), - _ => fail2!("compare_list_exprs: type mismatch"), + _ => fail!("compare_list_exprs: type mismatch"), } } (&var(a, _), &var(b, _)) => a == b, @@ -439,7 +439,7 @@ fn expand_nested_bindings<'r>(bcx: @mut Block, col: uint, val: ValueRef) -> ~[Match<'r>] { - debug2!("expand_nested_bindings(bcx={}, m={}, col={}, val={})", + debug!("expand_nested_bindings(bcx={}, m={}, col={}, val={})", bcx.to_str(), m.repr(bcx.tcx()), col, @@ -486,7 +486,7 @@ fn enter_match<'r>(bcx: @mut Block, val: ValueRef, e: enter_pat) -> ~[Match<'r>] { - debug2!("enter_match(bcx={}, m={}, col={}, val={})", + debug!("enter_match(bcx={}, m={}, col={}, val={})", bcx.to_str(), m.repr(bcx.tcx()), col, @@ -523,7 +523,7 @@ fn enter_match<'r>(bcx: @mut Block, } } - debug2!("result={}", result.repr(bcx.tcx())); + debug!("result={}", result.repr(bcx.tcx())); return result; } @@ -535,7 +535,7 @@ fn enter_default<'r>(bcx: @mut Block, val: ValueRef, chk: FailureHandler) -> ~[Match<'r>] { - debug2!("enter_default(bcx={}, m={}, col={}, val={})", + debug!("enter_default(bcx={}, m={}, col={}, val={})", bcx.to_str(), m.repr(bcx.tcx()), col, @@ -605,7 +605,7 @@ fn enter_opt<'r>(bcx: @mut Block, variant_size: uint, val: ValueRef) -> ~[Match<'r>] { - debug2!("enter_opt(bcx={}, m={}, opt={:?}, col={}, val={})", + debug!("enter_opt(bcx={}, m={}, opt={:?}, col={}, val={})", bcx.to_str(), m.repr(bcx.tcx()), *opt, @@ -741,7 +741,7 @@ fn enter_rec_or_struct<'r>(bcx: @mut Block, fields: &[ast::Ident], val: ValueRef) -> ~[Match<'r>] { - debug2!("enter_rec_or_struct(bcx={}, m={}, col={}, val={})", + debug!("enter_rec_or_struct(bcx={}, m={}, col={}, val={})", bcx.to_str(), m.repr(bcx.tcx()), col, @@ -776,7 +776,7 @@ fn enter_tup<'r>(bcx: @mut Block, val: ValueRef, n_elts: uint) -> ~[Match<'r>] { - debug2!("enter_tup(bcx={}, m={}, col={}, val={})", + debug!("enter_tup(bcx={}, m={}, col={}, val={})", bcx.to_str(), m.repr(bcx.tcx()), col, @@ -802,7 +802,7 @@ fn enter_tuple_struct<'r>(bcx: @mut Block, val: ValueRef, n_elts: uint) -> ~[Match<'r>] { - debug2!("enter_tuple_struct(bcx={}, m={}, col={}, val={})", + debug!("enter_tuple_struct(bcx={}, m={}, col={}, val={})", bcx.to_str(), m.repr(bcx.tcx()), col, @@ -827,7 +827,7 @@ fn enter_box<'r>(bcx: @mut Block, col: uint, val: ValueRef) -> ~[Match<'r>] { - debug2!("enter_box(bcx={}, m={}, col={}, val={})", + debug!("enter_box(bcx={}, m={}, col={}, val={})", bcx.to_str(), m.repr(bcx.tcx()), col, @@ -854,7 +854,7 @@ fn enter_uniq<'r>(bcx: @mut Block, col: uint, val: ValueRef) -> ~[Match<'r>] { - debug2!("enter_uniq(bcx={}, m={}, col={}, val={})", + debug!("enter_uniq(bcx={}, m={}, col={}, val={})", bcx.to_str(), m.repr(bcx.tcx()), col, @@ -881,7 +881,7 @@ fn enter_region<'r>(bcx: @mut Block, col: uint, val: ValueRef) -> ~[Match<'r>] { - debug2!("enter_region(bcx={}, m={}, col={}, val={})", + debug!("enter_region(bcx={}, m={}, col={}, val={})", bcx.to_str(), m.repr(bcx.tcx()), col, @@ -1225,7 +1225,7 @@ impl FailureHandler { fn handle_fail(&self) -> BasicBlockRef { match *self { Infallible => { - fail2!("attempted to fail in infallible failure handler!") + fail!("attempted to fail in infallible failure handler!") } JumpToBasicBlock(basic_block) => basic_block, CustomFailureHandlerClass(custom_failure_handler) => { @@ -1376,7 +1376,7 @@ fn insert_lllocals(bcx: @mut Block, } }; - debug2!("binding {:?} to {}", binding_info.id, bcx.val_to_str(llval)); + debug!("binding {:?} to {}", binding_info.id, bcx.val_to_str(llval)); llmap.insert(binding_info.id, llval); if bcx.sess().opts.extra_debuginfo { @@ -1397,7 +1397,7 @@ fn compile_guard(bcx: @mut Block, vals: &[ValueRef], chk: FailureHandler) -> @mut Block { - debug2!("compile_guard(bcx={}, guard_expr={}, m={}, vals={})", + debug!("compile_guard(bcx={}, guard_expr={}, m={}, vals={})", bcx.to_str(), bcx.expr_to_str(guard_expr), m.repr(bcx.tcx()), @@ -1451,7 +1451,7 @@ fn compile_submatch(bcx: @mut Block, m: &[Match], vals: &[ValueRef], chk: FailureHandler) { - debug2!("compile_submatch(bcx={}, m={}, vals={})", + debug!("compile_submatch(bcx={}, m={}, vals={})", bcx.to_str(), m.repr(bcx.tcx()), vec_map_to_str(vals, |v| bcx.val_to_str(*v))); @@ -1617,7 +1617,7 @@ fn compile_submatch_continue(mut bcx: @mut Block, // Decide what kind of branch we need let opts = get_options(bcx, m, col); - debug2!("options={:?}", opts); + debug!("options={:?}", opts); let mut kind = no_branch; let mut test_val = val; if opts.len() > 0u { @@ -2104,7 +2104,7 @@ fn bind_irrefutable_pat(bcx: @mut Block, * - binding_mode: is this for an argument or a local variable? */ - debug2!("bind_irrefutable_pat(bcx={}, pat={}, binding_mode={:?})", + debug!("bind_irrefutable_pat(bcx={}, pat={}, binding_mode={:?})", bcx.to_str(), pat.repr(bcx.tcx()), binding_mode); diff --git a/src/librustc/middle/trans/adt.rs b/src/librustc/middle/trans/adt.rs index ce789ee7ab65..5e64dc5c2e26 100644 --- a/src/librustc/middle/trans/adt.rs +++ b/src/librustc/middle/trans/adt.rs @@ -113,13 +113,13 @@ pub fn represent_node(bcx: @mut Block, node: ast::NodeId) -> @Repr { /// Decides how to represent a given type. pub fn represent_type(cx: &mut CrateContext, t: ty::t) -> @Repr { - debug2!("Representing: {}", ty_to_str(cx.tcx, t)); + debug!("Representing: {}", ty_to_str(cx.tcx, t)); match cx.adt_reprs.find(&t) { Some(repr) => return *repr, None => { } } let repr = @represent_type_uncached(cx, t); - debug2!("Represented as: {:?}", repr) + debug!("Represented as: {:?}", repr) cx.adt_reprs.insert(t, repr); return repr; } diff --git a/src/librustc/middle/trans/asm.rs b/src/librustc/middle/trans/asm.rs index cfeefc8642c7..7f809451b35f 100644 --- a/src/librustc/middle/trans/asm.rs +++ b/src/librustc/middle/trans/asm.rs @@ -85,7 +85,7 @@ pub fn trans_inline_asm(bcx: @mut Block, ia: &ast::inline_asm) -> @mut Block { constraints.push_str(clobbers); } - debug2!("Asm Constraints: {:?}", constraints); + debug!("Asm Constraints: {:?}", constraints); let numOutputs = outputs.len(); diff --git a/src/librustc/middle/trans/base.rs b/src/librustc/middle/trans/base.rs index 6cb63f9e1a16..df7b09f9db79 100644 --- a/src/librustc/middle/trans/base.rs +++ b/src/librustc/middle/trans/base.rs @@ -122,7 +122,7 @@ impl Drop for _InsnCtxt { } pub fn push_ctxt(s: &'static str) -> _InsnCtxt { - debug2!("new InsnCtxt: {}", s); + debug!("new InsnCtxt: {}", s); do local_data::modify(task_local_insn_key) |c| { do c.map |mut ctx| { ctx.push(s); @@ -379,7 +379,7 @@ pub fn malloc_raw_dyn(bcx: @mut Block, (ty::mk_imm_box, require_alloc_fn(bcx, t, ClosureExchangeMallocFnLangItem)) } - _ => fail2!("heap_exchange already handled") + _ => fail!("heap_exchange already handled") }; // Grab the TypeRef type of box_ptr_ty. @@ -911,18 +911,18 @@ pub fn invoke(bcx: @mut Block, llfn: ValueRef, llargs: ~[ValueRef], } match bcx.node_info { - None => debug2!("invoke at ???"), + None => debug!("invoke at ???"), Some(node_info) => { - debug2!("invoke at {}", + debug!("invoke at {}", bcx.sess().codemap.span_to_str(node_info.span)); } } if need_invoke(bcx) { unsafe { - debug2!("invoking {} at {}", llfn, bcx.llbb); + debug!("invoking {} at {}", llfn, bcx.llbb); for &llarg in llargs.iter() { - debug2!("arg: {}", llarg); + debug!("arg: {}", llarg); } } let normal_bcx = sub_block(bcx, "normal return"); @@ -935,9 +935,9 @@ pub fn invoke(bcx: @mut Block, llfn: ValueRef, llargs: ~[ValueRef], return (llresult, normal_bcx); } else { unsafe { - debug2!("calling {} at {}", llfn, bcx.llbb); + debug!("calling {} at {}", llfn, bcx.llbb); for &llarg in llargs.iter() { - debug2!("arg: {}", llarg); + debug!("arg: {}", llarg); } } let llresult = Call(bcx, llfn, llargs, attributes); @@ -1157,7 +1157,7 @@ pub fn ignore_lhs(_bcx: @mut Block, local: &ast::Local) -> bool { pub fn init_local(bcx: @mut Block, local: &ast::Local) -> @mut Block { - debug2!("init_local(bcx={}, local.id={:?})", + debug!("init_local(bcx={}, local.id={:?})", bcx.to_str(), local.id); let _indenter = indenter(); @@ -1178,7 +1178,7 @@ pub fn init_local(bcx: @mut Block, local: &ast::Local) -> @mut Block { pub fn trans_stmt(cx: @mut Block, s: &ast::Stmt) -> @mut Block { let _icx = push_ctxt("trans_stmt"); - debug2!("trans_stmt({})", stmt_to_str(s, cx.tcx().sess.intr())); + debug!("trans_stmt({})", stmt_to_str(s, cx.tcx().sess.intr())); if cx.sess().asm_comments() { add_span_comment(cx, s.span, stmt_to_str(s, cx.ccx().sess.intr())); @@ -1341,7 +1341,7 @@ pub fn cleanup_and_leave(bcx: @mut Block, let mut bcx = bcx; let is_lpad = leave == None; loop { - debug2!("cleanup_and_leave: leaving {}", cur.to_str()); + debug!("cleanup_and_leave: leaving {}", cur.to_str()); if bcx.sess().trace() { trans_trace( @@ -1415,7 +1415,7 @@ pub fn cleanup_block(bcx: @mut Block, upto: Option) -> @mut Block let mut cur = bcx; let mut bcx = bcx; loop { - debug2!("cleanup_block: {}", cur.to_str()); + debug!("cleanup_block: {}", cur.to_str()); if bcx.sess().trace() { trans_trace( @@ -1465,7 +1465,7 @@ pub fn with_scope(bcx: @mut Block, f: &fn(@mut Block) -> @mut Block) -> @mut Block { let _icx = push_ctxt("with_scope"); - debug2!("with_scope(bcx={}, opt_node_info={:?}, name={})", + debug!("with_scope(bcx={}, opt_node_info={:?}, name={})", bcx.to_str(), opt_node_info, name); let _indenter = indenter(); @@ -1684,7 +1684,7 @@ pub fn new_fn_ctxt_w_id(ccx: @mut CrateContext, -> @mut FunctionContext { for p in param_substs.iter() { p.validate(); } - debug2!("new_fn_ctxt_w_id(path={}, id={:?}, \ + debug!("new_fn_ctxt_w_id(path={}, id={:?}, \ param_substs={})", path_str(ccx.sess, path), id, @@ -1798,7 +1798,7 @@ pub fn copy_args_to_allocas(fcx: @mut FunctionContext, args: &[ast::arg], raw_llargs: &[ValueRef], arg_tys: &[ty::t]) -> @mut Block { - debug2!("copy_args_to_allocas: raw_llargs={} arg_tys={}", + debug!("copy_args_to_allocas: raw_llargs={} arg_tys={}", raw_llargs.llrepr(fcx.ccx), arg_tys.repr(fcx.ccx.tcx)); @@ -1922,7 +1922,7 @@ pub fn trans_closure(ccx: @mut CrateContext, let _icx = push_ctxt("trans_closure"); set_uwtable(llfndecl); - debug2!("trans_closure(..., param_substs={})", + debug!("trans_closure(..., param_substs={})", param_substs.repr(ccx.tcx)); let fcx = new_fn_ctxt_w_id(ccx, @@ -2002,7 +2002,7 @@ pub fn trans_fn(ccx: @mut CrateContext, let the_path_str = path_str(ccx.sess, path); let _s = StatRecorder::new(ccx, the_path_str); - debug2!("trans_fn(self_arg={:?}, param_substs={})", + debug!("trans_fn(self_arg={:?}, param_substs={})", self_arg, param_substs.repr(ccx.tcx)); let _icx = push_ctxt("trans_fn"); @@ -2038,7 +2038,7 @@ fn insert_synthetic_type_entries(bcx: @mut Block, let tcx = bcx.tcx(); for i in range(0u, fn_args.len()) { - debug2!("setting type of argument {} (pat node {}) to {}", + debug!("setting type of argument {} (pat node {}) to {}", i, fn_args[i].pat.id, bcx.ty_to_str(arg_tys[i])); let pat_id = fn_args[i].pat.id; @@ -2214,7 +2214,7 @@ pub fn trans_item(ccx: @mut CrateContext, item: &ast::item) { let path = match ccx.tcx.items.get_copy(&item.id) { ast_map::node_item(_, p) => p, // tjc: ? - _ => fail2!("trans_item"), + _ => fail!("trans_item"), }; match item.node { ast::item_fn(ref decl, purity, _abis, ref generics, ref body) => { @@ -2357,7 +2357,7 @@ pub fn register_fn(ccx: @mut CrateContext, assert!(f.abis.is_rust() || f.abis.is_intrinsic()); f } - _ => fail2!("expected bare rust fn or an intrinsic") + _ => fail!("expected bare rust fn or an intrinsic") }; let llfn = decl_rust_fn(ccx, f.sig.inputs, f.sig.output, sym); @@ -2373,7 +2373,7 @@ pub fn register_fn_llvmty(ccx: @mut CrateContext, cc: lib::llvm::CallConv, fn_ty: Type) -> ValueRef { - debug2!("register_fn_fuller creating fn for item {} with path {}", + debug!("register_fn_fuller creating fn for item {} with path {}", node_id, ast_map::path_to_str(item_path(ccx, &node_id), token::get_ident_interner())); @@ -2452,7 +2452,7 @@ pub fn create_entry_wrapper(ccx: @mut CrateContext, }; (start_fn, args) } else { - debug2!("using user-defined start fn"); + debug!("using user-defined start fn"); let args = ~[ C_null(Type::opaque_box(ccx).ptr_to()), llvm::LLVMGetParam(llfn, 0 as c_uint), @@ -2500,7 +2500,7 @@ fn exported_name(ccx: &mut CrateContext, path: path, ty: ty::t, attrs: &[ast::At } pub fn get_item_val(ccx: @mut CrateContext, id: ast::NodeId) -> ValueRef { - debug2!("get_item_val(id=`{:?}`)", id); + debug!("get_item_val(id=`{:?}`)", id); let val = ccx.item_vals.find_copy(&id); match val { @@ -2522,10 +2522,10 @@ pub fn get_item_val(ccx: @mut CrateContext, id: ast::NodeId) -> ValueRef { // we need to get the symbol from csearch instead of // using the current crate's name/version // information in the hash of the symbol - debug2!("making {}", sym); + debug!("making {}", sym); let sym = match ccx.external_srcs.find(&i.id) { Some(&did) => { - debug2!("but found in other crate..."); + debug!("but found in other crate..."); csearch::get_symbol(ccx.sess.cstore, did) } None => sym @@ -2575,7 +2575,7 @@ pub fn get_item_val(ccx: @mut CrateContext, id: ast::NodeId) -> ValueRef { } if !inlineable { - debug2!("{} not inlined", sym); + debug!("{} not inlined", sym); ccx.non_inlineable_statics.insert(id); } ccx.item_symbols.insert(i.id, sym); @@ -2596,7 +2596,7 @@ pub fn get_item_val(ccx: @mut CrateContext, id: ast::NodeId) -> ValueRef { llfn } - _ => fail2!("get_item_val: weird result in table") + _ => fail!("get_item_val: weird result in table") }; match (attr::first_attr_value_str_by_name(i.attrs, "link_section")) { @@ -2612,7 +2612,7 @@ pub fn get_item_val(ccx: @mut CrateContext, id: ast::NodeId) -> ValueRef { } ast_map::node_trait_method(trait_method, _, pth) => { - debug2!("get_item_val(): processing a node_trait_method"); + debug!("get_item_val(): processing a node_trait_method"); match *trait_method { ast::required(_) => { ccx.sess.bug("unexpected variant: required trait method in \ @@ -2669,11 +2669,11 @@ pub fn get_item_val(ccx: @mut CrateContext, id: ast::NodeId) -> ValueRef { ast::item_enum(_, _) => { register_fn(ccx, (*v).span, sym, id, ty) } - _ => fail2!("node_variant, shouldn't happen") + _ => fail!("node_variant, shouldn't happen") }; } ast::struct_variant_kind(_) => { - fail2!("struct variant kind unexpected in get_item_val") + fail!("struct variant kind unexpected in get_item_val") } } set_inline_hint(llfn); diff --git a/src/librustc/middle/trans/build.rs b/src/librustc/middle/trans/build.rs index 1754741a1f4f..2042c6ddad10 100644 --- a/src/librustc/middle/trans/build.rs +++ b/src/librustc/middle/trans/build.rs @@ -29,7 +29,7 @@ pub fn terminate(cx: &mut Block, _: &str) { pub fn check_not_terminated(cx: &Block) { if cx.terminated { - fail2!("already terminated!"); + fail!("already terminated!"); } } @@ -117,7 +117,7 @@ pub fn Invoke(cx: @mut Block, } check_not_terminated(cx); terminate(cx, "Invoke"); - debug2!("Invoke({} with arguments ({}))", + debug!("Invoke({} with arguments ({}))", cx.val_to_str(Fn), Args.map(|a| cx.val_to_str(*a)).connect(", ")); B(cx).invoke(Fn, Args, Then, Catch, attributes) diff --git a/src/librustc/middle/trans/builder.rs b/src/librustc/middle/trans/builder.rs index febe4de730da..27b1e6b39dc1 100644 --- a/src/librustc/middle/trans/builder.rs +++ b/src/librustc/middle/trans/builder.rs @@ -476,7 +476,7 @@ impl Builder { } pub fn store(&self, val: ValueRef, ptr: ValueRef) { - debug2!("Store {} -> {}", + debug!("Store {} -> {}", self.ccx.tn.val_to_str(val), self.ccx.tn.val_to_str(ptr)); assert!(is_not_null(self.llbuilder)); @@ -487,7 +487,7 @@ impl Builder { } pub fn atomic_store(&self, val: ValueRef, ptr: ValueRef, order: AtomicOrdering) { - debug2!("Store {} -> {}", + debug!("Store {} -> {}", self.ccx.tn.val_to_str(val), self.ccx.tn.val_to_str(ptr)); self.count_insn("store.atomic"); @@ -726,7 +726,7 @@ impl Builder { pub fn add_span_comment(&self, sp: Span, text: &str) { if self.ccx.sess.asm_comments() { let s = format!("{} ({})", text, self.ccx.sess.codemap.span_to_str(sp)); - debug2!("{}", s); + debug!("{}", s); self.add_comment(s); } } @@ -758,11 +758,11 @@ impl Builder { else { lib::llvm::False }; let argtys = do inputs.map |v| { - debug2!("Asm Input Type: {:?}", self.ccx.tn.val_to_str(*v)); + debug!("Asm Input Type: {:?}", self.ccx.tn.val_to_str(*v)); val_ty(*v) }; - debug2!("Asm Output Type: {:?}", self.ccx.tn.type_to_str(output)); + debug!("Asm Output Type: {:?}", self.ccx.tn.type_to_str(output)); let fty = Type::func(argtys, &output); unsafe { let v = llvm::LLVMInlineAsm( diff --git a/src/librustc/middle/trans/cabi_arm.rs b/src/librustc/middle/trans/cabi_arm.rs index 5add2250038f..736feeb0618a 100644 --- a/src/librustc/middle/trans/cabi_arm.rs +++ b/src/librustc/middle/trans/cabi_arm.rs @@ -51,7 +51,7 @@ fn ty_align(ty: Type) -> uint { let elt = ty.element_type(); ty_align(elt) } - _ => fail2!("ty_align: unhandled type") + _ => fail!("ty_align: unhandled type") } } @@ -81,7 +81,7 @@ fn ty_size(ty: Type) -> uint { let eltsz = ty_size(elt); len * eltsz } - _ => fail2!("ty_size: unhandled type") + _ => fail!("ty_size: unhandled type") } } diff --git a/src/librustc/middle/trans/cabi_mips.rs b/src/librustc/middle/trans/cabi_mips.rs index 3f2d18ddbe2f..e98618c4e010 100644 --- a/src/librustc/middle/trans/cabi_mips.rs +++ b/src/librustc/middle/trans/cabi_mips.rs @@ -51,7 +51,7 @@ fn ty_align(ty: Type) -> uint { let elt = ty.element_type(); ty_align(elt) } - _ => fail2!("ty_size: unhandled type") + _ => fail!("ty_size: unhandled type") } } @@ -81,7 +81,7 @@ fn ty_size(ty: Type) -> uint { let eltsz = ty_size(elt); len * eltsz } - _ => fail2!("ty_size: unhandled type") + _ => fail!("ty_size: unhandled type") } } diff --git a/src/librustc/middle/trans/cabi_x86_64.rs b/src/librustc/middle/trans/cabi_x86_64.rs index b35ffe5c965d..1e22c46dd5db 100644 --- a/src/librustc/middle/trans/cabi_x86_64.rs +++ b/src/librustc/middle/trans/cabi_x86_64.rs @@ -112,7 +112,7 @@ fn classify_ty(ty: Type) -> ~[RegClass] { let elt = ty.element_type(); ty_align(elt) } - _ => fail2!("ty_size: unhandled type") + _ => fail!("ty_size: unhandled type") } } @@ -141,7 +141,7 @@ fn classify_ty(ty: Type) -> ~[RegClass] { let eltsz = ty_size(elt); len * eltsz } - _ => fail2!("ty_size: unhandled type") + _ => fail!("ty_size: unhandled type") } } @@ -232,7 +232,7 @@ fn classify_ty(ty: Type) -> ~[RegClass] { i += 1u; } } - _ => fail2!("classify: unhandled type") + _ => fail!("classify: unhandled type") } } @@ -325,7 +325,7 @@ fn llreg_ty(cls: &[RegClass]) -> Type { SSEDs => { tys.push(Type::f64()); } - _ => fail2!("llregtype: unhandled class") + _ => fail!("llregtype: unhandled class") } i += 1u; } diff --git a/src/librustc/middle/trans/callee.rs b/src/librustc/middle/trans/callee.rs index 839313f7bbe6..7a3a67b35ee1 100644 --- a/src/librustc/middle/trans/callee.rs +++ b/src/librustc/middle/trans/callee.rs @@ -79,7 +79,7 @@ pub struct Callee { pub fn trans(bcx: @mut Block, expr: &ast::Expr) -> Callee { let _icx = push_ctxt("trans_callee"); - debug2!("callee::trans(expr={})", expr.repr(bcx.tcx())); + debug!("callee::trans(expr={})", expr.repr(bcx.tcx())); // pick out special kinds of expressions that can be called: match expr.node { @@ -180,7 +180,7 @@ pub fn trans_fn_ref(bcx: @mut Block, let type_params = node_id_type_params(bcx, ref_id); let vtables = node_vtables(bcx, ref_id); - debug2!("trans_fn_ref(def_id={}, ref_id={:?}, type_params={}, vtables={})", + debug!("trans_fn_ref(def_id={}, ref_id={:?}, type_params={}, vtables={})", def_id.repr(bcx.tcx()), ref_id, type_params.repr(bcx.tcx()), vtables.repr(bcx.tcx())); trans_fn_ref_with_vtables(bcx, def_id, ref_id, type_params, vtables) @@ -266,7 +266,7 @@ pub fn trans_fn_ref_with_vtables( let ccx = bcx.ccx(); let tcx = ccx.tcx; - debug2!("trans_fn_ref_with_vtables(bcx={}, def_id={}, ref_id={:?}, \ + debug!("trans_fn_ref_with_vtables(bcx={}, def_id={}, ref_id={:?}, \ type_params={}, vtables={})", bcx.to_str(), def_id.repr(bcx.tcx()), @@ -329,7 +329,7 @@ pub fn trans_fn_ref_with_vtables( resolve_default_method_vtables(bcx, impl_id, method, &substs, vtables); - debug2!("trans_fn_with_vtables - default method: \ + debug!("trans_fn_with_vtables - default method: \ substs = {}, trait_subst = {}, \ first_subst = {}, new_subst = {}, \ vtables = {}, \ @@ -472,7 +472,7 @@ pub fn trans_method_call(in_cx: @mut Block, dest: expr::Dest) -> @mut Block { let _icx = push_ctxt("trans_method_call"); - debug2!("trans_method_call(call_ex={}, rcvr={})", + debug!("trans_method_call(call_ex={}, rcvr={})", call_ex.repr(in_cx.tcx()), rcvr.repr(in_cx.tcx())); trans_call_inner( @@ -483,7 +483,7 @@ pub fn trans_method_call(in_cx: @mut Block, |cx| { match cx.ccx().maps.method_map.find_copy(&call_ex.id) { Some(origin) => { - debug2!("origin for {}: {}", + debug!("origin for {}: {}", call_ex.repr(in_cx.tcx()), origin.repr(in_cx.tcx())); @@ -562,7 +562,7 @@ pub fn trans_lang_call_with_type_params(bcx: @mut Block, substituted); new_llval = PointerCast(callee.bcx, fn_data.llfn, llfnty); } - _ => fail2!() + _ => fail!() } Callee { bcx: callee.bcx, data: Fn(FnData { llfn: new_llval }) } }, @@ -840,7 +840,7 @@ pub fn trans_arg_expr(bcx: @mut Block, let _icx = push_ctxt("trans_arg_expr"); let ccx = bcx.ccx(); - debug2!("trans_arg_expr(formal_arg_ty=({}), self_mode={:?}, arg_expr={})", + debug!("trans_arg_expr(formal_arg_ty=({}), self_mode={:?}, arg_expr={})", formal_arg_ty.repr(bcx.tcx()), self_mode, arg_expr.repr(bcx.tcx())); @@ -850,7 +850,7 @@ pub fn trans_arg_expr(bcx: @mut Block, let arg_datum = arg_datumblock.datum; let bcx = arg_datumblock.bcx; - debug2!(" arg datum: {}", arg_datum.to_str(bcx.ccx())); + debug!(" arg datum: {}", arg_datum.to_str(bcx.ccx())); let mut val; if ty::type_is_bot(arg_datum.ty) { @@ -890,11 +890,11 @@ pub fn trans_arg_expr(bcx: @mut Block, val = match self_mode { ty::ByRef => { - debug2!("by ref arg with type {}", bcx.ty_to_str(arg_datum.ty)); + debug!("by ref arg with type {}", bcx.ty_to_str(arg_datum.ty)); arg_datum.to_ref_llval(bcx) } ty::ByCopy => { - debug2!("by copy arg with type {}", bcx.ty_to_str(arg_datum.ty)); + debug!("by copy arg with type {}", bcx.ty_to_str(arg_datum.ty)); arg_datum.to_appropriate_llval(bcx) } } @@ -904,12 +904,12 @@ pub fn trans_arg_expr(bcx: @mut Block, if formal_arg_ty != arg_datum.ty { // this could happen due to e.g. subtyping let llformal_arg_ty = type_of::type_of_explicit_arg(ccx, formal_arg_ty); - debug2!("casting actual type ({}) to match formal ({})", + debug!("casting actual type ({}) to match formal ({})", bcx.val_to_str(val), bcx.llty_str(llformal_arg_ty)); val = PointerCast(bcx, val, llformal_arg_ty); } } - debug2!("--- trans_arg_expr passing {}", bcx.val_to_str(val)); + debug!("--- trans_arg_expr passing {}", bcx.val_to_str(val)); return rslt(bcx, val); } diff --git a/src/librustc/middle/trans/closure.rs b/src/librustc/middle/trans/closure.rs index 875be5d3af54..f036f922de9c 100644 --- a/src/librustc/middle/trans/closure.rs +++ b/src/librustc/middle/trans/closure.rs @@ -151,7 +151,7 @@ pub fn mk_closure_tys(tcx: ty::ctxt, } }); let cdata_ty = ty::mk_tup(tcx, bound_tys); - debug2!("cdata_ty={}", ty_to_str(tcx, cdata_ty)); + debug!("cdata_ty={}", ty_to_str(tcx, cdata_ty)); return cdata_ty; } @@ -224,12 +224,12 @@ pub fn store_environment(bcx: @mut Block, let Result {bcx: bcx, val: llbox} = allocate_cbox(bcx, sigil, cdata_ty); let llbox = PointerCast(bcx, llbox, llboxptr_ty); - debug2!("tuplify_box_ty = {}", ty_to_str(tcx, cbox_ty)); + debug!("tuplify_box_ty = {}", ty_to_str(tcx, cbox_ty)); // Copy expr values into boxed bindings. let mut bcx = bcx; for (i, bv) in bound_values.iter().enumerate() { - debug2!("Copy {} into closure", bv.to_str(ccx)); + debug!("Copy {} into closure", bv.to_str(ccx)); if ccx.sess.asm_comments() { add_comment(bcx, format!("Copy {} into closure", @@ -268,7 +268,7 @@ pub fn build_closure(bcx0: @mut Block, // Package up the captured upvars let mut env_vals = ~[]; for cap_var in cap_vars.iter() { - debug2!("Building closure: captured variable {:?}", *cap_var); + debug!("Building closure: captured variable {:?}", *cap_var); let datum = expr::trans_local_var(bcx, cap_var.def); match cap_var.mode { moves::CapRef => { @@ -384,7 +384,7 @@ pub fn trans_expr_fn(bcx: @mut Block, let fty = node_id_type(bcx, outer_id); let f = match ty::get(fty).sty { ty::ty_closure(ref f) => f, - _ => fail2!("expected closure") + _ => fail!("expected closure") }; let sub_path = vec::append_one(bcx.fcx.path.clone(), diff --git a/src/librustc/middle/trans/common.rs b/src/librustc/middle/trans/common.rs index 6c665f6f6fea..bfea123939a4 100644 --- a/src/librustc/middle/trans/common.rs +++ b/src/librustc/middle/trans/common.rs @@ -449,7 +449,7 @@ pub fn add_clean(bcx: @mut Block, val: ValueRef, t: ty::t) { return } - debug2!("add_clean({}, {}, {})", bcx.to_str(), bcx.val_to_str(val), t.repr(bcx.tcx())); + debug!("add_clean({}, {}, {})", bcx.to_str(), bcx.val_to_str(val), t.repr(bcx.tcx())); let cleanup_type = cleanup_type(bcx.tcx(), t); do in_scope_cx(bcx, None) |scope_info| { @@ -464,7 +464,7 @@ pub fn add_clean(bcx: @mut Block, val: ValueRef, t: ty::t) { pub fn add_clean_temp_immediate(cx: @mut Block, val: ValueRef, ty: ty::t) { if !ty::type_needs_drop(cx.tcx(), ty) { return; } - debug2!("add_clean_temp_immediate({}, {}, {})", + debug!("add_clean_temp_immediate({}, {}, {})", cx.to_str(), cx.val_to_str(val), ty.repr(cx.tcx())); let cleanup_type = cleanup_type(cx.tcx(), ty); @@ -493,7 +493,7 @@ pub fn add_clean_temp_mem_in_scope(bcx: @mut Block, pub fn add_clean_temp_mem_in_scope_(bcx: @mut Block, scope_id: Option, val: ValueRef, t: ty::t) { if !ty::type_needs_drop(bcx.tcx(), t) { return; } - debug2!("add_clean_temp_mem({}, {}, {})", + debug!("add_clean_temp_mem({}, {}, {})", bcx.to_str(), bcx.val_to_str(val), t.repr(bcx.tcx())); let cleanup_type = cleanup_type(bcx.tcx(), t); @@ -522,7 +522,7 @@ pub fn add_clean_return_to_mut(bcx: @mut Block, //! box was frozen initially. Here, both `frozen_val_ref` and //! `bits_val_ref` are in fact pointers to stack slots. - debug2!("add_clean_return_to_mut({}, {}, {})", + debug!("add_clean_return_to_mut({}, {}, {})", bcx.to_str(), bcx.val_to_str(frozen_val_ref), bcx.val_to_str(bits_val_ref)); @@ -776,7 +776,7 @@ pub fn in_scope_cx(cx: @mut Block, scope_id: Option, f: &fn(si: &mu Some(inf) => match scope_id { Some(wanted) => match inf.node_info { Some(NodeInfo { id: actual, _ }) if wanted == actual => { - debug2!("in_scope_cx: selected cur={} (cx={})", + debug!("in_scope_cx: selected cur={} (cx={})", cur.to_str(), cx.to_str()); f(inf); return; @@ -784,7 +784,7 @@ pub fn in_scope_cx(cx: @mut Block, scope_id: Option, f: &fn(si: &mu _ => inf.parent, }, None => { - debug2!("in_scope_cx: selected cur={} (cx={})", + debug!("in_scope_cx: selected cur={} (cx={})", cur.to_str(), cx.to_str()); f(inf); return; @@ -987,7 +987,7 @@ pub fn const_get_elt(cx: &CrateContext, v: ValueRef, us: &[c_uint]) llvm::LLVMConstExtractValue(v, p, len as c_uint) }; - debug2!("const_get_elt(v={}, us={:?}, r={})", + debug!("const_get_elt(v={}, us={:?}, r={})", cx.tn.val_to_str(v), us, cx.tn.val_to_str(r)); return r; @@ -1230,7 +1230,7 @@ pub fn find_vtable(tcx: ty::ctxt, n_param: typeck::param_index, n_bound: uint) -> typeck::vtable_origin { - debug2!("find_vtable(n_param={:?}, n_bound={}, ps={})", + debug!("find_vtable(n_param={:?}, n_bound={}, ps={})", n_param, n_bound, ps.repr(tcx)); let param_bounds = match n_param { diff --git a/src/librustc/middle/trans/context.rs b/src/librustc/middle/trans/context.rs index 2b473d2b6e17..219307786568 100644 --- a/src/librustc/middle/trans/context.rs +++ b/src/librustc/middle/trans/context.rs @@ -245,7 +245,7 @@ impl CrateContext { pub fn const_inbounds_gepi(&self, pointer: ValueRef, indices: &[uint]) -> ValueRef { - debug2!("const_inbounds_gepi: pointer={} indices={:?}", + debug!("const_inbounds_gepi: pointer={} indices={:?}", self.tn.val_to_str(pointer), indices); let v: ~[ValueRef] = indices.iter().map(|i| C_i32(*i as i32)).collect(); diff --git a/src/librustc/middle/trans/controlflow.rs b/src/librustc/middle/trans/controlflow.rs index 105cb6e5606d..ec00f1443082 100644 --- a/src/librustc/middle/trans/controlflow.rs +++ b/src/librustc/middle/trans/controlflow.rs @@ -50,7 +50,7 @@ pub fn trans_if(bcx: @mut Block, els: Option<@ast::Expr>, dest: expr::Dest) -> @mut Block { - debug2!("trans_if(bcx={}, cond={}, thn={:?}, dest={})", + debug!("trans_if(bcx={}, cond={}, thn={:?}, dest={})", bcx.to_str(), bcx.expr_to_str(cond), thn.id, dest.to_str(bcx.ccx())); let _indenter = indenter(); @@ -119,7 +119,7 @@ pub fn trans_if(bcx: @mut Block, } }; - debug2!("then_bcx_in={}, else_bcx_in={}", + debug!("then_bcx_in={}, else_bcx_in={}", then_bcx_in.to_str(), else_bcx_in.to_str()); CondBr(bcx, cond_val, then_bcx_in.llbb, else_bcx_in.llbb); diff --git a/src/librustc/middle/trans/datum.rs b/src/librustc/middle/trans/datum.rs index 294f3379f84f..d57c24e37d57 100644 --- a/src/librustc/middle/trans/datum.rs +++ b/src/librustc/middle/trans/datum.rs @@ -242,7 +242,7 @@ impl Datum { action: CopyAction, datum: Datum) -> @mut Block { - debug2!("store_to_datum(self={}, action={:?}, datum={})", + debug!("store_to_datum(self={}, action={:?}, datum={})", self.to_str(bcx.ccx()), action, datum.to_str(bcx.ccx())); assert!(datum.mode.is_by_ref()); self.store_to(bcx, action, datum.val) @@ -275,7 +275,7 @@ impl Datum { return bcx; } - debug2!("copy_to(self={}, action={:?}, dst={})", + debug!("copy_to(self={}, action={:?}, dst={})", self.to_str(bcx.ccx()), action, bcx.val_to_str(dst)); // Watch out for the case where we are writing the copying the @@ -340,7 +340,7 @@ impl Datum { let _icx = push_ctxt("move_to"); let mut bcx = bcx; - debug2!("move_to(self={}, action={:?}, dst={})", + debug!("move_to(self={}, action={:?}, dst={})", self.to_str(bcx.ccx()), action, bcx.val_to_str(dst)); if ty::type_is_voidish(bcx.tcx(), self.ty) { @@ -607,7 +607,7 @@ impl Datum { -> (Option, @mut Block) { let ccx = bcx.ccx(); - debug2!("try_deref(expr_id={:?}, derefs={:?}, is_auto={}, self={:?})", + debug!("try_deref(expr_id={:?}, derefs={:?}, is_auto={}, self={:?})", expr_id, derefs, is_auto, self.to_str(bcx.ccx())); let bcx = @@ -732,7 +732,7 @@ impl Datum { -> DatumBlock { let _icx = push_ctxt("autoderef"); - debug2!("autoderef(expr_id={}, max={:?}, self={:?})", + debug!("autoderef(expr_id={}, max={:?}, self={:?})", expr_id, max, self.to_str(bcx.ccx())); let _indenter = indenter(); diff --git a/src/librustc/middle/trans/debuginfo.rs b/src/librustc/middle/trans/debuginfo.rs index 7ccca6df000f..2138afd2e9bb 100644 --- a/src/librustc/middle/trans/debuginfo.rs +++ b/src/librustc/middle/trans/debuginfo.rs @@ -146,7 +146,7 @@ pub struct CrateDebugContext { impl CrateDebugContext { pub fn new(llmod: ModuleRef, crate: ~str) -> CrateDebugContext { - debug2!("CrateDebugContext::new"); + debug!("CrateDebugContext::new"); let builder = unsafe { llvm::LLVMDIBuilderCreate(llmod) }; // DIBuilder inherits context from the module, so we'd better use the same one let llcontext = unsafe { llvm::LLVMGetModuleContext(llmod) }; @@ -234,7 +234,7 @@ pub fn finalize(cx: @mut CrateContext) { return; } - debug2!("finalize"); + debug!("finalize"); compile_unit_metadata(cx); unsafe { llvm::LLVMDIBuilderFinalize(DIB(cx)); @@ -497,7 +497,7 @@ pub fn set_source_location(fcx: &FunctionContext, let cx = fcx.ccx; - debug2!("set_source_location: {}", cx.sess.codemap.span_to_str(span)); + debug!("set_source_location: {}", cx.sess.codemap.span_to_str(span)); if fcx.debug_context.get_ref(cx, span).source_locations_enabled { let loc = span_start(cx, span); @@ -857,7 +857,7 @@ fn compile_unit_metadata(cx: @mut CrateContext) { let dcx = debug_context(cx); let crate_name: &str = dcx.crate_file; - debug2!("compile_unit_metadata: {:?}", crate_name); + debug!("compile_unit_metadata: {:?}", crate_name); // FIXME (#9639): This needs to handle non-utf8 paths let work_dir = cx.sess.working_dir.as_str().unwrap(); @@ -968,7 +968,7 @@ fn file_metadata(cx: &mut CrateContext, full_path: &str) -> DIFile { None => () } - debug2!("file_metadata: {}", full_path); + debug!("file_metadata: {}", full_path); // FIXME (#9639): This needs to handle non-utf8 paths let work_dir = cx.sess.working_dir.as_str().unwrap(); @@ -1011,7 +1011,7 @@ fn scope_metadata(fcx: &FunctionContext, fn basic_type_metadata(cx: &mut CrateContext, t: ty::t) -> DIType { - debug2!("basic_type_metadata: {:?}", ty::get(t)); + debug!("basic_type_metadata: {:?}", ty::get(t)); let (name, encoding) = match ty::get(t).sty { ty::ty_nil | ty::ty_bot => (~"uint", DW_ATE_unsigned), @@ -1849,7 +1849,7 @@ fn vec_slice_metadata(cx: &mut CrateContext, span: Span) -> DICompositeType { - debug2!("vec_slice_metadata: {:?}", ty::get(vec_type)); + debug!("vec_slice_metadata: {:?}", ty::get(vec_type)); let slice_llvm_type = type_of::type_of(cx, vec_type); let slice_type_name = ppaux::ty_to_str(cx.tcx, vec_type); @@ -1964,7 +1964,7 @@ fn trait_metadata(cx: &mut CrateContext, } fn unimplemented_type_metadata(cx: &mut CrateContext, t: ty::t) -> DIType { - debug2!("unimplemented_type_metadata: {:?}", ty::get(t)); + debug!("unimplemented_type_metadata: {:?}", ty::get(t)); let name = ppaux::ty_to_str(cx.tcx, t); let metadata = do format!("NYI<{}>", name).with_c_str |name| { @@ -2016,7 +2016,7 @@ fn type_metadata(cx: &mut CrateContext, pointer_type_metadata(cx, pointer_type, box_metadata) } - debug2!("type_metadata: {:?}", ty::get(t)); + debug!("type_metadata: {:?}", ty::get(t)); let sty = &ty::get(t).sty; let type_metadata = match *sty { @@ -2135,7 +2135,7 @@ fn set_debug_location(cx: &mut CrateContext, debug_location: DebugLocation) { match debug_location { KnownLocation { scope, line, col } => { - debug2!("setting debug location to {} {}", line, col); + debug!("setting debug location to {} {}", line, col); let elements = [C_i32(line as i32), C_i32(col as i32), scope, ptr::null()]; unsafe { metadata_node = llvm::LLVMMDNodeInContext(debug_context(cx).llcontext, @@ -2144,7 +2144,7 @@ fn set_debug_location(cx: &mut CrateContext, debug_location: DebugLocation) { } } UnknownLocation => { - debug2!("clearing debug location "); + debug!("clearing debug location "); metadata_node = ptr::null(); } }; diff --git a/src/librustc/middle/trans/expr.rs b/src/librustc/middle/trans/expr.rs index 48d3e3f7c58b..238b15fe5979 100644 --- a/src/librustc/middle/trans/expr.rs +++ b/src/librustc/middle/trans/expr.rs @@ -183,7 +183,7 @@ fn drop_and_cancel_clean(bcx: @mut Block, dat: Datum) -> @mut Block { } pub fn trans_to_datum(bcx: @mut Block, expr: &ast::Expr) -> DatumBlock { - debug2!("trans_to_datum(expr={})", bcx.expr_to_str(expr)); + debug!("trans_to_datum(expr={})", bcx.expr_to_str(expr)); let mut bcx = bcx; let mut datum = unpack_datum!(bcx, trans_to_datum_unadjusted(bcx, expr)); @@ -191,7 +191,7 @@ pub fn trans_to_datum(bcx: @mut Block, expr: &ast::Expr) -> DatumBlock { None => { return DatumBlock {bcx: bcx, datum: datum}; } Some(adj) => { adj } }; - debug2!("unadjusted datum: {}", datum.to_str(bcx.ccx())); + debug!("unadjusted datum: {}", datum.to_str(bcx.ccx())); match *adjustment { AutoAddEnv(*) => { datum = unpack_datum!(bcx, add_env(bcx, expr, datum)); @@ -233,7 +233,7 @@ pub fn trans_to_datum(bcx: @mut Block, expr: &ast::Expr) -> DatumBlock { }; } } - debug2!("after adjustments, datum={}", datum.to_str(bcx.ccx())); + debug!("after adjustments, datum={}", datum.to_str(bcx.ccx())); return DatumBlock {bcx: bcx, datum: datum}; fn auto_ref(bcx: @mut Block, datum: Datum) -> DatumBlock { @@ -289,7 +289,7 @@ pub fn trans_to_datum(bcx: @mut Block, expr: &ast::Expr) -> DatumBlock { let tcx = bcx.tcx(); let closure_ty = expr_ty_adjusted(bcx, expr); - debug2!("add_env(closure_ty={})", closure_ty.repr(tcx)); + debug!("add_env(closure_ty={})", closure_ty.repr(tcx)); let scratch = scratch_datum(bcx, closure_ty, "__adjust", false); let llfn = GEPi(bcx, scratch.val, [0u, abi::fn_field_code]); assert_eq!(datum.appropriate_mode(bcx.ccx()), ByValue); @@ -313,7 +313,7 @@ pub fn trans_to_datum(bcx: @mut Block, expr: &ast::Expr) -> DatumBlock { source_datum: Datum) -> DatumBlock { let tcx = bcx.tcx(); let target_obj_ty = expr_ty_adjusted(bcx, expr); - debug2!("auto_borrow_obj(target={})", + debug!("auto_borrow_obj(target={})", target_obj_ty.repr(tcx)); // Extract source store information @@ -434,7 +434,7 @@ pub fn trans_into(bcx: @mut Block, expr: &ast::Expr, dest: Dest) -> @mut Block { let ty = expr_ty(bcx, expr); - debug2!("trans_into_unadjusted(expr={}, dest={})", + debug!("trans_into_unadjusted(expr={}, dest={})", bcx.expr_to_str(expr), dest.to_str(bcx.ccx())); let _indenter = indenter(); @@ -450,7 +450,7 @@ pub fn trans_into(bcx: @mut Block, expr: &ast::Expr, dest: Dest) -> @mut Block { }; let kind = bcx.expr_kind(expr); - debug2!("expr kind = {:?}", kind); + debug!("expr kind = {:?}", kind); return match kind { ty::LvalueExpr => { let datumblock = trans_lvalue_unadjusted(bcx, expr); @@ -508,7 +508,7 @@ fn trans_to_datum_unadjusted(bcx: @mut Block, expr: &ast::Expr) -> DatumBlock { let mut bcx = bcx; - debug2!("trans_to_datum_unadjusted(expr={})", bcx.expr_to_str(expr)); + debug!("trans_to_datum_unadjusted(expr={})", bcx.expr_to_str(expr)); let _indenter = indenter(); debuginfo::set_source_location(bcx.fcx, expr.id, expr.span); @@ -720,7 +720,7 @@ fn trans_rvalue_dps_unadjusted(bcx: @mut Block, expr: &ast::Expr, ast::ExprFnBlock(ref decl, ref body) => { let expr_ty = expr_ty(bcx, expr); let sigil = ty::ty_closure_sigil(expr_ty); - debug2!("translating fn_block {} with type {}", + debug!("translating fn_block {} with type {}", expr_to_str(expr, tcx.sess.intr()), expr_ty.repr(tcx)); return closure::trans_expr_fn(bcx, sigil, decl, body, @@ -889,7 +889,7 @@ fn trans_lvalue_unadjusted(bcx: @mut Block, expr: &ast::Expr) -> DatumBlock { let _icx = push_ctxt("trans_lval"); let mut bcx = bcx; - debug2!("trans_lvalue(expr={})", bcx.expr_to_str(expr)); + debug!("trans_lvalue(expr={})", bcx.expr_to_str(expr)); let _indenter = indenter(); trace_span!(bcx, expr.span, shorten(bcx.expr_to_str(expr))); @@ -977,8 +977,8 @@ fn trans_lvalue_unadjusted(bcx: @mut Block, expr: &ast::Expr) -> DatumBlock { let (bcx, base, len) = base_datum.get_vec_base_and_len(bcx, index_expr.span, index_expr.id, 0); - debug2!("trans_index: base {}", bcx.val_to_str(base)); - debug2!("trans_index: len {}", bcx.val_to_str(len)); + debug!("trans_index: base {}", bcx.val_to_str(base)); + debug!("trans_index: len {}", bcx.val_to_str(len)); let bounds_check = ICmp(bcx, lib::llvm::IntUGE, ix_val, len); let bcx = do with_cond(bcx, bounds_check) |bcx| { @@ -1109,7 +1109,7 @@ pub fn trans_local_var(bcx: @mut Block, def: ast::Def) -> Datum { } }; - debug2!("def_self() reference, self_info.t={}", + debug!("def_self() reference, self_info.t={}", self_info.t.repr(bcx.tcx())); Datum { @@ -1135,7 +1135,7 @@ pub fn trans_local_var(bcx: @mut Block, def: ast::Def) -> Datum { } }; let ty = node_id_type(bcx, nid); - debug2!("take_local(nid={:?}, v={}, ty={})", + debug!("take_local(nid={:?}, v={}, ty={})", nid, bcx.val_to_str(v), bcx.ty_to_str(ty)); Datum { val: v, @@ -1756,7 +1756,7 @@ fn trans_assign_op(bcx: @mut Block, let _icx = push_ctxt("trans_assign_op"); let mut bcx = bcx; - debug2!("trans_assign_op(expr={})", bcx.expr_to_str(expr)); + debug!("trans_assign_op(expr={})", bcx.expr_to_str(expr)); // Evaluate LHS (destination), which should be an lvalue let dst_datum = unpack_datum!(bcx, trans_lvalue_unadjusted(bcx, dst)); diff --git a/src/librustc/middle/trans/foreign.rs b/src/librustc/middle/trans/foreign.rs index 09dd2f21a3b0..7f8f1daebc48 100644 --- a/src/librustc/middle/trans/foreign.rs +++ b/src/librustc/middle/trans/foreign.rs @@ -110,7 +110,7 @@ pub fn register_foreign_item_fn(ccx: @mut CrateContext, * Just adds a LLVM global. */ - debug2!("register_foreign_item_fn(abis={}, \ + debug!("register_foreign_item_fn(abis={}, \ path={}, \ foreign_item.id={:?})", abis.repr(ccx.tcx), @@ -165,7 +165,7 @@ pub fn trans_native_call(bcx: @mut Block, let ccx = bcx.ccx(); let tcx = bcx.tcx(); - debug2!("trans_native_call(callee_ty={}, \ + debug!("trans_native_call(callee_ty={}, \ llfn={}, \ llretptr={})", callee_ty.repr(tcx), @@ -210,7 +210,7 @@ pub fn trans_native_call(bcx: @mut Block, // Does Rust pass this argument by pointer? let rust_indirect = type_of::arg_is_indirect(ccx, fn_sig.inputs[i]); - debug2!("argument {}, llarg_rust={}, rust_indirect={}, arg_ty={}", + debug!("argument {}, llarg_rust={}, rust_indirect={}, arg_ty={}", i, ccx.tn.val_to_str(llarg_rust), rust_indirect, @@ -224,7 +224,7 @@ pub fn trans_native_call(bcx: @mut Block, llarg_rust = scratch; } - debug2!("llarg_rust={} (after indirection)", + debug!("llarg_rust={} (after indirection)", ccx.tn.val_to_str(llarg_rust)); // Check whether we need to do any casting @@ -233,7 +233,7 @@ pub fn trans_native_call(bcx: @mut Block, None => () } - debug2!("llarg_rust={} (after casting)", + debug!("llarg_rust={} (after casting)", ccx.tn.val_to_str(llarg_rust)); // Finally, load the value if needed for the foreign ABI @@ -244,7 +244,7 @@ pub fn trans_native_call(bcx: @mut Block, Load(bcx, llarg_rust) }; - debug2!("argument {}, llarg_foreign={}", + debug!("argument {}, llarg_foreign={}", i, ccx.tn.val_to_str(llarg_foreign)); // fill padding with undef value @@ -289,10 +289,10 @@ pub fn trans_native_call(bcx: @mut Block, None => fn_type.ret_ty.ty }; - debug2!("llretptr={}", ccx.tn.val_to_str(llretptr)); - debug2!("llforeign_retval={}", ccx.tn.val_to_str(llforeign_retval)); - debug2!("llrust_ret_ty={}", ccx.tn.type_to_str(llrust_ret_ty)); - debug2!("llforeign_ret_ty={}", ccx.tn.type_to_str(llforeign_ret_ty)); + debug!("llretptr={}", ccx.tn.val_to_str(llretptr)); + debug!("llforeign_retval={}", ccx.tn.val_to_str(llforeign_retval)); + debug!("llrust_ret_ty={}", ccx.tn.type_to_str(llrust_ret_ty)); + debug!("llforeign_ret_ty={}", ccx.tn.type_to_str(llforeign_ret_ty)); if llrust_ret_ty == llforeign_ret_ty { Store(bcx, llforeign_retval, llretptr); @@ -318,7 +318,7 @@ pub fn trans_native_call(bcx: @mut Block, let llforeign_align = machine::llalign_of_min(ccx, llforeign_ret_ty); let llrust_align = machine::llalign_of_min(ccx, llrust_ret_ty); let llalign = uint::min(llforeign_align, llrust_align); - debug2!("llrust_size={:?}", llrust_size); + debug!("llrust_size={:?}", llrust_size); base::call_memcpy(bcx, llretptr_i8, llscratch_i8, C_uint(ccx, llrust_size), llalign as u32); } @@ -377,7 +377,7 @@ pub fn register_rust_fn_with_foreign_abi(ccx: @mut CrateContext, lib::llvm::CCallConv, llfn_ty); add_argument_attributes(&tys, llfn); - debug2!("register_rust_fn_with_foreign_abi(node_id={:?}, llfn_ty={}, llfn={})", + debug!("register_rust_fn_with_foreign_abi(node_id={:?}, llfn_ty={}, llfn={})", node_id, ccx.tn.type_to_str(llfn_ty), ccx.tn.val_to_str(llfn)); llfn } @@ -430,7 +430,7 @@ pub fn trans_rust_fn_with_foreign_abi(ccx: @mut CrateContext, } }; - debug2!("build_rust_fn: path={} id={:?} t={}", + debug!("build_rust_fn: path={} id={:?} t={}", path.repr(tcx), id, t.repr(tcx)); @@ -457,7 +457,7 @@ pub fn trans_rust_fn_with_foreign_abi(ccx: @mut CrateContext, "foreign::trans_rust_fn_with_foreign_abi::build_wrap_fn"); let tcx = ccx.tcx; - debug2!("build_wrap_fn(llrustfn={}, llwrapfn={})", + debug!("build_wrap_fn(llrustfn={}, llwrapfn={})", ccx.tn.val_to_str(llrustfn), ccx.tn.val_to_str(llwrapfn)); @@ -512,14 +512,14 @@ pub fn trans_rust_fn_with_foreign_abi(ccx: @mut CrateContext, // alloca some scratch space on the stack. match foreign_outptr { Some(llforeign_outptr) => { - debug2!("out pointer, foreign={}", + debug!("out pointer, foreign={}", ccx.tn.val_to_str(llforeign_outptr)); let llrust_retptr = llvm::LLVMBuildBitCast(builder, llforeign_outptr, llrust_ret_ty.ptr_to().to_ref(), noname()); - debug2!("out pointer, foreign={} (casted)", + debug!("out pointer, foreign={} (casted)", ccx.tn.val_to_str(llrust_retptr)); llrust_args.push(llrust_retptr); return_alloca = None; @@ -532,7 +532,7 @@ pub fn trans_rust_fn_with_foreign_abi(ccx: @mut CrateContext, llrust_ret_ty.to_ref(), s)) }; - debug2!("out pointer, \ + debug!("out pointer, \ allocad={}, \ llrust_ret_ty={}, \ return_ty={}", @@ -552,7 +552,7 @@ pub fn trans_rust_fn_with_foreign_abi(ccx: @mut CrateContext, // Push an (null) env pointer let env_pointer = base::null_env_ptr(ccx); - debug2!("env pointer={}", ccx.tn.val_to_str(env_pointer)); + debug!("env pointer={}", ccx.tn.val_to_str(env_pointer)); llrust_args.push(env_pointer); // Build up the arguments to the call to the rust function. @@ -569,9 +569,9 @@ pub fn trans_rust_fn_with_foreign_abi(ccx: @mut CrateContext, let foreign_index = next_foreign_arg(llforeign_arg_ty.pad.is_some()); let mut llforeign_arg = llvm::LLVMGetParam(llwrapfn, foreign_index); - debug2!("llforeign_arg \\#{}: {}", + debug!("llforeign_arg \\#{}: {}", i, ccx.tn.val_to_str(llforeign_arg)); - debug2!("rust_indirect = {}, foreign_indirect = {}", + debug!("rust_indirect = {}, foreign_indirect = {}", rust_indirect, foreign_indirect); // Ensure that the foreign argument is indirect (by @@ -602,14 +602,14 @@ pub fn trans_rust_fn_with_foreign_abi(ccx: @mut CrateContext, llvm::LLVMBuildLoad(builder, llforeign_arg, noname()) }; - debug2!("llrust_arg \\#{}: {}", + debug!("llrust_arg \\#{}: {}", i, ccx.tn.val_to_str(llrust_arg)); llrust_args.push(llrust_arg); } // Perform the call itself let llrust_ret_val = do llrust_args.as_imm_buf |ptr, len| { - debug2!("calling llrustfn = {}", ccx.tn.val_to_str(llrustfn)); + debug!("calling llrustfn = {}", ccx.tn.val_to_str(llrustfn)); llvm::LLVMBuildCall(builder, llrustfn, ptr, len as c_uint, noname()) }; @@ -737,7 +737,7 @@ fn foreign_types_for_fn_ty(ccx: &mut CrateContext, llsig.llarg_tys, llsig.llret_ty, ret_def); - debug2!("foreign_types_for_fn_ty(\ + debug!("foreign_types_for_fn_ty(\ ty={}, \ llsig={} -> {}, \ fn_ty={} -> {}, \ diff --git a/src/librustc/middle/trans/glue.rs b/src/librustc/middle/trans/glue.rs index 01470b13e3ae..aaa187931c96 100644 --- a/src/librustc/middle/trans/glue.rs +++ b/src/librustc/middle/trans/glue.rs @@ -213,12 +213,12 @@ pub fn lazily_emit_tydesc_glue(ccx: @mut CrateContext, match ti.take_glue { Some(_) => (), None => { - debug2!("+++ lazily_emit_tydesc_glue TAKE {}", + debug!("+++ lazily_emit_tydesc_glue TAKE {}", ppaux::ty_to_str(ccx.tcx, ti.ty)); let glue_fn = declare_generic_glue(ccx, ti.ty, llfnty, "take"); ti.take_glue = Some(glue_fn); make_generic_glue(ccx, ti.ty, glue_fn, make_take_glue, "take"); - debug2!("--- lazily_emit_tydesc_glue TAKE {}", + debug!("--- lazily_emit_tydesc_glue TAKE {}", ppaux::ty_to_str(ccx.tcx, ti.ty)); } } @@ -226,12 +226,12 @@ pub fn lazily_emit_tydesc_glue(ccx: @mut CrateContext, match ti.drop_glue { Some(_) => (), None => { - debug2!("+++ lazily_emit_tydesc_glue DROP {}", + debug!("+++ lazily_emit_tydesc_glue DROP {}", ppaux::ty_to_str(ccx.tcx, ti.ty)); let glue_fn = declare_generic_glue(ccx, ti.ty, llfnty, "drop"); ti.drop_glue = Some(glue_fn); make_generic_glue(ccx, ti.ty, glue_fn, make_drop_glue, "drop"); - debug2!("--- lazily_emit_tydesc_glue DROP {}", + debug!("--- lazily_emit_tydesc_glue DROP {}", ppaux::ty_to_str(ccx.tcx, ti.ty)); } } @@ -239,12 +239,12 @@ pub fn lazily_emit_tydesc_glue(ccx: @mut CrateContext, match ti.free_glue { Some(_) => (), None => { - debug2!("+++ lazily_emit_tydesc_glue FREE {}", + debug!("+++ lazily_emit_tydesc_glue FREE {}", ppaux::ty_to_str(ccx.tcx, ti.ty)); let glue_fn = declare_generic_glue(ccx, ti.ty, llfnty, "free"); ti.free_glue = Some(glue_fn); make_generic_glue(ccx, ti.ty, glue_fn, make_free_glue, "free"); - debug2!("--- lazily_emit_tydesc_glue FREE {}", + debug!("--- lazily_emit_tydesc_glue FREE {}", ppaux::ty_to_str(ccx.tcx, ti.ty)); } } @@ -252,12 +252,12 @@ pub fn lazily_emit_tydesc_glue(ccx: @mut CrateContext, match ti.visit_glue { Some(_) => (), None => { - debug2!("+++ lazily_emit_tydesc_glue VISIT {}", + debug!("+++ lazily_emit_tydesc_glue VISIT {}", ppaux::ty_to_str(ccx.tcx, ti.ty)); let glue_fn = declare_generic_glue(ccx, ti.ty, llfnty, "visit"); ti.visit_glue = Some(glue_fn); make_generic_glue(ccx, ti.ty, glue_fn, make_visit_glue, "visit"); - debug2!("--- lazily_emit_tydesc_glue VISIT {}", + debug!("--- lazily_emit_tydesc_glue VISIT {}", ppaux::ty_to_str(ccx.tcx, ti.ty)); } } @@ -640,7 +640,7 @@ pub fn declare_tydesc(ccx: &mut CrateContext, t: ty::t) -> @mut tydesc_info { let llalign = llalign_of(ccx, llty); let name = mangle_internal_name_by_type_and_seq(ccx, t, "tydesc").to_managed(); note_unique_llvm_symbol(ccx, name); - debug2!("+++ declare_tydesc {} {}", ppaux::ty_to_str(ccx.tcx, t), name); + debug!("+++ declare_tydesc {} {}", ppaux::ty_to_str(ccx.tcx, t), name); let gvar = do name.with_c_str |buf| { unsafe { llvm::LLVMAddGlobal(ccx.llmod, ccx.tydesc_type.to_ref(), buf) @@ -661,7 +661,7 @@ pub fn declare_tydesc(ccx: &mut CrateContext, t: ty::t) -> @mut tydesc_info { free_glue: None, visit_glue: None }; - debug2!("--- declare_tydesc {}", ppaux::ty_to_str(ccx.tcx, t)); + debug!("--- declare_tydesc {}", ppaux::ty_to_str(ccx.tcx, t)); return inf; } @@ -671,7 +671,7 @@ pub fn declare_generic_glue(ccx: &mut CrateContext, t: ty::t, llfnty: Type, name: &str) -> ValueRef { let _icx = push_ctxt("declare_generic_glue"); let fn_nm = mangle_internal_name_by_type_and_seq(ccx, t, (~"glue_" + name)).to_managed(); - debug2!("{} is for type {}", fn_nm, ppaux::ty_to_str(ccx.tcx, t)); + debug!("{} is for type {}", fn_nm, ppaux::ty_to_str(ccx.tcx, t)); note_unique_llvm_symbol(ccx, fn_nm); let llfn = decl_cdecl_fn(ccx.llmod, fn_nm, llfnty); set_glue_inlining(llfn, t); @@ -771,7 +771,7 @@ pub fn emit_tydescs(ccx: &mut CrateContext) { } }; - debug2!("ti.borrow_offset: {}", ccx.tn.val_to_str(ti.borrow_offset)); + debug!("ti.borrow_offset: {}", ccx.tn.val_to_str(ti.borrow_offset)); let tydesc = C_named_struct(ccx.tydesc_type, [ti.size, // size diff --git a/src/librustc/middle/trans/inline.rs b/src/librustc/middle/trans/inline.rs index 41a835fcab95..a5be9a3ca5e1 100644 --- a/src/librustc/middle/trans/inline.rs +++ b/src/librustc/middle/trans/inline.rs @@ -29,7 +29,7 @@ pub fn maybe_instantiate_inline(ccx: @mut CrateContext, fn_id: ast::DefId) match ccx.external.find(&fn_id) { Some(&Some(node_id)) => { // Already inline - debug2!("maybe_instantiate_inline({}): already inline as node id {}", + debug!("maybe_instantiate_inline({}): already inline as node id {}", ty::item_path_str(ccx.tcx, fn_id), node_id); return local_def(node_id); } @@ -141,7 +141,7 @@ pub fn maybe_instantiate_inline(ccx: @mut CrateContext, fn_id: ast::DefId) _ => { let self_ty = ty::node_id_to_type(ccx.tcx, mth.self_id); - debug2!("calling inline trans_fn with self_ty {}", + debug!("calling inline trans_fn with self_ty {}", ty_to_str(ccx.tcx, self_ty)); match mth.explicit_self.node { ast::sty_value => impl_self(self_ty, ty::ByRef), diff --git a/src/librustc/middle/trans/intrinsic.rs b/src/librustc/middle/trans/intrinsic.rs index 6334677a4069..e627f39f2017 100644 --- a/src/librustc/middle/trans/intrinsic.rs +++ b/src/librustc/middle/trans/intrinsic.rs @@ -41,7 +41,7 @@ pub fn trans_intrinsic(ccx: @mut CrateContext, substs: @param_substs, attributes: &[ast::Attribute], ref_id: Option) { - debug2!("trans_intrinsic(item.ident={})", ccx.sess.str_of(item.ident)); + debug!("trans_intrinsic(item.ident={})", ccx.sess.str_of(item.ident)); fn simple_llvm_intrinsic(bcx: @mut Block, name: &'static str, num_args: uint) { assert!(num_args <= 4); @@ -311,7 +311,7 @@ pub fn trans_intrinsic(ccx: @mut CrateContext, if in_type_size != out_type_size { let sp = match ccx.tcx.items.get_copy(&ref_id.unwrap()) { ast_map::node_expr(e) => e.span, - _ => fail2!("transmute has non-expr arg"), + _ => fail!("transmute has non-expr arg"), }; let pluralize = |n| if 1u == n { "" } else { "s" }; ccx.sess.span_fatal(sp, diff --git a/src/librustc/middle/trans/meth.rs b/src/librustc/middle/trans/meth.rs index 81466af6f747..a8c18c721671 100644 --- a/src/librustc/middle/trans/meth.rs +++ b/src/librustc/middle/trans/meth.rs @@ -55,7 +55,7 @@ pub fn trans_impl(ccx: @mut CrateContext, let _icx = push_ctxt("impl::trans_impl"); let tcx = ccx.tcx; - debug2!("trans_impl(path={}, name={}, id={:?})", + debug!("trans_impl(path={}, name={}, id={:?})", path.repr(tcx), name.repr(tcx), id); // Both here and below with generic methods, be sure to recurse and look for @@ -117,7 +117,7 @@ pub fn trans_method(ccx: @mut CrateContext, ty::subst_tps(ccx.tcx, *tys, *self_sub, self_ty) } }; - debug2!("calling trans_fn with self_ty {}", + debug!("calling trans_fn with self_ty {}", self_ty.repr(ccx.tcx)); match method.explicit_self.node { ast::sty_value => impl_self(self_ty, ty::ByRef), @@ -161,7 +161,7 @@ pub fn trans_method_callee(bcx: @mut Block, -> Callee { let _icx = push_ctxt("impl::trans_method_callee"); - debug2!("trans_method_callee(callee_id={:?}, this={}, mentry={})", + debug!("trans_method_callee(callee_id={:?}, this={}, mentry={})", callee_id, bcx.expr_to_str(this), mentry.repr(bcx.tcx())); @@ -199,7 +199,7 @@ pub fn trans_method_callee(bcx: @mut Block, trait_id, off, vtbl) } // how to get rid of this? - None => fail2!("trans_method_callee: missing param_substs") + None => fail!("trans_method_callee: missing param_substs") } } @@ -220,7 +220,7 @@ pub fn trans_static_method_callee(bcx: @mut Block, let _icx = push_ctxt("impl::trans_static_method_callee"); let ccx = bcx.ccx(); - debug2!("trans_static_method_callee(method_id={:?}, trait_id={}, \ + debug!("trans_static_method_callee(method_id={:?}, trait_id={}, \ callee_id={:?})", method_id, ty::item_path_str(bcx.tcx(), trait_id), @@ -250,16 +250,16 @@ pub fn trans_static_method_callee(bcx: @mut Block, ast_map::node_trait_method(trait_method, _, _) => { ast_util::trait_method_to_ty_method(trait_method).ident } - _ => fail2!("callee is not a trait method") + _ => fail!("callee is not a trait method") } } else { let path = csearch::get_item_path(bcx.tcx(), method_id); match path[path.len()-1] { path_pretty_name(s, _) | path_name(s) => { s } - path_mod(_) => { fail2!("path doesn't have a name?") } + path_mod(_) => { fail!("path doesn't have a name?") } } }; - debug2!("trans_static_method_callee: method_id={:?}, callee_id={:?}, \ + debug!("trans_static_method_callee: method_id={:?}, callee_id={:?}, \ name={}", method_id, callee_id, ccx.sess.str_of(mname)); let vtbls = resolve_vtables_in_fn_ctxt( @@ -287,7 +287,7 @@ pub fn trans_static_method_callee(bcx: @mut Block, FnData {llfn: PointerCast(bcx, lval, llty)} } _ => { - fail2!("vtable_param left in monomorphized \ + fail!("vtable_param left in monomorphized \ function's vtable substs"); } } @@ -362,7 +362,7 @@ pub fn trans_monomorphized_callee(bcx: @mut Block, } } typeck::vtable_param(*) => { - fail2!("vtable_param left in monomorphized function's vtable substs"); + fail!("vtable_param left in monomorphized function's vtable substs"); } }; @@ -395,13 +395,13 @@ pub fn combine_impl_and_methods_tps(bcx: @mut Block, let method = ty::method(ccx.tcx, mth_did); let n_m_tps = method.generics.type_param_defs.len(); let node_substs = node_id_type_params(bcx, callee_id); - debug2!("rcvr_substs={:?}", rcvr_substs.repr(ccx.tcx)); + debug!("rcvr_substs={:?}", rcvr_substs.repr(ccx.tcx)); let ty_substs = vec::append(rcvr_substs.to_owned(), node_substs.tailn(node_substs.len() - n_m_tps)); - debug2!("n_m_tps={:?}", n_m_tps); - debug2!("node_substs={:?}", node_substs.repr(ccx.tcx)); - debug2!("ty_substs={:?}", ty_substs.repr(ccx.tcx)); + debug!("n_m_tps={:?}", n_m_tps); + debug!("node_substs={:?}", node_substs.repr(ccx.tcx)); + debug!("ty_substs={:?}", ty_substs.repr(ccx.tcx)); // Now, do the same work for the vtables. The vtables might not @@ -474,13 +474,13 @@ pub fn trans_trait_callee_from_llval(bcx: @mut Block, let ccx = bcx.ccx(); // Load the data pointer from the object. - debug2!("(translating trait callee) loading second index from pair"); + debug!("(translating trait callee) loading second index from pair"); let llboxptr = GEPi(bcx, llpair, [0u, abi::trt_field_box]); let llbox = Load(bcx, llboxptr); let llself = PointerCast(bcx, llbox, Type::opaque_box(ccx).ptr_to()); // Load the function from the vtable and cast it to the expected type. - debug2!("(translating trait callee) loading method"); + debug!("(translating trait callee) loading method"); let llcallee_ty = type_of_fn_from_ty(ccx, callee_ty); let llvtable = Load(bcx, PointerCast(bcx, @@ -524,7 +524,7 @@ pub fn vtable_id(ccx: @mut CrateContext, } // can't this be checked at the callee? - _ => fail2!("vtable_id") + _ => fail!("vtable_id") } } @@ -611,7 +611,7 @@ fn emit_vtable_methods(bcx: @mut Block, // the method type from the impl to substitute into. let m_id = method_with_name(ccx, impl_id, ident.name); let m = ty::method(tcx, m_id); - debug2!("(making impl vtable) emitting method {} at subst {}", + debug!("(making impl vtable) emitting method {} at subst {}", m.repr(tcx), substs.repr(tcx)); let fty = ty::subst_tps(tcx, @@ -619,7 +619,7 @@ fn emit_vtable_methods(bcx: @mut Block, None, ty::mk_bare_fn(tcx, m.fty.clone())); if m.generics.has_type_params() || ty::type_has_self(fty) { - debug2!("(making impl vtable) method has self or type params: {}", + debug!("(making impl vtable) method has self or type params: {}", tcx.sess.str_of(ident)); C_null(Type::nil().ptr_to()) } else { diff --git a/src/librustc/middle/trans/monomorphize.rs b/src/librustc/middle/trans/monomorphize.rs index 79b3453037d1..f625ce4b01c1 100644 --- a/src/librustc/middle/trans/monomorphize.rs +++ b/src/librustc/middle/trans/monomorphize.rs @@ -36,7 +36,7 @@ pub fn monomorphic_fn(ccx: @mut CrateContext, ref_id: Option) -> (ValueRef, bool) { - debug2!("monomorphic_fn(\ + debug!("monomorphic_fn(\ fn_id={}, \ real_substs={}, \ vtables={}, \ @@ -68,7 +68,7 @@ pub fn monomorphic_fn(ccx: @mut CrateContext, must_cast = true; } - debug2!("monomorphic_fn(\ + debug!("monomorphic_fn(\ fn_id={}, \ psubsts={}, \ hash_id={:?})", @@ -78,7 +78,7 @@ pub fn monomorphic_fn(ccx: @mut CrateContext, match ccx.monomorphized.find(&hash_id) { Some(&val) => { - debug2!("leaving monomorphic fn {}", + debug!("leaving monomorphic fn {}", ty::item_path_str(ccx.tcx, fn_id)); return (val, must_cast); } @@ -140,7 +140,7 @@ pub fn monomorphic_fn(ccx: @mut CrateContext, ast_map::node_struct_ctor(_, i, pt) => (pt, i.ident, i.span) }; - debug2!("monomorphic_fn about to subst into {}", llitem_ty.repr(ccx.tcx)); + debug!("monomorphic_fn about to subst into {}", llitem_ty.repr(ccx.tcx)); let mono_ty = match is_static_provided { None => ty::subst_tps(ccx.tcx, psubsts.tys, psubsts.self_ty, llitem_ty), @@ -164,7 +164,7 @@ pub fn monomorphic_fn(ccx: @mut CrateContext, (psubsts.tys.slice(0, idx) + &[psubsts.self_ty.unwrap()] + psubsts.tys.tailn(idx)); - debug2!("static default: changed substitution to {}", + debug!("static default: changed substitution to {}", substs.repr(ccx.tcx)); ty::subst_tps(ccx.tcx, substs, None, llitem_ty) @@ -176,7 +176,7 @@ pub fn monomorphic_fn(ccx: @mut CrateContext, assert!(f.abis.is_rust() || f.abis.is_intrinsic()); f } - _ => fail2!("expected bare rust fn or an intrinsic") + _ => fail!("expected bare rust fn or an intrinsic") }; ccx.stats.n_monos += 1; @@ -197,7 +197,7 @@ pub fn monomorphic_fn(ccx: @mut CrateContext, let mut pt = (*pt).clone(); pt.push(elt); let s = mangle_exported_name(ccx, pt.clone(), mono_ty); - debug2!("monomorphize_fn mangled to {}", s); + debug!("monomorphize_fn mangled to {}", s); let mk_lldecl = || { let lldecl = decl_internal_rust_fn(ccx, f.sig.inputs, f.sig.output, s); @@ -290,7 +290,7 @@ pub fn monomorphic_fn(ccx: @mut CrateContext, }; ccx.monomorphizing.insert(fn_id, depth); - debug2!("leaving monomorphic fn {}", ty::item_path_str(ccx.tcx, fn_id)); + debug!("leaving monomorphic fn {}", ty::item_path_str(ccx.tcx, fn_id)); (lldecl, must_cast) } @@ -302,7 +302,7 @@ pub fn make_mono_id(ccx: @mut CrateContext, let substs_iter = substs.self_ty.iter().chain(substs.tys.iter()); let precise_param_ids: ~[(ty::t, Option<@~[mono_id]>)] = match substs.vtables { Some(vts) => { - debug2!("make_mono_id vtables={} substs={}", + debug!("make_mono_id vtables={} substs={}", vts.repr(ccx.tcx), substs.tys.repr(ccx.tcx)); let vts_iter = substs.self_vtables.iter().chain(vts.iter()); vts_iter.zip(substs_iter).map(|(vtable, subst)| { diff --git a/src/librustc/middle/trans/reflect.rs b/src/librustc/middle/trans/reflect.rs index 1ab9e4581f28..54ecc15c44f7 100644 --- a/src/librustc/middle/trans/reflect.rs +++ b/src/librustc/middle/trans/reflect.rs @@ -98,10 +98,10 @@ impl Reflector { let mth_ty = ty::mk_bare_fn(tcx, self.visitor_methods[mth_idx].fty.clone()); let v = self.visitor_val; - debug2!("passing {} args:", args.len()); + debug!("passing {} args:", args.len()); let mut bcx = self.bcx; for (i, a) in args.iter().enumerate() { - debug2!("arg {}: {}", i, bcx.val_to_str(*a)); + debug!("arg {}: {}", i, bcx.val_to_str(*a)); } let bool_ty = ty::mk_bool(); let result = unpack_result!(bcx, callee::trans_call_inner( @@ -151,7 +151,7 @@ impl Reflector { pub fn visit_ty(&mut self, t: ty::t) { let bcx = self.bcx; let tcx = bcx.ccx().tcx; - debug2!("reflect::visit_ty {}", ty_to_str(bcx.ccx().tcx, t)); + debug!("reflect::visit_ty {}", ty_to_str(bcx.ccx().tcx, t)); match ty::get(t).sty { ty::ty_bot => self.leaf("bot"), diff --git a/src/librustc/middle/trans/tvec.rs b/src/librustc/middle/trans/tvec.rs index bde98eff41ce..38c5e0b55f74 100644 --- a/src/librustc/middle/trans/tvec.rs +++ b/src/librustc/middle/trans/tvec.rs @@ -169,7 +169,7 @@ pub fn trans_fixed_vstore(bcx: @mut Block, // to store the array of the suitable size, so all we have to do is // generate the content. - debug2!("trans_fixed_vstore(vstore_expr={}, dest={:?})", + debug!("trans_fixed_vstore(vstore_expr={}, dest={:?})", bcx.expr_to_str(vstore_expr), dest.to_str(bcx.ccx())); let _indenter = indenter(); @@ -199,7 +199,7 @@ pub fn trans_slice_vstore(bcx: @mut Block, let ccx = bcx.ccx(); - debug2!("trans_slice_vstore(vstore_expr={}, dest={})", + debug!("trans_slice_vstore(vstore_expr={}, dest={})", bcx.expr_to_str(vstore_expr), dest.to_str(ccx)); let _indenter = indenter(); @@ -214,7 +214,7 @@ pub fn trans_slice_vstore(bcx: @mut Block, // Handle the &[...] case: let vt = vec_types_from_expr(bcx, vstore_expr); let count = elements_required(bcx, content_expr); - debug2!("vt={}, count={:?}", vt.to_str(ccx), count); + debug!("vt={}, count={:?}", vt.to_str(ccx), count); // Make a fixed-length backing array and allocate it on the stack. let llcount = C_uint(ccx, count); @@ -255,7 +255,7 @@ pub fn trans_lit_str(bcx: @mut Block, // different from trans_slice_vstore() above because it does need to copy // the content anywhere. - debug2!("trans_lit_str(lit_expr={}, dest={})", + debug!("trans_lit_str(lit_expr={}, dest={})", bcx.expr_to_str(lit_expr), dest.to_str(bcx.ccx())); let _indenter = indenter(); @@ -286,7 +286,7 @@ pub fn trans_uniq_or_managed_vstore(bcx: @mut Block, heap: heap, vstore_expr: &a // @[...] or ~[...] (also @"..." or ~"...") allocate boxes in the // appropriate heap and write the array elements into them. - debug2!("trans_uniq_or_managed_vstore(vstore_expr={}, heap={:?})", + debug!("trans_uniq_or_managed_vstore(vstore_expr={}, heap={:?})", bcx.expr_to_str(vstore_expr), heap); let _indenter = indenter(); @@ -317,7 +317,7 @@ pub fn trans_uniq_or_managed_vstore(bcx: @mut Block, heap: heap, vstore_expr: &a _ => {} } } - heap_exchange_closure => fail2!("vectors use exchange_alloc"), + heap_exchange_closure => fail!("vectors use exchange_alloc"), heap_managed | heap_managed_unique => {} } @@ -329,7 +329,7 @@ pub fn trans_uniq_or_managed_vstore(bcx: @mut Block, heap: heap, vstore_expr: &a add_clean_free(bcx, val, heap); let dataptr = get_dataptr(bcx, get_bodyptr(bcx, val, vt.vec_ty)); - debug2!("alloc_vec() returned val={}, dataptr={}", + debug!("alloc_vec() returned val={}, dataptr={}", bcx.val_to_str(val), bcx.val_to_str(dataptr)); let bcx = write_content(bcx, &vt, vstore_expr, @@ -349,7 +349,7 @@ pub fn write_content(bcx: @mut Block, let _icx = push_ctxt("tvec::write_content"); let mut bcx = bcx; - debug2!("write_content(vt={}, dest={}, vstore_expr={:?})", + debug!("write_content(vt={}, dest={}, vstore_expr={:?})", vt.to_str(bcx.ccx()), dest.to_str(bcx.ccx()), bcx.expr_to_str(vstore_expr)); @@ -382,7 +382,7 @@ pub fn write_content(bcx: @mut Block, let mut temp_cleanups = ~[]; for (i, element) in elements.iter().enumerate() { let lleltptr = GEPi(bcx, lldest, [i]); - debug2!("writing index {:?} with lleltptr={:?}", + debug!("writing index {:?} with lleltptr={:?}", i, bcx.val_to_str(lleltptr)); bcx = expr::trans_into(bcx, *element, SaveIn(lleltptr)); diff --git a/src/librustc/middle/trans/type_.rs b/src/librustc/middle/trans/type_.rs index efb85bc8df22..de41548895df 100644 --- a/src/librustc/middle/trans/type_.rs +++ b/src/librustc/middle/trans/type_.rs @@ -364,7 +364,7 @@ impl Type { Double => 64, X86_FP80 => 80, FP128 | PPC_FP128 => 128, - _ => fail2!("llvm_float_width called on a non-float type") + _ => fail!("llvm_float_width called on a non-float type") } } } diff --git a/src/librustc/middle/trans/type_of.rs b/src/librustc/middle/trans/type_of.rs index 8667d7224e79..2a8d16a2ceb8 100644 --- a/src/librustc/middle/trans/type_of.rs +++ b/src/librustc/middle/trans/type_of.rs @@ -172,7 +172,7 @@ pub fn sizing_type_of(cx: &mut CrateContext, t: ty::t) -> Type { // NB: If you update this, be sure to update `sizing_type_of()` as well. pub fn type_of(cx: &mut CrateContext, t: ty::t) -> Type { - debug2!("type_of {:?}: {:?}", t, ty::get(t)); + debug!("type_of {:?}: {:?}", t, ty::get(t)); // Check the cache. match cx.lltypes.find(&t) { diff --git a/src/librustc/middle/trans/write_guard.rs b/src/librustc/middle/trans/write_guard.rs index f6c1741a9bd6..577e0a28105f 100644 --- a/src/librustc/middle/trans/write_guard.rs +++ b/src/librustc/middle/trans/write_guard.rs @@ -39,7 +39,7 @@ pub fn root_and_write_guard(datum: &Datum, expr_id: ast::NodeId, derefs: uint) -> @mut Block { let key = root_map_key { id: expr_id, derefs: derefs }; - debug2!("write_guard::root_and_write_guard(key={:?})", key); + debug!("write_guard::root_and_write_guard(key={:?})", key); // root the autoderef'd value, if necessary: // @@ -66,7 +66,7 @@ pub fn return_to_mut(mut bcx: @mut Block, bits_val_ref: ValueRef, filename_val: ValueRef, line_val: ValueRef) -> @mut Block { - debug2!("write_guard::return_to_mut(root_key={:?}, {}, {}, {})", + debug!("write_guard::return_to_mut(root_key={:?}, {}, {}, {})", root_key, bcx.to_str(), bcx.val_to_str(frozen_val_ref), @@ -111,7 +111,7 @@ fn root(datum: &Datum, //! case, we will call this function, which will stash a copy //! away until we exit the scope `scope_id`. - debug2!("write_guard::root(root_key={:?}, root_info={:?}, datum={:?})", + debug!("write_guard::root(root_key={:?}, root_info={:?}, datum={:?})", root_key, root_info, datum.to_str(bcx.ccx())); if bcx.sess().trace() { @@ -184,7 +184,7 @@ fn root(datum: &Datum, fn perform_write_guard(datum: &Datum, bcx: @mut Block, span: Span) -> @mut Block { - debug2!("perform_write_guard"); + debug!("perform_write_guard"); let llval = datum.to_value_llval(bcx); let (filename, line) = filename_and_line_num_from_span(bcx, span); diff --git a/src/librustc/middle/ty.rs b/src/librustc/middle/ty.rs index 20a9fb8f7a94..39aa6c5e3963 100644 --- a/src/librustc/middle/ty.rs +++ b/src/librustc/middle/ty.rs @@ -1514,7 +1514,7 @@ pub fn fold_regions( fldr: &fn(r: Region, in_fn: bool) -> Region) -> t { fn do_fold(cx: ctxt, ty: t, in_fn: bool, fldr: &fn(Region, bool) -> Region) -> t { - debug2!("do_fold(ty={}, in_fn={})", ty_to_str(cx, ty), in_fn); + debug!("do_fold(ty={}, in_fn={})", ty_to_str(cx, ty), in_fn); if !type_has_regions(ty) { return ty; } fold_regions_and_ty( cx, ty, @@ -1655,7 +1655,7 @@ pub fn simd_type(cx: ctxt, ty: t) -> t { let fields = lookup_struct_fields(cx, did); lookup_field_type(cx, did, fields[0].id, substs) } - _ => fail2!("simd_type called on invalid type") + _ => fail!("simd_type called on invalid type") } } @@ -1665,14 +1665,14 @@ pub fn simd_size(cx: ctxt, ty: t) -> uint { let fields = lookup_struct_fields(cx, did); fields.len() } - _ => fail2!("simd_size called on invalid type") + _ => fail!("simd_size called on invalid type") } } pub fn get_element_type(ty: t, i: uint) -> t { match get(ty).sty { ty_tup(ref ts) => return ts[i], - _ => fail2!("get_element_type called on invalid type") + _ => fail!("get_element_type called on invalid type") } } @@ -2323,7 +2323,7 @@ pub fn type_contents(cx: ctxt, ty: t) -> TypeContents { let mut tc = TC_ALL; do each_inherited_builtin_bound(cx, bounds, traits) |bound| { - debug2!("tc = {}, bound = {:?}", tc.to_str(), bound); + debug!("tc = {}, bound = {:?}", tc.to_str(), bound); tc = tc - match bound { BoundStatic => TypeContents::nonstatic(cx), BoundSend => TypeContents::nonsendable(cx), @@ -2333,7 +2333,7 @@ pub fn type_contents(cx: ctxt, ty: t) -> TypeContents { }; } - debug2!("result = {}", tc.to_str()); + debug!("result = {}", tc.to_str()); return tc; // Iterates over all builtin bounds on the type parameter def, including @@ -2363,7 +2363,7 @@ pub fn type_moves_by_default(cx: ctxt, ty: t) -> bool { pub fn is_instantiable(cx: ctxt, r_ty: t) -> bool { fn type_requires(cx: ctxt, seen: &mut ~[DefId], r_ty: t, ty: t) -> bool { - debug2!("type_requires({}, {})?", + debug!("type_requires({}, {})?", ::util::ppaux::ty_to_str(cx, r_ty), ::util::ppaux::ty_to_str(cx, ty)); @@ -2372,7 +2372,7 @@ pub fn is_instantiable(cx: ctxt, r_ty: t) -> bool { subtypes_require(cx, seen, r_ty, ty) }; - debug2!("type_requires({}, {})? {}", + debug!("type_requires({}, {})? {}", ::util::ppaux::ty_to_str(cx, r_ty), ::util::ppaux::ty_to_str(cx, ty), r); @@ -2381,7 +2381,7 @@ pub fn is_instantiable(cx: ctxt, r_ty: t) -> bool { fn subtypes_require(cx: ctxt, seen: &mut ~[DefId], r_ty: t, ty: t) -> bool { - debug2!("subtypes_require({}, {})?", + debug!("subtypes_require({}, {})?", ::util::ppaux::ty_to_str(cx, r_ty), ::util::ppaux::ty_to_str(cx, ty)); @@ -2455,7 +2455,7 @@ pub fn is_instantiable(cx: ctxt, r_ty: t) -> bool { } }; - debug2!("subtypes_require({}, {})? {}", + debug!("subtypes_require({}, {})? {}", ::util::ppaux::ty_to_str(cx, r_ty), ::util::ppaux::ty_to_str(cx, ty), r); @@ -2472,7 +2472,7 @@ pub fn type_structurally_contains(cx: ctxt, test: &fn(x: &sty) -> bool) -> bool { let sty = &get(ty).sty; - debug2!("type_structurally_contains: {}", + debug!("type_structurally_contains: {}", ::util::ppaux::ty_to_str(cx, ty)); if test(sty) { return true; } match *sty { @@ -2819,7 +2819,7 @@ pub fn ty_fn_sig(fty: t) -> FnSig { ty_bare_fn(ref f) => f.sig.clone(), ty_closure(ref f) => f.sig.clone(), ref s => { - fail2!("ty_fn_sig() called on non-fn type: {:?}", s) + fail!("ty_fn_sig() called on non-fn type: {:?}", s) } } } @@ -2830,7 +2830,7 @@ pub fn ty_fn_args(fty: t) -> ~[t] { ty_bare_fn(ref f) => f.sig.inputs.clone(), ty_closure(ref f) => f.sig.inputs.clone(), ref s => { - fail2!("ty_fn_args() called on non-fn type: {:?}", s) + fail!("ty_fn_args() called on non-fn type: {:?}", s) } } } @@ -2839,7 +2839,7 @@ pub fn ty_closure_sigil(fty: t) -> Sigil { match get(fty).sty { ty_closure(ref f) => f.sigil, ref s => { - fail2!("ty_closure_sigil() called on non-closure type: {:?}", s) + fail!("ty_closure_sigil() called on non-closure type: {:?}", s) } } } @@ -2849,7 +2849,7 @@ pub fn ty_fn_purity(fty: t) -> ast::purity { ty_bare_fn(ref f) => f.purity, ty_closure(ref f) => f.purity, ref s => { - fail2!("ty_fn_purity() called on non-fn type: {:?}", s) + fail!("ty_fn_purity() called on non-fn type: {:?}", s) } } } @@ -2859,7 +2859,7 @@ pub fn ty_fn_ret(fty: t) -> t { ty_bare_fn(ref f) => f.sig.output, ty_closure(ref f) => f.sig.output, ref s => { - fail2!("ty_fn_ret() called on non-fn type: {:?}", s) + fail!("ty_fn_ret() called on non-fn type: {:?}", s) } } } @@ -2876,7 +2876,7 @@ pub fn ty_vstore(ty: t) -> vstore { match get(ty).sty { ty_evec(_, vstore) => vstore, ty_estr(vstore) => vstore, - ref s => fail2!("ty_vstore() called on invalid sty: {:?}", s) + ref s => fail!("ty_vstore() called on invalid sty: {:?}", s) } } @@ -3310,7 +3310,7 @@ pub fn expr_kind(tcx: ctxt, RvalueStmtExpr } - ast::ExprForLoop(*) => fail2!("non-desugared expr_for_loop"), + ast::ExprForLoop(*) => fail!("non-desugared expr_for_loop"), ast::ExprLogLevel | ast::ExprLit(_) | // Note: lit_str is carved out above @@ -3338,7 +3338,7 @@ pub fn stmt_node_id(s: &ast::Stmt) -> ast::NodeId { ast::StmtDecl(_, id) | StmtExpr(_, id) | StmtSemi(_, id) => { return id; } - ast::StmtMac(*) => fail2!("unexpanded macro in trans") + ast::StmtMac(*) => fail!("unexpanded macro in trans") } } @@ -3689,7 +3689,7 @@ fn lookup_locally_or_in_crate_store( } if def_id.crate == ast::LOCAL_CRATE { - fail2!("No def'n found for {:?} in tcx.{}", def_id, descr); + fail!("No def'n found for {:?} in tcx.{}", def_id, descr); } let v = load_external(); map.insert(def_id, v.clone()); @@ -3732,7 +3732,7 @@ pub fn impl_trait_ref(cx: ctxt, id: ast::DefId) -> Option<@TraitRef> { None => {} } let ret = if id.crate == ast::LOCAL_CRATE { - debug2!("(impl_trait_ref) searching for trait impl {:?}", id); + debug!("(impl_trait_ref) searching for trait impl {:?}", id); match cx.items.find(&id.node) { Some(&ast_map::node_item(@ast::item { node: ast::item_impl(_, ref opt_trait, _, _), @@ -4491,7 +4491,7 @@ pub fn each_bound_trait_and_supertraits(tcx: ctxt, // Add the given trait ty to the hash map while i < trait_refs.len() { - debug2!("each_bound_trait_and_supertraits(i={:?}, trait_ref={})", + debug!("each_bound_trait_and_supertraits(i={:?}, trait_ref={})", i, trait_refs[i].repr(tcx)); if !f(trait_refs[i]) { @@ -4501,7 +4501,7 @@ pub fn each_bound_trait_and_supertraits(tcx: ctxt, // Add supertraits to supertrait_set let supertrait_refs = trait_ref_supertraits(tcx, trait_refs[i]); for &supertrait_ref in supertrait_refs.iter() { - debug2!("each_bound_trait_and_supertraits(supertrait_ref={})", + debug!("each_bound_trait_and_supertraits(supertrait_ref={})", supertrait_ref.repr(tcx)); let d_id = supertrait_ref.def_id; diff --git a/src/librustc/middle/typeck/astconv.rs b/src/librustc/middle/typeck/astconv.rs index fdf0a094dc07..ccda6bbaf9d1 100644 --- a/src/librustc/middle/typeck/astconv.rs +++ b/src/librustc/middle/typeck/astconv.rs @@ -636,7 +636,7 @@ fn ty_of_method_or_bare_fn( opt_self_info: Option<&SelfInfo>, decl: &ast::fn_decl) -> (Option>, ty::BareFnTy) { - debug2!("ty_of_bare_fn"); + debug!("ty_of_bare_fn"); // new region names that appear inside of the fn decl are bound to // that function type @@ -717,7 +717,7 @@ pub fn ty_of_closure( // names or they are provided, but not both. assert!(lifetimes.is_empty() || expected_sig.is_none()); - debug2!("ty_of_fn_decl"); + debug!("ty_of_fn_decl"); let _i = indenter(); // resolve the function bound region in the original region diff --git a/src/librustc/middle/typeck/check/_match.rs b/src/librustc/middle/typeck/check/_match.rs index 545a487ab441..25048d888fa8 100644 --- a/src/librustc/middle/typeck/check/_match.rs +++ b/src/librustc/middle/typeck/check/_match.rs @@ -428,8 +428,8 @@ pub fn check_pat(pcx: &pat_ctxt, pat: @ast::Pat, expected: ty::t) { fcx.infcx().resolve_type_vars_if_possible(fcx.expr_ty(begin)); let e_ty = fcx.infcx().resolve_type_vars_if_possible(fcx.expr_ty(end)); - debug2!("pat_range beginning type: {:?}", b_ty); - debug2!("pat_range ending type: {:?}", e_ty); + debug!("pat_range beginning type: {:?}", b_ty); + debug!("pat_range ending type: {:?}", e_ty); if !require_same_types( tcx, Some(fcx.infcx()), false, pat.span, b_ty, e_ty, || ~"mismatched types in range") @@ -488,7 +488,7 @@ pub fn check_pat(pcx: &pat_ctxt, pat: @ast::Pat, expected: ty::t) { } fcx.write_ty(pat.id, typ); - debug2!("(checking match) writing type for pat id {}", pat.id); + debug!("(checking match) writing type for pat id {}", pat.id); match sub { Some(p) => check_pat(pcx, p, expected), diff --git a/src/librustc/middle/typeck/check/method.rs b/src/librustc/middle/typeck/check/method.rs index e0df9bf1cfc9..f6efd3aa5ad1 100644 --- a/src/librustc/middle/typeck/check/method.rs +++ b/src/librustc/middle/typeck/check/method.rs @@ -151,18 +151,18 @@ pub fn lookup( }; let self_ty = structurally_resolved_type(fcx, self_expr.span, self_ty); - debug2!("method lookup(self_ty={}, expr={}, self_expr={})", + debug!("method lookup(self_ty={}, expr={}, self_expr={})", self_ty.repr(fcx.tcx()), expr.repr(fcx.tcx()), self_expr.repr(fcx.tcx())); - debug2!("searching inherent candidates"); + debug!("searching inherent candidates"); lcx.push_inherent_candidates(self_ty); let mme = lcx.search(self_ty); if mme.is_some() { return mme; } - debug2!("searching extension candidates"); + debug!("searching extension candidates"); lcx.reset_candidates(); lcx.push_bound_candidates(self_ty); lcx.push_extension_candidates(); @@ -215,7 +215,7 @@ impl<'self> LookupContext<'self> { let mut self_ty = self_ty; let mut autoderefs = 0; loop { - debug2!("loop: self_ty={} autoderefs={}", + debug!("loop: self_ty={} autoderefs={}", self.ty_to_str(self_ty), autoderefs); match self.deref_args { @@ -397,7 +397,7 @@ impl<'self> LookupContext<'self> { fn push_inherent_candidates_from_object(&self, did: DefId, substs: &ty::substs) { - debug2!("push_inherent_candidates_from_object(did={}, substs={})", + debug!("push_inherent_candidates_from_object(did={}, substs={})", self.did_to_str(did), substs_to_str(self.tcx(), substs)); let _indenter = indenter(); @@ -446,7 +446,7 @@ impl<'self> LookupContext<'self> { fn push_inherent_candidates_from_param(&self, rcvr_ty: ty::t, param_ty: param_ty) { - debug2!("push_inherent_candidates_from_param(param_ty={:?})", + debug!("push_inherent_candidates_from_param(param_ty={:?})", param_ty); let _indenter = indenter(); @@ -523,11 +523,11 @@ impl<'self> LookupContext<'self> { let cand = mk_cand(bound_trait_ref, method, pos, this_bound_idx); - debug2!("pushing inherent candidate for param: {:?}", cand); + debug!("pushing inherent candidate for param: {:?}", cand); self.inherent_candidates.push(cand); } None => { - debug2!("trait doesn't contain method: {:?}", + debug!("trait doesn't contain method: {:?}", bound_trait_ref.def_id); // check next trait or bound } @@ -557,7 +557,7 @@ impl<'self> LookupContext<'self> { if !self.impl_dups.insert(impl_info.did) { return; // already visited } - debug2!("push_candidates_from_impl: {} {} {}", + debug!("push_candidates_from_impl: {} {} {}", token::interner_get(self.m_name), impl_info.ident.repr(self.tcx()), impl_info.methods.map(|m| m.ident).repr(self.tcx())); @@ -603,7 +603,7 @@ impl<'self> LookupContext<'self> { match self.search_for_method(self_ty) { None => None, Some(mme) => { - debug2!("(searching for autoderef'd method) writing \ + debug!("(searching for autoderef'd method) writing \ adjustment ({}) to {}", autoderefs, self.self_expr.id); @@ -832,14 +832,14 @@ impl<'self> LookupContext<'self> { fn search_for_method(&self, rcvr_ty: ty::t) -> Option { - debug2!("search_for_method(rcvr_ty={})", self.ty_to_str(rcvr_ty)); + debug!("search_for_method(rcvr_ty={})", self.ty_to_str(rcvr_ty)); let _indenter = indenter(); // I am not sure that inherent methods should have higher // priority, but it is necessary ATM to handle some of the // existing code. - debug2!("searching inherent candidates"); + debug!("searching inherent candidates"); match self.consider_candidates(rcvr_ty, self.inherent_candidates) { None => {} Some(mme) => { @@ -847,7 +847,7 @@ impl<'self> LookupContext<'self> { } } - debug2!("searching extension candidates"); + debug!("searching extension candidates"); match self.consider_candidates(rcvr_ty, self.extension_candidates) { None => { return None; @@ -896,7 +896,7 @@ impl<'self> LookupContext<'self> { let mut j = i + 1; while j < candidates.len() { let candidate_b = &candidates[j]; - debug2!("attempting to merge {:?} and {:?}", + debug!("attempting to merge {:?} and {:?}", candidate_a, candidate_b); let candidates_same = match (&candidate_a.origin, &candidate_b.origin) { @@ -936,7 +936,7 @@ impl<'self> LookupContext<'self> { let tcx = self.tcx(); let fty = ty::mk_bare_fn(tcx, candidate.method_ty.fty.clone()); - debug2!("confirm_candidate(expr={}, candidate={}, fty={})", + debug!("confirm_candidate(expr={}, candidate={}, fty={})", self.expr.repr(tcx), self.cand_to_str(candidate), self.ty_to_str(fty)); @@ -992,11 +992,11 @@ impl<'self> LookupContext<'self> { }; // Compute the method type with type parameters substituted - debug2!("fty={} all_substs={}", + debug!("fty={} all_substs={}", self.ty_to_str(fty), ty::substs_to_str(tcx, &all_substs)); let fty = ty::subst(tcx, &all_substs, fty); - debug2!("after subst, fty={}", self.ty_to_str(fty)); + debug!("after subst, fty={}", self.ty_to_str(fty)); // Replace any bound regions that appear in the function // signature with region variables @@ -1019,7 +1019,7 @@ impl<'self> LookupContext<'self> { purity: bare_fn_ty.purity, abis: bare_fn_ty.abis.clone(), }); - debug2!("after replacing bound regions, fty={}", self.ty_to_str(fty)); + debug!("after replacing bound regions, fty={}", self.ty_to_str(fty)); let self_mode = get_mode_from_explicit_self(candidate.method_ty.explicit_self); @@ -1189,12 +1189,12 @@ impl<'self> LookupContext<'self> { // `rcvr_ty` is the type of the expression. It may be a subtype of a // candidate method's `self_ty`. fn is_relevant(&self, rcvr_ty: ty::t, candidate: &Candidate) -> bool { - debug2!("is_relevant(rcvr_ty={}, candidate={})", + debug!("is_relevant(rcvr_ty={}, candidate={})", self.ty_to_str(rcvr_ty), self.cand_to_str(candidate)); return match candidate.method_ty.explicit_self { sty_static => { - debug2!("(is relevant?) explicit self is static"); + debug!("(is relevant?) explicit self is static"); false } @@ -1203,7 +1203,7 @@ impl<'self> LookupContext<'self> { } sty_region(_, m) => { - debug2!("(is relevant?) explicit self is a region"); + debug!("(is relevant?) explicit self is a region"); match ty::get(rcvr_ty).sty { ty::ty_rptr(_, mt) => { mutability_matches(mt.mutbl, m) && @@ -1220,7 +1220,7 @@ impl<'self> LookupContext<'self> { } sty_box(m) => { - debug2!("(is relevant?) explicit self is a box"); + debug!("(is relevant?) explicit self is a box"); match ty::get(rcvr_ty).sty { ty::ty_box(mt) => { mutability_matches(mt.mutbl, m) && @@ -1237,7 +1237,7 @@ impl<'self> LookupContext<'self> { } sty_uniq => { - debug2!("(is relevant?) explicit self is a unique pointer"); + debug!("(is relevant?) explicit self is a unique pointer"); match ty::get(rcvr_ty).sty { ty::ty_uniq(mt) => { rcvr_matches_ty(self.fcx, mt.ty, candidate) @@ -1310,7 +1310,7 @@ impl<'self> LookupContext<'self> { match self.tcx().items.find(&did.node) { Some(&ast_map::node_method(m, _, _)) | Some(&ast_map::node_trait_method(@ast::provided(m), _, _)) => m.span, - _ => fail2!("report_static_candidate: bad item {:?}", did) + _ => fail!("report_static_candidate: bad item {:?}", did) } } else { self.expr.span diff --git a/src/librustc/middle/typeck/check/mod.rs b/src/librustc/middle/typeck/check/mod.rs index 627216ea7b77..eddf8aa51850 100644 --- a/src/librustc/middle/typeck/check/mod.rs +++ b/src/librustc/middle/typeck/check/mod.rs @@ -362,7 +362,7 @@ impl Visitor<()> for GatherLocalsVisitor { _ => Some(self.fcx.to_ty(&local.ty)) }; self.assign(local.id, o_ty); - debug2!("Local variable {} is assigned type {}", + debug!("Local variable {} is assigned type {}", self.fcx.pat_to_str(local.pat), self.fcx.infcx().ty_to_str( self.fcx.inh.locals.get_copy(&local.id))); @@ -375,7 +375,7 @@ impl Visitor<()> for GatherLocalsVisitor { ast::PatIdent(_, ref path, _) if pat_util::pat_is_binding(self.fcx.ccx.tcx.def_map, p) => { self.assign(p.id, None); - debug2!("Pattern binding {} is assigned to {}", + debug!("Pattern binding {} is assigned to {}", self.tcx.sess.str_of(path.segments[0].identifier), self.fcx.infcx().ty_to_str( self.fcx.inh.locals.get_copy(&p.id))); @@ -450,7 +450,7 @@ pub fn check_fn(ccx: @mut CrateCtxt, let arg_tys = fn_sig.inputs.map(|a| *a); let ret_ty = fn_sig.output; - debug2!("check_fn(arg_tys={:?}, ret_ty={:?}, opt_self_ty={:?})", + debug!("check_fn(arg_tys={:?}, ret_ty={:?}, opt_self_ty={:?})", arg_tys.map(|&a| ppaux::ty_to_str(tcx, a)), ppaux::ty_to_str(tcx, ret_ty), opt_self_info.map(|si| ppaux::ty_to_str(tcx, si.self_ty))); @@ -510,7 +510,7 @@ pub fn check_fn(ccx: @mut CrateCtxt, // Add the self parameter for self_info in opt_self_info.iter() { visit.assign(self_info.self_id, Some(self_info.self_ty)); - debug2!("self is assigned to {}", + debug!("self is assigned to {}", fcx.infcx().ty_to_str( fcx.inh.locals.get_copy(&self_info.self_id))); } @@ -588,7 +588,7 @@ pub fn check_struct(ccx: @mut CrateCtxt, id: ast::NodeId, span: Span) { } pub fn check_item(ccx: @mut CrateCtxt, it: @ast::item) { - debug2!("check_item(it.id={}, it.ident={})", + debug!("check_item(it.id={}, it.ident={})", it.id, ty::item_path_str(ccx.tcx, local_def(it.id))); let _indenter = indenter(); @@ -606,7 +606,7 @@ pub fn check_item(ccx: @mut CrateCtxt, it: @ast::item) { } ast::item_impl(_, _, _, ref ms) => { let rp = ccx.tcx.region_paramd_items.find(&it.id).map(|x| *x); - debug2!("item_impl {} with id {} rp {:?}", + debug!("item_impl {} with id {} rp {:?}", ccx.tcx.sess.str_of(it.ident), it.id, rp); for m in ms.iter() { check_method(ccx, *m); @@ -742,14 +742,14 @@ impl FnCtxt { #[inline] pub fn write_ty(&self, node_id: ast::NodeId, ty: ty::t) { - debug2!("write_ty({}, {}) in fcx {}", + debug!("write_ty({}, {}) in fcx {}", node_id, ppaux::ty_to_str(self.tcx(), ty), self.tag()); self.inh.node_types.insert(node_id, ty); } pub fn write_substs(&self, node_id: ast::NodeId, substs: ty::substs) { if !ty::substs_is_noop(&substs) { - debug2!("write_substs({}, {}) in fcx {}", + debug!("write_substs({}, {}) in fcx {}", node_id, ty::substs_to_str(self.tcx(), &substs), self.tag()); @@ -781,7 +781,7 @@ impl FnCtxt { pub fn write_adjustment(&self, node_id: ast::NodeId, adj: @ty::AutoAdjustment) { - debug2!("write_adjustment(node_id={:?}, adj={:?})", node_id, adj); + debug!("write_adjustment(node_id={:?}, adj={:?})", node_id, adj); self.inh.adjustments.insert(node_id, adj); } @@ -1306,7 +1306,7 @@ pub fn check_expr_with_unifier(fcx: @mut FnCtxt, expr: @ast::Expr, expected: Option, unifier: &fn()) { - debug2!(">> typechecking"); + debug!(">> typechecking"); fn check_method_argument_types( fcx: @mut FnCtxt, @@ -1384,7 +1384,7 @@ pub fn check_expr_with_unifier(fcx: @mut FnCtxt, vec::from_elem(supplied_arg_count, ty::mk_err()) }; - debug2!("check_argument_types: formal_tys={:?}", + debug!("check_argument_types: formal_tys={:?}", formal_tys.map(|t| fcx.infcx().ty_to_str(*t))); // Check the arguments. @@ -1396,7 +1396,7 @@ pub fn check_expr_with_unifier(fcx: @mut FnCtxt, let xs = [false, true]; for check_blocks in xs.iter() { let check_blocks = *check_blocks; - debug2!("check_blocks={}", check_blocks); + debug!("check_blocks={}", check_blocks); // More awful hacks: before we check the blocks, try to do // an "opportunistic" vtable resolution of any trait @@ -1413,7 +1413,7 @@ pub fn check_expr_with_unifier(fcx: @mut FnCtxt, }; if is_block == check_blocks { - debug2!("checking the argument"); + debug!("checking the argument"); let mut formal_ty = formal_tys[i]; match deref_args { @@ -1567,7 +1567,7 @@ pub fn check_expr_with_unifier(fcx: @mut FnCtxt, method_map.insert(expr.id, (*entry)); } None => { - debug2!("(checking method call) failing expr is {}", expr.id); + debug!("(checking method call) failing expr is {}", expr.id); fcx.type_error_message(expr.span, |actual| { @@ -1921,7 +1921,7 @@ pub fn check_expr_with_unifier(fcx: @mut FnCtxt, ty::mk_closure(tcx, fn_ty_copy) }; - debug2!("check_expr_fn_with_unifier fty={}", + debug!("check_expr_fn_with_unifier fty={}", fcx.infcx().ty_to_str(fty)); fcx.write_ty(expr.id, fty); @@ -1955,7 +1955,7 @@ pub fn check_expr_with_unifier(fcx: @mut FnCtxt, // (1) verify that the class id actually has a field called // field - debug2!("class named {}", ppaux::ty_to_str(tcx, base_t)); + debug!("class named {}", ppaux::ty_to_str(tcx, base_t)); let cls_items = ty::lookup_struct_fields(tcx, base_id); match lookup_field_ty(tcx, base_id, cls_items, field, &(*substs)) { @@ -2570,7 +2570,7 @@ pub fn check_expr_with_unifier(fcx: @mut FnCtxt, } } ast::ExprForLoop(*) => - fail2!("non-desugared expr_for_loop"), + fail!("non-desugared expr_for_loop"), ast::ExprLoop(ref body, _) => { check_block_no_value(fcx, (body)); if !may_break(tcx, expr.id, body) { @@ -2618,7 +2618,7 @@ pub fn check_expr_with_unifier(fcx: @mut FnCtxt, demand::suptype(fcx, b.span, inner_ty, fcx.expr_ty(b)); } // argh - _ => fail2!("expected fn ty") + _ => fail!("expected fn ty") } fcx.write_ty(expr.id, fcx.node_ty(b.id)); } @@ -2662,8 +2662,8 @@ pub fn check_expr_with_unifier(fcx: @mut FnCtxt, let t_1 = fcx.to_ty(t); let t_e = fcx.expr_ty(e); - debug2!("t_1={}", fcx.infcx().ty_to_str(t_1)); - debug2!("t_e={}", fcx.infcx().ty_to_str(t_e)); + debug!("t_1={}", fcx.infcx().ty_to_str(t_1)); + debug!("t_e={}", fcx.infcx().ty_to_str(t_e)); if ty::type_is_error(t_e) { fcx.write_error(id); @@ -2892,9 +2892,9 @@ pub fn check_expr_with_unifier(fcx: @mut FnCtxt, } } - debug2!("type of expr({}) {} is...", expr.id, + debug!("type of expr({}) {} is...", expr.id, syntax::print::pprust::expr_to_str(expr, tcx.sess.intr())); - debug2!("... {}, expected is {}", + debug!("... {}, expected is {}", ppaux::ty_to_str(tcx, fcx.expr_ty(expr)), match expected { Some(t) => ppaux::ty_to_str(tcx, t), @@ -3175,7 +3175,7 @@ pub fn check_enum_variants(ccx: @mut CrateCtxt, match v.node.disr_expr { Some(e) => { - debug2!("disr expr, checking {}", pprust::expr_to_str(e, ccx.tcx.sess.intr())); + debug!("disr expr, checking {}", pprust::expr_to_str(e, ccx.tcx.sess.intr())); let fcx = blank_fn_ctxt(ccx, rty, e.id); let declty = ty::mk_int_var(ccx.tcx, fcx.infcx().next_int_var_id()); @@ -3305,7 +3305,7 @@ pub fn instantiate_path(fcx: @mut FnCtxt, def: ast::Def, span: Span, node_id: ast::NodeId) { - debug2!(">>> instantiate_path"); + debug!(">>> instantiate_path"); let ty_param_count = tpt.generics.type_param_defs.len(); let mut ty_substs_len = 0; @@ -3313,7 +3313,7 @@ pub fn instantiate_path(fcx: @mut FnCtxt, ty_substs_len += segment.types.len() } - debug2!("tpt={} ty_param_count={:?} ty_substs_len={:?}", + debug!("tpt={} ty_param_count={:?} ty_substs_len={:?}", tpt.repr(fcx.tcx()), ty_param_count, ty_substs_len); @@ -3412,7 +3412,7 @@ pub fn instantiate_path(fcx: @mut FnCtxt, }; fcx.write_ty_substs(node_id, tpt.ty, substs); - debug2!("<<<"); + debug!("<<<"); } // Resolves `typ` by a single level if `typ` is a type variable. If no @@ -3508,7 +3508,7 @@ pub fn check_bounds_are_used(ccx: @mut CrateCtxt, span: Span, tps: &OptVec, ty: ty::t) { - debug2!("check_bounds_are_used(n_tps={}, ty={})", + debug!("check_bounds_are_used(n_tps={}, ty={})", tps.len(), ppaux::ty_to_str(ccx.tcx, ty)); // make a vector of booleans initially false, set to true when used @@ -3521,7 +3521,7 @@ pub fn check_bounds_are_used(ccx: @mut CrateCtxt, |t| { match ty::get(t).sty { ty::ty_param(param_ty {idx, _}) => { - debug2!("Found use of ty param \\#{}", idx); + debug!("Found use of ty param \\#{}", idx); tps_used[idx] = true; } _ => () diff --git a/src/librustc/middle/typeck/check/regionck.rs b/src/librustc/middle/typeck/check/regionck.rs index edc2947d8900..06a130594623 100644 --- a/src/librustc/middle/typeck/check/regionck.rs +++ b/src/librustc/middle/typeck/check/regionck.rs @@ -211,7 +211,7 @@ fn visit_local(rcx: &mut Rcx, l: @ast::Local) { fn constrain_bindings_in_pat(pat: @ast::Pat, rcx: &mut Rcx) { let tcx = rcx.fcx.tcx(); - debug2!("regionck::visit_pat(pat={})", pat.repr(tcx)); + debug!("regionck::visit_pat(pat={})", pat.repr(tcx)); do pat_util::pat_bindings(tcx.def_map, pat) |_, id, span, _| { // If we have a variable that contains region'd data, that // data will be accessible from anywhere that the variable is @@ -244,7 +244,7 @@ fn constrain_bindings_in_pat(pat: @ast::Pat, rcx: &mut Rcx) { } fn visit_expr(rcx: &mut Rcx, expr: @ast::Expr) { - debug2!("regionck::visit_expr(e={}, repeating_scope={:?})", + debug!("regionck::visit_expr(e={}, repeating_scope={:?})", expr.repr(rcx.fcx.tcx()), rcx.repeating_scope); let has_method_map = rcx.fcx.inh.method_map.contains_key(&expr.id); @@ -302,7 +302,7 @@ fn visit_expr(rcx: &mut Rcx, expr: @ast::Expr) { { let r = rcx.fcx.inh.adjustments.find(&expr.id); for &adjustment in r.iter() { - debug2!("adjustment={:?}", adjustment); + debug!("adjustment={:?}", adjustment); match *adjustment { @ty::AutoDerefRef( ty::AutoDerefRef {autoderefs: autoderefs, autoref: opt_autoref}) => @@ -535,7 +535,7 @@ fn constrain_call(rcx: &mut Rcx, //! appear in the arguments appropriately. let tcx = rcx.fcx.tcx(); - debug2!("constrain_call(call_expr={}, implicitly_ref_args={:?})", + debug!("constrain_call(call_expr={}, implicitly_ref_args={:?})", call_expr.repr(tcx), implicitly_ref_args); let callee_ty = rcx.resolve_node_type(callee_id); if ty::type_is_error(callee_ty) { @@ -597,7 +597,7 @@ fn constrain_derefs(rcx: &mut Rcx, let tcx = rcx.fcx.tcx(); let r_deref_expr = ty::re_scope(deref_expr.id); for i in range(0u, derefs) { - debug2!("constrain_derefs(deref_expr=?, derefd_ty={}, derefs={:?}/{:?}", + debug!("constrain_derefs(deref_expr=?, derefd_ty={}, derefs={:?}/{:?}", rcx.fcx.infcx().ty_to_str(derefd_ty), i, derefs); @@ -638,7 +638,7 @@ fn constrain_index(rcx: &mut Rcx, * includes the deref expr. */ - debug2!("constrain_index(index_expr=?, indexed_ty={}", + debug!("constrain_index(index_expr=?, indexed_ty={}", rcx.fcx.infcx().ty_to_str(indexed_ty)); let r_index_expr = ty::re_scope(index_expr.id); @@ -662,13 +662,13 @@ fn constrain_free_variables(rcx: &mut Rcx, */ let tcx = rcx.fcx.ccx.tcx; - debug2!("constrain_free_variables({}, {})", + debug!("constrain_free_variables({}, {})", region.repr(tcx), expr.repr(tcx)); for freevar in get_freevars(tcx, expr.id).iter() { - debug2!("freevar def is {:?}", freevar.def); + debug!("freevar def is {:?}", freevar.def); let def = freevar.def; let en_region = encl_region_of_def(rcx.fcx, def); - debug2!("en_region = {}", en_region.repr(tcx)); + debug!("en_region = {}", en_region.repr(tcx)); rcx.fcx.mk_subr(true, infer::FreeVariable(freevar.span), region, en_region); } @@ -692,7 +692,7 @@ fn constrain_regions_in_type_of_node( let ty0 = rcx.resolve_node_type(id); let adjustment = rcx.fcx.inh.adjustments.find_copy(&id); let ty = ty::adjust_ty(tcx, origin.span(), ty0, adjustment); - debug2!("constrain_regions_in_type_of_node(\ + debug!("constrain_regions_in_type_of_node(\ ty={}, ty0={}, id={}, minimum_lifetime={:?}, adjustment={:?})", ty_to_str(tcx, ty), ty_to_str(tcx, ty0), id, minimum_lifetime, adjustment); @@ -722,12 +722,12 @@ fn constrain_regions_in_type( let e = rcx.errors_reported; let tcx = rcx.fcx.ccx.tcx; - debug2!("constrain_regions_in_type(minimum_lifetime={}, ty={})", + debug!("constrain_regions_in_type(minimum_lifetime={}, ty={})", region_to_str(tcx, "", false, minimum_lifetime), ty_to_str(tcx, ty)); do relate_nested_regions(tcx, Some(minimum_lifetime), ty) |r_sub, r_sup| { - debug2!("relate(r_sub={}, r_sup={})", + debug!("relate(r_sub={}, r_sup={})", region_to_str(tcx, "", false, r_sub), region_to_str(tcx, "", false, r_sup)); @@ -813,7 +813,7 @@ pub mod guarantor { * to the lifetime of its guarantor (if any). */ - debug2!("guarantor::for_addr_of(base=?)"); + debug!("guarantor::for_addr_of(base=?)"); let guarantor = guarantor(rcx, base); link(rcx, expr.span, expr.id, guarantor); @@ -826,9 +826,9 @@ pub mod guarantor { * linked to the lifetime of its guarantor (if any). */ - debug2!("regionck::for_match()"); + debug!("regionck::for_match()"); let discr_guarantor = guarantor(rcx, discr); - debug2!("discr_guarantor={}", discr_guarantor.repr(rcx.tcx())); + debug!("discr_guarantor={}", discr_guarantor.repr(rcx.tcx())); for arm in arms.iter() { for pat in arm.pats.iter() { link_ref_bindings_in_pat(rcx, *pat, discr_guarantor); @@ -847,10 +847,10 @@ pub mod guarantor { * region pointers. */ - debug2!("guarantor::for_autoref(autoref={:?})", autoref); + debug!("guarantor::for_autoref(autoref={:?})", autoref); let mut expr_ct = categorize_unadjusted(rcx, expr); - debug2!(" unadjusted cat={:?}", expr_ct.cat); + debug!(" unadjusted cat={:?}", expr_ct.cat); expr_ct = apply_autoderefs( rcx, expr, autoderefs, expr_ct); @@ -898,10 +898,10 @@ pub mod guarantor { */ let tcx = rcx.tcx(); - debug2!("guarantor::for_by_ref(expr={}, callee_scope={:?})", + debug!("guarantor::for_by_ref(expr={}, callee_scope={:?})", expr.repr(tcx), callee_scope); let expr_cat = categorize(rcx, expr); - debug2!("guarantor::for_by_ref(expr={:?}, callee_scope={:?}) category={:?}", + debug!("guarantor::for_by_ref(expr={:?}, callee_scope={:?}) category={:?}", expr.id, callee_scope, expr_cat); let minimum_lifetime = ty::re_scope(callee_scope); for guarantor in expr_cat.guarantor.iter() { @@ -921,7 +921,7 @@ pub mod guarantor { * to the lifetime of its guarantor (if any). */ - debug2!("link(id={:?}, guarantor={:?})", id, guarantor); + debug!("link(id={:?}, guarantor={:?})", id, guarantor); let bound = match guarantor { None => { @@ -939,7 +939,7 @@ pub mod guarantor { let rptr_ty = rcx.resolve_node_type(id); if !ty::type_is_bot(rptr_ty) { let tcx = rcx.fcx.ccx.tcx; - debug2!("rptr_ty={}", ty_to_str(tcx, rptr_ty)); + debug!("rptr_ty={}", ty_to_str(tcx, rptr_ty)); let r = ty::ty_region(tcx, span, rptr_ty); rcx.fcx.mk_subr(true, infer::Reborrow(span), r, bound); } @@ -977,7 +977,7 @@ pub mod guarantor { * `&expr`). */ - debug2!("guarantor()"); + debug!("guarantor()"); match expr.node { ast::ExprUnary(_, ast::UnDeref, b) => { let cat = categorize(rcx, b); @@ -1035,15 +1035,15 @@ pub mod guarantor { rcx.fcx.tcx(), rcx.fcx.inh.method_map, expr)); None } - ast::ExprForLoop(*) => fail2!("non-desugared expr_for_loop"), + ast::ExprForLoop(*) => fail!("non-desugared expr_for_loop"), } } fn categorize(rcx: &mut Rcx, expr: @ast::Expr) -> ExprCategorization { - debug2!("categorize()"); + debug!("categorize()"); let mut expr_ct = categorize_unadjusted(rcx, expr); - debug2!("before adjustments, cat={:?}", expr_ct.cat); + debug!("before adjustments, cat={:?}", expr_ct.cat); match rcx.fcx.inh.adjustments.find(&expr.id) { Some(&@ty::AutoAddEnv(*)) => { @@ -1056,7 +1056,7 @@ pub mod guarantor { } Some(&@ty::AutoDerefRef(ref adjustment)) => { - debug2!("adjustment={:?}", adjustment); + debug!("adjustment={:?}", adjustment); expr_ct = apply_autoderefs( rcx, expr, adjustment.autoderefs, expr_ct); @@ -1067,7 +1067,7 @@ pub mod guarantor { Some(ty::AutoUnsafe(_)) => { expr_ct.cat.guarantor = None; expr_ct.cat.pointer = OtherPointer; - debug2!("autoref, cat={:?}", expr_ct.cat); + debug!("autoref, cat={:?}", expr_ct.cat); } Some(ty::AutoPtr(r, _)) | Some(ty::AutoBorrowVec(r, _)) | @@ -1078,7 +1078,7 @@ pub mod guarantor { // expression will be some sort of borrowed pointer. expr_ct.cat.guarantor = None; expr_ct.cat.pointer = BorrowedPointer(r); - debug2!("autoref, cat={:?}", expr_ct.cat); + debug!("autoref, cat={:?}", expr_ct.cat); } } } @@ -1086,14 +1086,14 @@ pub mod guarantor { None => {} } - debug2!("result={:?}", expr_ct.cat); + debug!("result={:?}", expr_ct.cat); return expr_ct.cat; } fn categorize_unadjusted(rcx: &mut Rcx, expr: @ast::Expr) -> ExprCategorizationType { - debug2!("categorize_unadjusted()"); + debug!("categorize_unadjusted()"); let guarantor = { if rcx.fcx.inh.method_map.contains_key(&expr.id) { @@ -1143,7 +1143,7 @@ pub mod guarantor { } } - debug2!("autoderef, cat={:?}", ct.cat); + debug!("autoderef, cat={:?}", ct.cat); } return ct; } @@ -1205,7 +1205,7 @@ pub mod guarantor { * other pointers. */ - debug2!("link_ref_bindings_in_pat(pat={}, guarantor={:?})", + debug!("link_ref_bindings_in_pat(pat={}, guarantor={:?})", rcx.fcx.pat_to_str(pat), guarantor); match pat.node { diff --git a/src/librustc/middle/typeck/check/regionmanip.rs b/src/librustc/middle/typeck/check/regionmanip.rs index b4ac7aaa6d22..9ba709f76510 100644 --- a/src/librustc/middle/typeck/check/regionmanip.rs +++ b/src/librustc/middle/typeck/check/regionmanip.rs @@ -34,7 +34,7 @@ pub fn replace_bound_regions_in_fn_sig( for &t in opt_self_ty.iter() { all_tys.push(t) } - debug2!("replace_bound_regions_in_fn_sig(self_ty={:?}, fn_sig={}, \ + debug!("replace_bound_regions_in_fn_sig(self_ty={:?}, fn_sig={}, \ all_tys={:?})", opt_self_ty.map(|t| ppaux::ty_to_str(tcx, t)), ppaux::fn_sig_to_str(tcx, fn_sig), @@ -42,7 +42,7 @@ pub fn replace_bound_regions_in_fn_sig( let _i = indenter(); let isr = do create_bound_region_mapping(tcx, isr, all_tys) |br| { - debug2!("br={:?}", br); + debug!("br={:?}", br); mapf(br) }; let new_fn_sig = ty::fold_sig(fn_sig, |t| { @@ -50,7 +50,7 @@ pub fn replace_bound_regions_in_fn_sig( }); let new_self_ty = opt_self_ty.map(|t| replace_bound_regions(tcx, isr, t)); - debug2!("result of replace_bound_regions_in_fn_sig: \ + debug!("result of replace_bound_regions_in_fn_sig: \ new_self_ty={:?}, \ fn_sig={}", new_self_ty.map(|t| ppaux::ty_to_str(tcx, t)), @@ -251,7 +251,7 @@ pub fn relate_free_regions( * Tests: `src/test/compile-fail/regions-free-region-ordering-*.rs` */ - debug2!("relate_free_regions >>"); + debug!("relate_free_regions >>"); let mut all_tys = ~[]; for arg in fn_sig.inputs.iter() { @@ -262,7 +262,7 @@ pub fn relate_free_regions( } for &t in all_tys.iter() { - debug2!("relate_free_regions(t={})", ppaux::ty_to_str(tcx, t)); + debug!("relate_free_regions(t={})", ppaux::ty_to_str(tcx, t)); relate_nested_regions(tcx, None, t, |a, b| { match (&a, &b) { (&ty::re_free(free_a), &ty::re_free(free_b)) => { @@ -273,5 +273,5 @@ pub fn relate_free_regions( }) } - debug2!("<< relate_free_regions"); + debug!("<< relate_free_regions"); } diff --git a/src/librustc/middle/typeck/check/vtable.rs b/src/librustc/middle/typeck/check/vtable.rs index 46805af8938a..3c4ff35b768d 100644 --- a/src/librustc/middle/typeck/check/vtable.rs +++ b/src/librustc/middle/typeck/check/vtable.rs @@ -87,7 +87,7 @@ fn lookup_vtables(vcx: &VtableContext, type_param_defs: &[ty::TypeParameterDef], substs: &ty::substs, is_early: bool) -> vtable_res { - debug2!("lookup_vtables(location_info={:?}, \ + debug!("lookup_vtables(location_info={:?}, \ type_param_defs={}, \ substs={}", location_info, @@ -108,7 +108,7 @@ fn lookup_vtables(vcx: &VtableContext, result.reverse(); assert_eq!(substs.tps.len(), result.len()); - debug2!("lookup_vtables result(\ + debug!("lookup_vtables result(\ location_info={:?}, \ type_param_defs={}, \ substs={}, \ @@ -142,12 +142,12 @@ fn lookup_vtables_for_param(vcx: &VtableContext, // Substitute the values of the type parameters that may // appear in the bound. let trait_ref = substs.as_ref().map_default(trait_ref, |substs| { - debug2!("about to subst: {}, {}", + debug!("about to subst: {}, {}", trait_ref.repr(tcx), substs.repr(tcx)); trait_ref.subst(tcx, *substs) }); - debug2!("after subst: {}", trait_ref.repr(tcx)); + debug!("after subst: {}", trait_ref.repr(tcx)); match lookup_vtable(vcx, location_info, ty, trait_ref, is_early) { Some(vtable) => param_result.push(vtable), @@ -163,7 +163,7 @@ fn lookup_vtables_for_param(vcx: &VtableContext, true }; - debug2!("lookup_vtables_for_param result(\ + debug!("lookup_vtables_for_param result(\ location_info={:?}, \ type_param_bounds={}, \ ty={}, \ @@ -228,7 +228,7 @@ fn lookup_vtable(vcx: &VtableContext, is_early: bool) -> Option { - debug2!("lookup_vtable(ty={}, trait_ref={})", + debug!("lookup_vtable(ty={}, trait_ref={})", vcx.infcx.ty_to_str(ty), vcx.infcx.trait_ref_to_str(trait_ref)); let _i = indenter(); @@ -291,7 +291,7 @@ fn lookup_vtable_from_bounds(vcx: &VtableContext, let mut n_bound = 0; let mut ret = None; do ty::each_bound_trait_and_supertraits(tcx, bounds) |bound_trait_ref| { - debug2!("checking bounds trait {}", + debug!("checking bounds trait {}", bound_trait_ref.repr(vcx.tcx())); if bound_trait_ref.def_id == trait_ref.def_id { @@ -300,7 +300,7 @@ fn lookup_vtable_from_bounds(vcx: &VtableContext, bound_trait_ref, trait_ref); let vtable = vtable_param(param, n_bound); - debug2!("found param vtable: {:?}", + debug!("found param vtable: {:?}", vtable); ret = Some(vtable); false @@ -382,7 +382,7 @@ fn search_for_vtable(vcx: &VtableContext, // Now, in the previous example, for_ty is bound to // the type self_ty, and substs is bound to [T]. - debug2!("The self ty is {} and its substs are {}", + debug!("The self ty is {} and its substs are {}", vcx.infcx.ty_to_str(for_ty), vcx.infcx.tys_to_str(substs.tps)); @@ -396,7 +396,7 @@ fn search_for_vtable(vcx: &VtableContext, // some value of U) with some_trait. This would fail if T // and U weren't compatible. - debug2!("(checking vtable) @2 relating trait \ + debug!("(checking vtable) @2 relating trait \ ty {} to of_trait_ref {}", vcx.infcx.trait_ref_to_str(trait_ref), vcx.infcx.trait_ref_to_str(of_trait_ref)); @@ -434,7 +434,7 @@ fn search_for_vtable(vcx: &VtableContext, } }; - debug2!("The fixed-up substs are {} - \ + debug!("The fixed-up substs are {} - \ they will be unified with the bounds for \ the target ty, {}", vcx.infcx.tys_to_str(substs_f.tps), @@ -486,7 +486,7 @@ fn fixup_substs(vcx: &VtableContext, do fixup_ty(vcx, location_info, t, is_early).map |t_f| { match ty::get(t_f).sty { ty::ty_trait(_, ref substs_f, _, _, _) => (*substs_f).clone(), - _ => fail2!("t_f should be a trait") + _ => fail!("t_f should be a trait") } } } @@ -532,7 +532,7 @@ fn connect_trait_tps(vcx: &VtableContext, fn insert_vtables(fcx: @mut FnCtxt, callee_id: ast::NodeId, vtables: vtable_res) { - debug2!("insert_vtables(callee_id={}, vtables={:?})", + debug!("insert_vtables(callee_id={}, vtables={:?})", callee_id, vtables.repr(fcx.tcx())); fcx.inh.vtable_map.insert(callee_id, vtables); } @@ -553,7 +553,7 @@ pub fn location_info_for_item(item: @ast::item) -> LocationInfo { pub fn early_resolve_expr(ex: @ast::Expr, fcx: @mut FnCtxt, is_early: bool) { - debug2!("vtable: early_resolve_expr() ex with id {:?} (early: {}): {}", + debug!("vtable: early_resolve_expr() ex with id {:?} (early: {}): {}", ex.id, is_early, expr_to_str(ex, fcx.tcx().sess.intr())); let _indent = indenter(); @@ -561,15 +561,15 @@ pub fn early_resolve_expr(ex: @ast::Expr, match ex.node { ast::ExprPath(*) => { do fcx.opt_node_ty_substs(ex.id) |substs| { - debug2!("vtable resolution on parameter bounds for expr {}", + debug!("vtable resolution on parameter bounds for expr {}", ex.repr(fcx.tcx())); let def = cx.tcx.def_map.get_copy(&ex.id); let did = ast_util::def_id_of_def(def); let item_ty = ty::lookup_item_type(cx.tcx, did); - debug2!("early resolve expr: def {:?} {:?}, {:?}, {}", ex.id, did, def, + debug!("early resolve expr: def {:?} {:?}, {:?}, {}", ex.id, did, def, fcx.infcx().ty_to_str(item_ty.ty)); if has_trait_bounds(*item_ty.generics.type_param_defs) { - debug2!("early_resolve_expr: looking up vtables for type params {}", + debug!("early_resolve_expr: looking up vtables for type params {}", item_ty.generics.type_param_defs.repr(fcx.tcx())); let vcx = VtableContext { ccx: fcx.ccx, infcx: fcx.infcx() }; let vtbls = lookup_vtables(&vcx, &location_info_for_expr(ex), @@ -595,7 +595,7 @@ pub fn early_resolve_expr(ex: @ast::Expr, ast::ExprMethodCall(callee_id, _, _, _, _, _) => { match ty::method_call_type_param_defs(cx.tcx, fcx.inh.method_map, ex.id) { Some(type_param_defs) => { - debug2!("vtable resolution on parameter bounds for method call {}", + debug!("vtable resolution on parameter bounds for method call {}", ex.repr(fcx.tcx())); if has_trait_bounds(*type_param_defs) { let substs = fcx.node_ty_substs(callee_id); @@ -611,7 +611,7 @@ pub fn early_resolve_expr(ex: @ast::Expr, } } ast::ExprCast(src, _) => { - debug2!("vtable resolution on expr {}", ex.repr(fcx.tcx())); + debug!("vtable resolution on expr {}", ex.repr(fcx.tcx())); let target_ty = fcx.expr_ty(ex); match ty::get(target_ty).sty { // Bounds of type's contents are not checked here, but in kind.rs. @@ -752,7 +752,7 @@ pub fn resolve_impl(ccx: @mut CrateCtxt, impl_item: @ast::item) { trait_bounds: ~[trait_ref] }; let t = ty::node_id_to_type(ccx.tcx, impl_item.id); - debug2!("=== Doing a self lookup now."); + debug!("=== Doing a self lookup now."); // Right now, we don't have any place to store this. // We will need to make one so we can use this information // for compiling default methods that refer to supertraits. diff --git a/src/librustc/middle/typeck/check/writeback.rs b/src/librustc/middle/typeck/check/writeback.rs index 4f281ce5f457..46c7968a0a41 100644 --- a/src/librustc/middle/typeck/check/writeback.rs +++ b/src/librustc/middle/typeck/check/writeback.rs @@ -70,7 +70,7 @@ fn resolve_method_map_entry(fcx: @mut FnCtxt, sp: Span, id: ast::NodeId) { for t in r.iter() { let method_map = fcx.ccx.method_map; let new_entry = method_map_entry { self_ty: *t, ..*mme }; - debug2!("writeback::resolve_method_map_entry(id={:?}, \ + debug!("writeback::resolve_method_map_entry(id={:?}, \ new_entry={:?})", id, new_entry); method_map.insert(id, new_entry); @@ -88,7 +88,7 @@ fn resolve_vtable_map_entry(fcx: @mut FnCtxt, sp: Span, id: ast::NodeId) { let r_origins = resolve_origins(fcx, sp, *origins); let vtable_map = fcx.ccx.vtable_map; vtable_map.insert(id, r_origins); - debug2!("writeback::resolve_vtable_map_entry(id={}, vtables={:?})", + debug!("writeback::resolve_vtable_map_entry(id={}, vtables={:?})", id, r_origins.repr(fcx.tcx())); } } @@ -133,7 +133,7 @@ fn resolve_type_vars_for_node(wbcx: &mut WbCtxt, sp: Span, id: ast::NodeId) } Ok(r1) => { let resolved_adj = @ty::AutoAddEnv(r1, s); - debug2!("Adjustments for node {}: {:?}", id, resolved_adj); + debug!("Adjustments for node {}: {:?}", id, resolved_adj); fcx.tcx().adjustments.insert(id, resolved_adj); } } @@ -162,7 +162,7 @@ fn resolve_type_vars_for_node(wbcx: &mut WbCtxt, sp: Span, id: ast::NodeId) autoderefs: adj.autoderefs, autoref: resolved_autoref, }); - debug2!("Adjustments for node {}: {:?}", id, resolved_adj); + debug!("Adjustments for node {}: {:?}", id, resolved_adj); fcx.tcx().adjustments.insert(id, resolved_adj); } } @@ -176,7 +176,7 @@ fn resolve_type_vars_for_node(wbcx: &mut WbCtxt, sp: Span, id: ast::NodeId) } Some(t) => { - debug2!("resolve_type_vars_for_node(id={}, n_ty={}, t={})", + debug!("resolve_type_vars_for_node(id={}, n_ty={}, t={})", id, ppaux::ty_to_str(tcx, n_ty), ppaux::ty_to_str(tcx, t)); write_ty_to_tcx(tcx, id, t); let mut ret = Some(t); @@ -284,7 +284,7 @@ fn visit_pat(p: @ast::Pat, wbcx: &mut WbCtxt) { } resolve_type_vars_for_node(wbcx, p.span, p.id); - debug2!("Type for pattern binding {} (id {}) resolved to {}", + debug!("Type for pattern binding {} (id {}) resolved to {}", pat_to_str(p, wbcx.fcx.ccx.tcx.sess.intr()), p.id, wbcx.fcx.infcx().ty_to_str( ty::node_id_to_type(wbcx.fcx.ccx.tcx, @@ -297,7 +297,7 @@ fn visit_local(l: @ast::Local, wbcx: &mut WbCtxt) { let var_ty = wbcx.fcx.local_ty(l.span, l.id); match resolve_type(wbcx.fcx.infcx(), var_ty, resolve_all | force_all) { Ok(lty) => { - debug2!("Type for local {} (id {}) resolved to {}", + debug!("Type for local {} (id {}) resolved to {}", pat_to_str(l.pat, wbcx.fcx.tcx().sess.intr()), l.id, wbcx.fcx.infcx().ty_to_str(lty)); diff --git a/src/librustc/middle/typeck/coherence.rs b/src/librustc/middle/typeck/coherence.rs index ae8081df7bac..795074fa6190 100644 --- a/src/librustc/middle/typeck/coherence.rs +++ b/src/librustc/middle/typeck/coherence.rs @@ -76,7 +76,7 @@ pub fn get_base_type(inference_context: @mut InferCtxt, match get(resolved_type).sty { ty_enum(*) | ty_trait(*) | ty_struct(*) => { - debug2!("(getting base type) found base type"); + debug!("(getting base type) found base type"); Some(resolved_type) } @@ -85,7 +85,7 @@ pub fn get_base_type(inference_context: @mut InferCtxt, ty_infer(*) | ty_param(*) | ty_self(*) | ty_type | ty_opaque_box | ty_opaque_closure_ptr(*) | ty_unboxed_vec(*) | ty_err | ty_box(_) | ty_uniq(_) | ty_ptr(_) | ty_rptr(_, _) => { - debug2!("(getting base type) no base type; found {:?}", + debug!("(getting base type) no base type; found {:?}", get(original_type).sty); None } @@ -135,7 +135,7 @@ pub fn get_base_type_def_id(inference_context: @mut InferCtxt, return Some(def_id); } _ => { - fail2!("get_base_type() returned a type that wasn't an \ + fail!("get_base_type() returned a type that wasn't an \ enum, struct, or trait"); } } @@ -160,7 +160,7 @@ struct CoherenceCheckVisitor { cc: CoherenceChecker } impl visit::Visitor<()> for CoherenceCheckVisitor { fn visit_item(&mut self, item:@item, _:()) { -// debug2!("(checking coherence) item '{}'", +// debug!("(checking coherence) item '{}'", // self.cc.crate_context.tcx.sess.str_of(item.ident)); match item.node { @@ -266,7 +266,7 @@ impl CoherenceChecker { // base type. if associated_traits.len() == 0 { - debug2!("(checking implementation) no associated traits for item \ + debug!("(checking implementation) no associated traits for item \ '{}'", self.crate_context.tcx.sess.str_of(item.ident)); @@ -290,7 +290,7 @@ impl CoherenceChecker { for associated_trait in associated_traits.iter() { let trait_ref = ty::node_id_to_trait_ref( self.crate_context.tcx, associated_trait.ref_id); - debug2!("(checking implementation) adding impl for trait '{}', item '{}'", + debug!("(checking implementation) adding impl for trait '{}', item '{}'", trait_ref.repr(self.crate_context.tcx), self.crate_context.tcx.sess.str_of(item.ident)); @@ -325,7 +325,7 @@ impl CoherenceChecker { trait_ref: &ty::TraitRef, all_methods: &mut ~[@Method]) { let tcx = self.crate_context.tcx; - debug2!("instantiate_default_methods(impl_id={:?}, trait_ref={})", + debug!("instantiate_default_methods(impl_id={:?}, trait_ref={})", impl_id, trait_ref.repr(tcx)); let impl_poly_type = ty::lookup_item_type(tcx, impl_id); @@ -336,7 +336,7 @@ impl CoherenceChecker { let new_id = tcx.sess.next_node_id(); let new_did = local_def(new_id); - debug2!("new_did={:?} trait_method={}", new_did, trait_method.repr(tcx)); + debug!("new_did={:?} trait_method={}", new_did, trait_method.repr(tcx)); // Create substitutions for the various trait parameters. let new_method_ty = @@ -348,7 +348,7 @@ impl CoherenceChecker { *trait_method, Some(trait_method.def_id)); - debug2!("new_method_ty={}", new_method_ty.repr(tcx)); + debug!("new_method_ty={}", new_method_ty.repr(tcx)); all_methods.push(new_method_ty); // construct the polytype for the method based on the method_ty @@ -364,7 +364,7 @@ impl CoherenceChecker { generics: new_generics, ty: ty::mk_bare_fn(tcx, new_method_ty.fty.clone()) }; - debug2!("new_polytype={}", new_polytype.repr(tcx)); + debug!("new_polytype={}", new_polytype.repr(tcx)); tcx.tcache.insert(new_did, new_polytype); tcx.methods.insert(new_did, new_method_ty); @@ -557,7 +557,7 @@ impl CoherenceChecker { let r = ty::trait_methods(tcx, trait_did); for method in r.iter() { - debug2!("checking for {}", method.ident.repr(tcx)); + debug!("checking for {}", method.ident.repr(tcx)); if provided_names.contains(&method.ident.name) { continue; } tcx.sess.span_err(trait_ref_span, diff --git a/src/librustc/middle/typeck/collect.rs b/src/librustc/middle/typeck/collect.rs index 238bcff65373..9c69e6fd85cc 100644 --- a/src/librustc/middle/typeck/collect.rs +++ b/src/librustc/middle/typeck/collect.rs @@ -347,7 +347,7 @@ pub fn ensure_trait_methods(ccx: &CrateCtxt, let substd_type_param_defs = m.generics.type_param_defs.subst(tcx, &substs); new_type_param_defs.push_all(*substd_type_param_defs); - debug2!("static method {} type_param_defs={} ty={}, substs={}", + debug!("static method {} type_param_defs={} ty={}, substs={}", m.def_id.repr(tcx), new_type_param_defs.repr(tcx), ty.repr(tcx), @@ -453,7 +453,7 @@ pub fn compare_impl_method(tcx: ty::ctxt, trait_m: &ty::Method, trait_substs: &ty::substs, self_ty: ty::t) { - debug2!("compare_impl_method()"); + debug!("compare_impl_method()"); let infcx = infer::new_infer_ctxt(tcx); let impl_m = &cm.mty; @@ -632,10 +632,10 @@ pub fn compare_impl_method(tcx: ty::ctxt, // that correspond to the parameters we will find on the impl // - replace self region with a fresh, dummy region let impl_fty = { - debug2!("impl_fty (pre-subst): {}", ppaux::ty_to_str(tcx, impl_fty)); + debug!("impl_fty (pre-subst): {}", ppaux::ty_to_str(tcx, impl_fty)); replace_bound_self(tcx, impl_fty, dummy_self_r) }; - debug2!("impl_fty (post-subst): {}", ppaux::ty_to_str(tcx, impl_fty)); + debug!("impl_fty (post-subst): {}", ppaux::ty_to_str(tcx, impl_fty)); let trait_fty = { let num_trait_m_type_params = trait_m.generics.type_param_defs.len(); let dummy_tps = do vec::from_fn(num_trait_m_type_params) |i| { @@ -649,11 +649,11 @@ pub fn compare_impl_method(tcx: ty::ctxt, self_ty: Some(self_ty), tps: vec::append(trait_tps, dummy_tps) }; - debug2!("trait_fty (pre-subst): {} substs={}", + debug!("trait_fty (pre-subst): {} substs={}", trait_fty.repr(tcx), substs.repr(tcx)); ty::subst(tcx, &substs, trait_fty) }; - debug2!("trait_fty (post-subst): {}", trait_fty.repr(tcx)); + debug!("trait_fty (post-subst): {}", trait_fty.repr(tcx)); match infer::mk_subty(infcx, false, infer::MethodCompatCheck(cm.span), impl_fty, trait_fty) { @@ -844,7 +844,7 @@ pub fn ensure_no_ty_param_bounds(ccx: &CrateCtxt, pub fn convert(ccx: &CrateCtxt, it: &ast::item) { let tcx = ccx.tcx; let rp = tcx.region_paramd_items.find(&it.id).map(|x| *x); - debug2!("convert: item {} with id {} rp {:?}", + debug!("convert: item {} with id {} rp {:?}", tcx.sess.str_of(it.ident), it.id, rp); match it.node { // These don't define types. @@ -1120,7 +1120,7 @@ pub fn ty_of_item(ccx: &CrateCtxt, it: &ast::item) }, ty: ty::mk_bare_fn(ccx.tcx, tofd) }; - debug2!("type of {} (id {}) is {}", + debug!("type of {} (id {}) is {}", tcx.sess.str_of(it.ident), it.id, ppaux::ty_to_str(tcx, tpt.ty)); @@ -1174,8 +1174,8 @@ pub fn ty_of_item(ccx: &CrateCtxt, it: &ast::item) return tpt; } ast::item_impl(*) | ast::item_mod(_) | - ast::item_foreign_mod(_) => fail2!(), - ast::item_mac(*) => fail2!("item macros unimplemented") + ast::item_foreign_mod(_) => fail!(), + ast::item_mac(*) => fail!("item macros unimplemented") } } @@ -1222,7 +1222,7 @@ pub fn ty_generics(ccx: &CrateCtxt, def_id: local_def(param.id), bounds: bounds }; - debug2!("def for param: {}", def.repr(ccx.tcx)); + debug!("def for param: {}", def.repr(ccx.tcx)); ccx.tcx.ty_param_defs.insert(param.id, def); def } diff --git a/src/librustc/middle/typeck/infer/coercion.rs b/src/librustc/middle/typeck/infer/coercion.rs index 8d1eaf34256b..e1f65f79e4fb 100644 --- a/src/librustc/middle/typeck/infer/coercion.rs +++ b/src/librustc/middle/typeck/infer/coercion.rs @@ -87,7 +87,7 @@ pub struct Coerce(CombineFields); impl Coerce { pub fn tys(&self, a: ty::t, b: ty::t) -> CoerceResult { - debug2!("Coerce.tys({} => {})", + debug!("Coerce.tys({} => {})", a.inf_str(self.infcx), b.inf_str(self.infcx)); let _indent = indenter(); @@ -184,7 +184,7 @@ impl Coerce { b: ty::t, mt_b: ty::mt) -> CoerceResult { - debug2!("coerce_borrowed_pointer(a={}, sty_a={:?}, b={}, mt_b={:?})", + debug!("coerce_borrowed_pointer(a={}, sty_a={:?}, b={}, mt_b={:?})", a.inf_str(self.infcx), sty_a, b.inf_str(self.infcx), mt_b); @@ -221,7 +221,7 @@ impl Coerce { sty_a: &ty::sty, b: ty::t) -> CoerceResult { - debug2!("coerce_borrowed_string(a={}, sty_a={:?}, b={})", + debug!("coerce_borrowed_string(a={}, sty_a={:?}, b={})", a.inf_str(self.infcx), sty_a, b.inf_str(self.infcx)); @@ -248,7 +248,7 @@ impl Coerce { b: ty::t, mt_b: ty::mt) -> CoerceResult { - debug2!("coerce_borrowed_vector(a={}, sty_a={:?}, b={})", + debug!("coerce_borrowed_vector(a={}, sty_a={:?}, b={})", a.inf_str(self.infcx), sty_a, b.inf_str(self.infcx)); @@ -277,7 +277,7 @@ impl Coerce { b: ty::t, b_mutbl: ast::Mutability) -> CoerceResult { - debug2!("coerce_borrowed_object(a={}, sty_a={:?}, b={})", + debug!("coerce_borrowed_object(a={}, sty_a={:?}, b={})", a.inf_str(self.infcx), sty_a, b.inf_str(self.infcx)); @@ -306,7 +306,7 @@ impl Coerce { sty_a: &ty::sty, b: ty::t) -> CoerceResult { - debug2!("coerce_borrowed_fn(a={}, sty_a={:?}, b={})", + debug!("coerce_borrowed_fn(a={}, sty_a={:?}, b={})", a.inf_str(self.infcx), sty_a, b.inf_str(self.infcx)); @@ -361,7 +361,7 @@ impl Coerce { * "rust" fn`) into a closure. */ - debug2!("coerce_from_bare_fn(a={}, b={})", + debug!("coerce_from_bare_fn(a={}, b={})", a.inf_str(self.infcx), b.inf_str(self.infcx)); if !fn_ty_a.abis.is_rust() { @@ -389,7 +389,7 @@ impl Coerce { b: ty::t, mt_b: ty::mt) -> CoerceResult { - debug2!("coerce_unsafe_ptr(a={}, sty_a={:?}, b={})", + debug!("coerce_unsafe_ptr(a={}, sty_a={:?}, b={})", a.inf_str(self.infcx), sty_a, b.inf_str(self.infcx)); diff --git a/src/librustc/middle/typeck/infer/combine.rs b/src/librustc/middle/typeck/infer/combine.rs index 3f6248eae123..2d810f1da746 100644 --- a/src/librustc/middle/typeck/infer/combine.rs +++ b/src/librustc/middle/typeck/infer/combine.rs @@ -270,7 +270,7 @@ pub trait Combine { fn vstores(&self, vk: ty::terr_vstore_kind, a: ty::vstore, b: ty::vstore) -> cres { - debug2!("{}.vstores(a={:?}, b={:?})", self.tag(), a, b); + debug!("{}.vstores(a={:?}, b={:?})", self.tag(), a, b); match (a, b) { (ty::vstore_slice(a_r), ty::vstore_slice(b_r)) => { @@ -295,7 +295,7 @@ pub trait Combine { b: ty::TraitStore) -> cres { - debug2!("{}.trait_stores(a={:?}, b={:?})", self.tag(), a, b); + debug!("{}.trait_stores(a={:?}, b={:?})", self.tag(), a, b); match (a, b) { (ty::RegionTraitStore(a_r), ty::RegionTraitStore(b_r)) => { @@ -365,7 +365,7 @@ pub fn eq_tys(this: &C, a: ty::t, b: ty::t) -> ures { pub fn eq_regions(this: &C, a: ty::Region, b: ty::Region) -> ures { - debug2!("eq_regions({}, {})", + debug!("eq_regions({}, {})", a.inf_str(this.infcx()), b.inf_str(this.infcx())); let sub = this.sub(); diff --git a/src/librustc/middle/typeck/infer/glb.rs b/src/librustc/middle/typeck/infer/glb.rs index 5e9eb51cbb64..87c7373b005d 100644 --- a/src/librustc/middle/typeck/infer/glb.rs +++ b/src/librustc/middle/typeck/infer/glb.rs @@ -44,7 +44,7 @@ impl Combine for Glb { fn mts(&self, a: &ty::mt, b: &ty::mt) -> cres { let tcx = self.infcx.tcx; - debug2!("{}.mts({}, {})", + debug!("{}.mts({}, {})", self.tag(), mt_to_str(tcx, a), mt_to_str(tcx, b)); @@ -100,7 +100,7 @@ impl Combine for Glb { } fn regions(&self, a: ty::Region, b: ty::Region) -> cres { - debug2!("{}.regions({:?}, {:?})", + debug!("{}.regions({:?}, {:?})", self.tag(), a.inf_str(self.infcx), b.inf_str(self.infcx)); @@ -121,7 +121,7 @@ impl Combine for Glb { // Note: this is a subtle algorithm. For a full explanation, // please see the large comment in `region_inference.rs`. - debug2!("{}.fn_sigs({:?}, {:?})", + debug!("{}.fn_sigs({:?}, {:?})", self.tag(), a.inf_str(self.infcx), b.inf_str(self.infcx)); let _indenter = indenter(); @@ -143,7 +143,7 @@ impl Combine for Glb { // Collect constraints. let sig0 = if_ok!(super_fn_sigs(self, &a_with_fresh, &b_with_fresh)); - debug2!("sig0 = {}", sig0.inf_str(self.infcx)); + debug!("sig0 = {}", sig0.inf_str(self.infcx)); // Generalize the regions appearing in fn_ty0 if possible let new_vars = @@ -155,7 +155,7 @@ impl Combine for Glb { |r, _in_fn| generalize_region(self, snapshot, new_vars, a_isr, a_vars, b_vars, r)); - debug2!("sig1 = {}", sig1.inf_str(self.infcx)); + debug!("sig1 = {}", sig1.inf_str(self.infcx)); return Ok(sig1); fn generalize_region(this: &Glb, diff --git a/src/librustc/middle/typeck/infer/lattice.rs b/src/librustc/middle/typeck/infer/lattice.rs index 919ad68a818f..8a32a305b3a0 100644 --- a/src/librustc/middle/typeck/infer/lattice.rs +++ b/src/librustc/middle/typeck/infer/lattice.rs @@ -131,7 +131,7 @@ impl CombineFieldsLatticeMethods for CombineFields { let a_bounds = node_a.possible_types.clone(); let b_bounds = node_b.possible_types.clone(); - debug2!("vars({}={} <: {}={})", + debug!("vars({}={} <: {}={})", a_id.to_str(), a_bounds.inf_str(self.infcx), b_id.to_str(), b_bounds.inf_str(self.infcx)); @@ -179,7 +179,7 @@ impl CombineFieldsLatticeMethods for CombineFields { let a_bounds = &node_a.possible_types; let b_bounds = &Bounds { lb: None, ub: Some(b.clone()) }; - debug2!("var_sub_t({}={} <: {})", + debug!("var_sub_t({}={} <: {})", a_id.to_str(), a_bounds.inf_str(self.infcx), b.inf_str(self.infcx)); @@ -203,7 +203,7 @@ impl CombineFieldsLatticeMethods for CombineFields { let b_id = node_b.root.clone(); let b_bounds = &node_b.possible_types; - debug2!("t_sub_var({} <: {}={})", + debug!("t_sub_var({} <: {}={})", a.inf_str(self.infcx), b_id.to_str(), b_bounds.inf_str(self.infcx)); @@ -222,7 +222,7 @@ impl CombineFieldsLatticeMethods for CombineFields { * * Combines two bounds into a more general bound. */ - debug2!("merge_bnd({},{})", + debug!("merge_bnd({},{})", a.inf_str(self.infcx), b.inf_str(self.infcx)); let _r = indenter(); @@ -273,7 +273,7 @@ impl CombineFieldsLatticeMethods for CombineFields { // A \ / A // B - debug2!("merge({},{},{})", + debug!("merge({},{},{})", v_id.to_str(), a.inf_str(self.infcx), b.inf_str(self.infcx)); @@ -290,7 +290,7 @@ impl CombineFieldsLatticeMethods for CombineFields { let ub = if_ok!(self.merge_bnd(&a.ub, &b.ub, LatticeValue::glb)); let lb = if_ok!(self.merge_bnd(&a.lb, &b.lb, LatticeValue::lub)); let bounds = Bounds { lb: lb, ub: ub }; - debug2!("merge({}): bounds={}", + debug!("merge({}): bounds={}", v_id.to_str(), bounds.inf_str(self.infcx)); @@ -305,7 +305,7 @@ impl CombineFieldsLatticeMethods for CombineFields { a: &Bound, b: &Bound) -> ures { - debug2!("bnds({} <: {})", a.inf_str(self.infcx), + debug!("bnds({} <: {})", a.inf_str(self.infcx), b.inf_str(self.infcx)); let _r = indenter(); @@ -370,7 +370,7 @@ pub fn super_lattice_tys( this: &L, a: ty::t, b: ty::t) -> cres { - debug2!("{}.lattice_tys({}, {})", this.tag(), + debug!("{}.lattice_tys({}, {})", this.tag(), a.inf_str(this.infcx()), b.inf_str(this.infcx())); let _r = indenter(); @@ -448,7 +448,7 @@ pub fn lattice_vars { // If a has an upper bound, return the LUB(a.ub, b) - debug2!("bnd=Some({})", a_bnd.inf_str(this.infcx())); + debug!("bnd=Some({})", a_bnd.inf_str(this.infcx())); lattice_dir_op(a_bnd, b) } None => { // If a does not have an upper bound, make b the upper bound of a // and then return b. - debug2!("bnd=None"); + debug!("bnd=None"); let a_bounds = this.with_bnd(a_bounds, (*b).clone()); do this.combine_fields().bnds(&a_bounds.lb, &a_bounds.ub).then { this.infcx().set(a_id.clone(), diff --git a/src/librustc/middle/typeck/infer/lub.rs b/src/librustc/middle/typeck/infer/lub.rs index c8974a722fd8..42793d956df0 100644 --- a/src/librustc/middle/typeck/infer/lub.rs +++ b/src/librustc/middle/typeck/infer/lub.rs @@ -50,7 +50,7 @@ impl Combine for Lub { fn mts(&self, a: &ty::mt, b: &ty::mt) -> cres { let tcx = self.infcx.tcx; - debug2!("{}.mts({}, {})", + debug!("{}.mts({}, {})", self.tag(), mt_to_str(tcx, a), mt_to_str(tcx, b)); @@ -106,7 +106,7 @@ impl Combine for Lub { } fn regions(&self, a: ty::Region, b: ty::Region) -> cres { - debug2!("{}.regions({:?}, {:?})", + debug!("{}.regions({:?}, {:?})", self.tag(), a.inf_str(self.infcx), b.inf_str(self.infcx)); @@ -134,7 +134,7 @@ impl Combine for Lub { // Collect constraints. let sig0 = if_ok!(super_fn_sigs(self, &a_with_fresh, &b_with_fresh)); - debug2!("sig0 = {}", sig0.inf_str(self.infcx)); + debug!("sig0 = {}", sig0.inf_str(self.infcx)); // Generalize the regions appearing in sig0 if possible let new_vars = @@ -154,7 +154,7 @@ impl Combine for Lub { r0: ty::Region) -> ty::Region { // Regions that pre-dated the LUB computation stay as they are. if !is_var_in_set(new_vars, r0) { - debug2!("generalize_region(r0={:?}): not new variable", r0); + debug!("generalize_region(r0={:?}): not new variable", r0); return r0; } @@ -164,7 +164,7 @@ impl Combine for Lub { // *related* to regions that pre-date the LUB computation // stay as they are. if !tainted.iter().all(|r| is_var_in_set(new_vars, *r)) { - debug2!("generalize_region(r0={:?}): \ + debug!("generalize_region(r0={:?}): \ non-new-variables found in {:?}", r0, tainted); return r0; @@ -179,7 +179,7 @@ impl Combine for Lub { do list::each(a_isr) |pair| { let (a_br, a_r) = *pair; if tainted.iter().any(|x| x == &a_r) { - debug2!("generalize_region(r0={:?}): \ + debug!("generalize_region(r0={:?}): \ replacing with {:?}, tainted={:?}", r0, a_br, tainted); ret = Some(ty::re_bound(a_br)); diff --git a/src/librustc/middle/typeck/infer/mod.rs b/src/librustc/middle/typeck/infer/mod.rs index c93b50c76b0c..487eb4c32890 100644 --- a/src/librustc/middle/typeck/infer/mod.rs +++ b/src/librustc/middle/typeck/infer/mod.rs @@ -285,7 +285,7 @@ pub fn common_supertype(cx: @mut InferCtxt, * not possible, reports an error and returns ty::err. */ - debug2!("common_supertype({}, {})", a.inf_str(cx), b.inf_str(cx)); + debug!("common_supertype({}, {})", a.inf_str(cx), b.inf_str(cx)); let trace = TypeTrace { origin: origin, @@ -311,7 +311,7 @@ pub fn mk_subty(cx: @mut InferCtxt, a: ty::t, b: ty::t) -> ures { - debug2!("mk_subty({} <: {})", a.inf_str(cx), b.inf_str(cx)); + debug!("mk_subty({} <: {})", a.inf_str(cx), b.inf_str(cx)); do indent { do cx.commit { let trace = TypeTrace { @@ -324,7 +324,7 @@ pub fn mk_subty(cx: @mut InferCtxt, } pub fn can_mk_subty(cx: @mut InferCtxt, a: ty::t, b: ty::t) -> ures { - debug2!("can_mk_subty({} <: {})", a.inf_str(cx), b.inf_str(cx)); + debug!("can_mk_subty({} <: {})", a.inf_str(cx), b.inf_str(cx)); do indent { do cx.probe { let trace = TypeTrace { @@ -341,7 +341,7 @@ pub fn mk_subr(cx: @mut InferCtxt, origin: SubregionOrigin, a: ty::Region, b: ty::Region) { - debug2!("mk_subr({} <: {})", a.inf_str(cx), b.inf_str(cx)); + debug!("mk_subr({} <: {})", a.inf_str(cx), b.inf_str(cx)); cx.region_vars.start_snapshot(); cx.region_vars.make_subregion(origin, a, b); cx.region_vars.commit(); @@ -353,7 +353,7 @@ pub fn mk_eqty(cx: @mut InferCtxt, a: ty::t, b: ty::t) -> ures { - debug2!("mk_eqty({} <: {})", a.inf_str(cx), b.inf_str(cx)); + debug!("mk_eqty({} <: {})", a.inf_str(cx), b.inf_str(cx)); do indent { do cx.commit { let trace = TypeTrace { @@ -373,7 +373,7 @@ pub fn mk_sub_trait_refs(cx: @mut InferCtxt, b: @ty::TraitRef) -> ures { - debug2!("mk_sub_trait_refs({} <: {})", + debug!("mk_sub_trait_refs({} <: {})", a.inf_str(cx), b.inf_str(cx)); do indent { do cx.commit { @@ -403,7 +403,7 @@ pub fn mk_coercety(cx: @mut InferCtxt, a: ty::t, b: ty::t) -> CoerceResult { - debug2!("mk_coercety({} -> {})", a.inf_str(cx), b.inf_str(cx)); + debug!("mk_coercety({} -> {})", a.inf_str(cx), b.inf_str(cx)); do indent { do cx.commit { let trace = TypeTrace { @@ -416,7 +416,7 @@ pub fn mk_coercety(cx: @mut InferCtxt, } pub fn can_mk_coercety(cx: @mut InferCtxt, a: ty::t, b: ty::t) -> ures { - debug2!("can_mk_coercety({} -> {})", a.inf_str(cx), b.inf_str(cx)); + debug!("can_mk_coercety({} -> {})", a.inf_str(cx), b.inf_str(cx)); do indent { do cx.probe { let trace = TypeTrace { @@ -539,7 +539,7 @@ impl InferCtxt { } pub fn rollback_to(&mut self, snapshot: &Snapshot) { - debug2!("rollback!"); + debug!("rollback!"); rollback_to(&mut self.ty_var_bindings, snapshot.ty_var_bindings_len); rollback_to(&mut self.int_var_bindings, @@ -554,7 +554,7 @@ impl InferCtxt { pub fn commit(@mut self, f: &fn() -> Result) -> Result { assert!(!self.in_snapshot()); - debug2!("commit()"); + debug!("commit()"); do indent { let r = self.try(|| f()); @@ -567,7 +567,7 @@ impl InferCtxt { /// Execute `f`, unroll bindings on failure pub fn try(@mut self, f: &fn() -> Result) -> Result { - debug2!("try()"); + debug!("try()"); do indent { let snapshot = self.start_snapshot(); let r = f(); @@ -581,7 +581,7 @@ impl InferCtxt { /// Execute `f` then unroll any bindings it creates pub fn probe(@mut self, f: &fn() -> Result) -> Result { - debug2!("probe()"); + debug!("probe()"); do indent { let snapshot = self.start_snapshot(); let r = f(); @@ -725,7 +725,7 @@ impl InferCtxt { expected_ty: Option, actual_ty: ~str, err: Option<&ty::type_err>) { - debug2!("hi! expected_ty = {:?}, actual_ty = {}", expected_ty, actual_ty); + debug!("hi! expected_ty = {:?}, actual_ty = {}", expected_ty, actual_ty); let error_str = do err.map_default(~"") |t_err| { format!(" ({})", ty::type_err_to_str(self.tcx, t_err)) @@ -792,7 +792,7 @@ impl InferCtxt { replace_bound_regions_in_fn_sig(self.tcx, @Nil, None, fsig, |br| { let rvar = self.next_region_var( BoundRegionInFnType(trace.origin.span(), br)); - debug2!("Bound region {} maps to {:?}", + debug!("Bound region {} maps to {:?}", bound_region_to_str(self.tcx, "", false, br), rvar); rvar diff --git a/src/librustc/middle/typeck/infer/region_inference/mod.rs b/src/librustc/middle/typeck/infer/region_inference/mod.rs index 3ab7ced39416..68c5ec3b7d66 100644 --- a/src/librustc/middle/typeck/infer/region_inference/mod.rs +++ b/src/librustc/middle/typeck/infer/region_inference/mod.rs @@ -130,7 +130,7 @@ impl RegionVarBindings { } pub fn start_snapshot(&mut self) -> uint { - debug2!("RegionVarBindings: snapshot()={}", self.undo_log.len()); + debug!("RegionVarBindings: snapshot()={}", self.undo_log.len()); if self.in_snapshot() { self.undo_log.len() } else { @@ -140,17 +140,17 @@ impl RegionVarBindings { } pub fn commit(&mut self) { - debug2!("RegionVarBindings: commit()"); + debug!("RegionVarBindings: commit()"); while self.undo_log.len() > 0 { self.undo_log.pop(); } } pub fn rollback_to(&mut self, snapshot: uint) { - debug2!("RegionVarBindings: rollback_to({})", snapshot); + debug!("RegionVarBindings: rollback_to({})", snapshot); while self.undo_log.len() > snapshot { let undo_item = self.undo_log.pop(); - debug2!("undo_item={:?}", undo_item); + debug!("undo_item={:?}", undo_item); match undo_item { Snapshot => {} AddVar(vid) => { @@ -181,7 +181,7 @@ impl RegionVarBindings { if self.in_snapshot() { self.undo_log.push(AddVar(vid)); } - debug2!("created new region variable {:?} with origin {:?}", + debug!("created new region variable {:?} with origin {:?}", vid, origin.repr(self.tcx)); return vid; } @@ -218,7 +218,7 @@ impl RegionVarBindings { // cannot add constraints once regions are resolved assert!(self.values.is_empty()); - debug2!("RegionVarBindings: add_constraint({:?})", constraint); + debug!("RegionVarBindings: add_constraint({:?})", constraint); if self.constraints.insert(constraint, origin) { if self.in_snapshot() { @@ -234,7 +234,7 @@ impl RegionVarBindings { // cannot add constraints once regions are resolved assert!(self.values.is_empty()); - debug2!("RegionVarBindings: make_subregion({:?}, {:?})", sub, sup); + debug!("RegionVarBindings: make_subregion({:?}, {:?})", sub, sup); match (sub, sup) { (re_infer(ReVar(sub_id)), re_infer(ReVar(sup_id))) => { self.add_constraint(ConstrainVarSubVar(sub_id, sup_id), origin); @@ -269,7 +269,7 @@ impl RegionVarBindings { // cannot add constraints once regions are resolved assert!(self.values.is_empty()); - debug2!("RegionVarBindings: lub_regions({:?}, {:?})", a, b); + debug!("RegionVarBindings: lub_regions({:?}, {:?})", a, b); match (a, b) { (re_static, _) | (_, re_static) => { re_static // nothing lives longer than static @@ -292,7 +292,7 @@ impl RegionVarBindings { // cannot add constraints once regions are resolved assert!(self.values.is_empty()); - debug2!("RegionVarBindings: glb_regions({:?}, {:?})", a, b); + debug!("RegionVarBindings: glb_regions({:?}, {:?})", a, b); match (a, b) { (re_static, r) | (r, re_static) => { // static lives longer than everything else @@ -317,7 +317,7 @@ impl RegionVarBindings { } let v = self.values.with_ref(|values| values[rid.to_uint()]); - debug2!("RegionVarBindings: resolve_var({:?}={})={:?}", + debug!("RegionVarBindings: resolve_var({:?}={})={:?}", rid, rid.to_uint(), v); match v { Value(r) => r, @@ -367,7 +367,7 @@ impl RegionVarBindings { } relate(self, a, re_infer(ReVar(c))); relate(self, b, re_infer(ReVar(c))); - debug2!("combine_vars() c={:?}", c); + debug!("combine_vars() c={:?}", c); re_infer(ReVar(c)) } @@ -390,7 +390,7 @@ impl RegionVarBindings { * regions. */ - debug2!("tainted(snapshot={}, r0={:?})", snapshot, r0); + debug!("tainted(snapshot={}, r0={:?})", snapshot, r0); let _indenter = indenter(); let undo_len = self.undo_log.len(); @@ -404,7 +404,7 @@ impl RegionVarBindings { // nb: can't use uint::range() here because result_set grows let r = result_set[result_index]; - debug2!("result_index={}, r={:?}", result_index, r); + debug!("result_index={}, r={:?}", result_index, r); let mut undo_index = snapshot; while undo_index < undo_len { @@ -469,7 +469,7 @@ impl RegionVarBindings { errors are reported. */ pub fn resolve_regions(&mut self) -> OptVec { - debug2!("RegionVarBindings: resolve_regions()"); + debug!("RegionVarBindings: resolve_regions()"); let mut errors = opt_vec::Empty; let v = self.infer_variable_values(&mut errors); self.values.put_back(v); @@ -582,7 +582,7 @@ impl RegionVarBindings { a: Region, b: Region) -> cres { - debug2!("glb_concrete_regions({:?}, {:?})", a, b); + debug!("glb_concrete_regions({:?}, {:?})", a, b); match (a, b) { (re_static, r) | (r, re_static) => { // static lives longer than everything else @@ -691,7 +691,7 @@ impl RegionVarBindings { // scopes or two free regions. So, if one of // these scopes is a subscope of the other, return // it. Otherwise fail. - debug2!("intersect_scopes(scope_a={:?}, scope_b={:?}, region_a={:?}, region_b={:?})", + debug!("intersect_scopes(scope_a={:?}, scope_b={:?}, region_a={:?}, region_b={:?})", scope_a, scope_b, region_a, region_b); let rm = self.tcx.region_maps; match rm.nearest_common_ancestor(scope_a, scope_b) { @@ -778,13 +778,13 @@ impl RegionVarBindings { b_vid: RegionVid, b_data: &mut VarData) -> bool { - debug2!("expand_node({:?}, {:?} == {:?})", + debug!("expand_node({:?}, {:?} == {:?})", a_region, b_vid, b_data.value); b_data.classification = Expanding; match b_data.value { NoValue => { - debug2!("Setting initial value of {:?} to {:?}", b_vid, a_region); + debug!("Setting initial value of {:?} to {:?}", b_vid, a_region); b_data.value = Value(a_region); return true; @@ -796,7 +796,7 @@ impl RegionVarBindings { return false; } - debug2!("Expanding value of {:?} from {:?} to {:?}", + debug!("Expanding value of {:?} from {:?} to {:?}", b_vid, cur_region, lub); b_data.value = Value(lub); @@ -843,7 +843,7 @@ impl RegionVarBindings { a_data: &mut VarData, b_region: Region) -> bool { - debug2!("contract_node({:?} == {:?}/{:?}, {:?})", + debug!("contract_node({:?} == {:?}/{:?}, {:?})", a_vid, a_data.value, a_data.classification, b_region); return match a_data.value { @@ -876,7 +876,7 @@ impl RegionVarBindings { b_region: Region) -> bool { if !this.is_subregion_of(a_region, b_region) { - debug2!("Setting {:?} to ErrorValue: {:?} not subregion of {:?}", + debug!("Setting {:?} to ErrorValue: {:?} not subregion of {:?}", a_vid, a_region, b_region); a_data.value = ErrorValue; } @@ -894,14 +894,14 @@ impl RegionVarBindings { if glb == a_region { false } else { - debug2!("Contracting value of {:?} from {:?} to {:?}", + debug!("Contracting value of {:?} from {:?} to {:?}", a_vid, a_region, glb); a_data.value = Value(glb); true } } Err(_) => { - debug2!("Setting {:?} to ErrorValue: no glb of {:?}, {:?}", + debug!("Setting {:?} to ErrorValue: no glb of {:?}, {:?}", a_vid, a_region, b_region); a_data.value = ErrorValue; false @@ -930,7 +930,7 @@ impl RegionVarBindings { continue; } - debug2!("ConcreteFailure: !(sub <= sup): sub={:?}, sup={:?}", + debug!("ConcreteFailure: !(sub <= sup): sub={:?}, sup={:?}", sub, sup); let origin = self.constraints.get_copy(constraint); errors.push(ConcreteFailure(origin, sub, sup)); @@ -943,7 +943,7 @@ impl RegionVarBindings { errors: &mut OptVec) -> ~[VarValue] { - debug2!("extract_values_and_collect_conflicts()"); + debug!("extract_values_and_collect_conflicts()"); // This is the best way that I have found to suppress // duplicate and related errors. Basically we keep a set of @@ -1182,7 +1182,7 @@ impl RegionVarBindings { state.dup_found = true; } - debug2!("collect_concrete_regions(orig_node_idx={:?}, node_idx={:?}, \ + debug!("collect_concrete_regions(orig_node_idx={:?}, node_idx={:?}, \ classification={:?})", orig_node_idx, node_idx, classification); @@ -1204,7 +1204,7 @@ impl RegionVarBindings { graph: &RegionGraph, source_vid: RegionVid, dir: Direction) { - debug2!("process_edges(source_vid={:?}, dir={:?})", source_vid, dir); + debug!("process_edges(source_vid={:?}, dir={:?})", source_vid, dir); let source_node_index = NodeIndex(source_vid.to_uint()); do graph.each_adjacent_edge(source_node_index, dir) |_, edge| { @@ -1240,17 +1240,17 @@ impl RegionVarBindings { while changed { changed = false; iteration += 1; - debug2!("---- {} Iteration \\#{}", tag, iteration); + debug!("---- {} Iteration \\#{}", tag, iteration); for (constraint, _) in self.constraints.iter() { let edge_changed = body(constraint); if edge_changed { - debug2!("Updated due to constraint {}", + debug!("Updated due to constraint {}", constraint.repr(self.tcx)); changed = true; } } } - debug2!("---- {} Complete after {} iteration(s)", tag, iteration); + debug!("---- {} Complete after {} iteration(s)", tag, iteration); } } diff --git a/src/librustc/middle/typeck/infer/resolve.rs b/src/librustc/middle/typeck/infer/resolve.rs index dcb0e6fbd413..564fcb76dc73 100644 --- a/src/librustc/middle/typeck/infer/resolve.rs +++ b/src/librustc/middle/typeck/infer/resolve.rs @@ -104,7 +104,7 @@ impl ResolveState { pub fn resolve_type_chk(&mut self, typ: ty::t) -> fres { self.err = None; - debug2!("Resolving {} (modes={:x})", + debug!("Resolving {} (modes={:x})", ty_to_str(self.infcx.tcx, typ), self.modes); @@ -116,7 +116,7 @@ impl ResolveState { assert!(self.v_seen.is_empty()); match self.err { None => { - debug2!("Resolved to {} + {} (modes={:x})", + debug!("Resolved to {} + {} (modes={:x})", ty_to_str(self.infcx.tcx, rty), ty_to_str(self.infcx.tcx, rty), self.modes); @@ -137,7 +137,7 @@ impl ResolveState { } pub fn resolve_type(&mut self, typ: ty::t) -> ty::t { - debug2!("resolve_type({})", typ.inf_str(self.infcx)); + debug!("resolve_type({})", typ.inf_str(self.infcx)); let _i = indenter(); if !ty::type_needs_infer(typ) { @@ -179,7 +179,7 @@ impl ResolveState { } pub fn resolve_region(&mut self, orig: ty::Region) -> ty::Region { - debug2!("Resolve_region({})", orig.inf_str(self.infcx)); + debug!("Resolve_region({})", orig.inf_str(self.infcx)); match orig { ty::re_infer(ty::ReVar(rid)) => self.resolve_region_var(rid), _ => orig diff --git a/src/librustc/middle/typeck/infer/sub.rs b/src/librustc/middle/typeck/infer/sub.rs index 2a2d7fbcfc74..e5afefe0c716 100644 --- a/src/librustc/middle/typeck/infer/sub.rs +++ b/src/librustc/middle/typeck/infer/sub.rs @@ -56,7 +56,7 @@ impl Combine for Sub { } fn regions(&self, a: ty::Region, b: ty::Region) -> cres { - debug2!("{}.regions({}, {})", + debug!("{}.regions({}, {})", self.tag(), a.inf_str(self.infcx), b.inf_str(self.infcx)); @@ -65,7 +65,7 @@ impl Combine for Sub { } fn mts(&self, a: &ty::mt, b: &ty::mt) -> cres { - debug2!("mts({} <: {})", a.inf_str(self.infcx), b.inf_str(self.infcx)); + debug!("mts({} <: {})", a.inf_str(self.infcx), b.inf_str(self.infcx)); if a.mutbl != b.mutbl { return Err(ty::terr_mutability); @@ -110,7 +110,7 @@ impl Combine for Sub { } fn tys(&self, a: ty::t, b: ty::t) -> cres { - debug2!("{}.tys({}, {})", self.tag(), + debug!("{}.tys({}, {})", self.tag(), a.inf_str(self.infcx), b.inf_str(self.infcx)); if a == b { return Ok(a); } let _indenter = indenter(); @@ -143,7 +143,7 @@ impl Combine for Sub { } fn fn_sigs(&self, a: &ty::FnSig, b: &ty::FnSig) -> cres { - debug2!("fn_sigs(a={}, b={})", + debug!("fn_sigs(a={}, b={})", a.inf_str(self.infcx), b.inf_str(self.infcx)); let _indenter = indenter(); @@ -172,15 +172,15 @@ impl Combine for Sub { do replace_bound_regions_in_fn_sig(self.infcx.tcx, @Nil, None, b) |br| { let skol = self.infcx.region_vars.new_skolemized(br); - debug2!("Bound region {} skolemized to {:?}", + debug!("Bound region {} skolemized to {:?}", bound_region_to_str(self.infcx.tcx, "", false, br), skol); skol } }; - debug2!("a_sig={}", a_sig.inf_str(self.infcx)); - debug2!("b_sig={}", b_sig.inf_str(self.infcx)); + debug!("a_sig={}", a_sig.inf_str(self.infcx)); + debug!("b_sig={}", b_sig.inf_str(self.infcx)); // Compare types now that bound regions have been replaced. let sig = if_ok!(super_fn_sigs(self, &a_sig, &b_sig)); diff --git a/src/librustc/middle/typeck/infer/test.rs b/src/librustc/middle/typeck/infer/test.rs index 8792a068671d..48660ab64e59 100644 --- a/src/librustc/middle/typeck/infer/test.rs +++ b/src/librustc/middle/typeck/infer/test.rs @@ -100,7 +100,7 @@ impl Env { return match search_mod(self, &self.crate.node.module, 0, names) { Some(id) => id, None => { - fail2!("No item found: `%s`", names.connect("::")); + fail!("No item found: `%s`", names.connect("::")); } }; @@ -153,7 +153,7 @@ impl Env { pub fn assert_subtype(&self, a: ty::t, b: ty::t) { if !self.is_subtype(a, b) { - fail2!("%s is not a subtype of %s, but it should be", + fail!("%s is not a subtype of %s, but it should be", self.ty_to_str(a), self.ty_to_str(b)); } @@ -161,7 +161,7 @@ impl Env { pub fn assert_not_subtype(&self, a: ty::t, b: ty::t) { if self.is_subtype(a, b) { - fail2!("%s is a subtype of %s, but it shouldn't be", + fail!("%s is a subtype of %s, but it shouldn't be", self.ty_to_str(a), self.ty_to_str(b)); } @@ -223,12 +223,12 @@ impl Env { pub fn glb() -> Glb { Glb(self.infcx.combine_fields(true, dummy_sp())) } pub fn resolve_regions(exp_count: uint) { - debug2!("resolve_regions(%u)", exp_count); + debug!("resolve_regions(%u)", exp_count); self.infcx.resolve_regions(); if self.err_messages.len() != exp_count { for msg in self.err_messages.iter() { - debug2!("Error encountered: %s", *msg); + debug!("Error encountered: %s", *msg); } format!("Resolving regions encountered %u errors but expected %u!", self.err_messages.len(), @@ -240,7 +240,7 @@ impl Env { pub fn check_lub(&self, t1: ty::t, t2: ty::t, t_lub: ty::t) { match self.lub().tys(t1, t2) { Err(e) => { - fail2!("Unexpected error computing LUB: %?", e) + fail!("Unexpected error computing LUB: %?", e) } Ok(t) => { self.assert_eq(t, t_lub); @@ -256,13 +256,13 @@ impl Env { /// Checks that `GLB(t1,t2) == t_glb` pub fn check_glb(&self, t1: ty::t, t2: ty::t, t_glb: ty::t) { - debug2!("check_glb(t1=%s, t2=%s, t_glb=%s)", + debug!("check_glb(t1=%s, t2=%s, t_glb=%s)", self.ty_to_str(t1), self.ty_to_str(t2), self.ty_to_str(t_glb)); match self.glb().tys(t1, t2) { Err(e) => { - fail2!("Unexpected error computing LUB: %?", e) + fail!("Unexpected error computing LUB: %?", e) } Ok(t) => { self.assert_eq(t, t_glb); @@ -281,7 +281,7 @@ impl Env { match self.lub().tys(t1, t2) { Err(_) => {} Ok(t) => { - fail2!("Unexpected success computing LUB: %?", self.ty_to_str(t)) + fail!("Unexpected success computing LUB: %?", self.ty_to_str(t)) } } } @@ -291,7 +291,7 @@ impl Env { match self.glb().tys(t1, t2) { Err(_) => {} Ok(t) => { - fail2!("Unexpected success computing GLB: %?", self.ty_to_str(t)) + fail!("Unexpected success computing GLB: %?", self.ty_to_str(t)) } } } diff --git a/src/librustc/middle/typeck/infer/unify.rs b/src/librustc/middle/typeck/infer/unify.rs index c05306a27be4..b58a526b7ea9 100644 --- a/src/librustc/middle/typeck/infer/unify.rs +++ b/src/librustc/middle/typeck/infer/unify.rs @@ -116,7 +116,7 @@ impl UnifyInferCtxtMethods for InferCtxt { * Sets the value for `vid` to `new_v`. `vid` MUST be a root node! */ - debug2!("Updating variable {} to {}", + debug!("Updating variable {} to {}", vid.to_str(), new_v.inf_str(self)); let vb = UnifyVid::appropriate_vals_and_bindings(self); @@ -134,7 +134,7 @@ impl UnifyInferCtxtMethods for InferCtxt { // Rank optimization: if you don't know what it is, check // out - debug2!("unify(node_a(id={:?}, rank={:?}), \ + debug!("unify(node_a(id={:?}, rank={:?}), \ node_b(id={:?}, rank={:?}))", node_a.root, node_a.rank, node_b.root, node_b.rank); diff --git a/src/librustc/middle/typeck/mod.rs b/src/librustc/middle/typeck/mod.rs index 116d26967b2b..10005bfb2cb6 100644 --- a/src/librustc/middle/typeck/mod.rs +++ b/src/librustc/middle/typeck/mod.rs @@ -226,7 +226,7 @@ pub struct CrateCtxt { // Functions that write types into the node type table pub fn write_ty_to_tcx(tcx: ty::ctxt, node_id: ast::NodeId, ty: ty::t) { - debug2!("write_ty_to_tcx({}, {})", node_id, ppaux::ty_to_str(tcx, ty)); + debug!("write_ty_to_tcx({}, {})", node_id, ppaux::ty_to_str(tcx, ty)); assert!(!ty::type_needs_infer(ty)); tcx.node_types.insert(node_id as uint, ty); } @@ -234,7 +234,7 @@ pub fn write_substs_to_tcx(tcx: ty::ctxt, node_id: ast::NodeId, substs: ~[ty::t]) { if substs.len() > 0u { - debug2!("write_substs_to_tcx({}, {:?})", node_id, + debug!("write_substs_to_tcx({}, {:?})", node_id, substs.map(|t| ppaux::ty_to_str(tcx, *t))); assert!(substs.iter().all(|t| !ty::type_needs_infer(*t))); tcx.node_type_substs.insert(node_id, substs); diff --git a/src/librustc/middle/typeck/rscope.rs b/src/librustc/middle/typeck/rscope.rs index f6483a48ed00..1967122745da 100644 --- a/src/librustc/middle/typeck/rscope.rs +++ b/src/librustc/middle/typeck/rscope.rs @@ -235,7 +235,7 @@ impl RegionScope for TypeRscope { None => { // if the self region is used, region parameterization should // have inferred that this type is RP - fail2!("region parameterization should have inferred that \ + fail!("region parameterization should have inferred that \ this type is RP"); } Some(ref region_parameterization) => { diff --git a/src/librustc/rustc.rs b/src/librustc/rustc.rs index 712bf66bdaf2..8bdb518b6211 100644 --- a/src/librustc/rustc.rs +++ b/src/librustc/rustc.rs @@ -392,7 +392,7 @@ pub fn monitor(f: ~fn(@diagnostic::Emitter)) { } } // Fail so the process returns a failure code - fail2!(); + fail!(); } } } diff --git a/src/librustc/util/common.rs b/src/librustc/util/common.rs index 46c71ea12f58..ecc53ae5f806 100644 --- a/src/librustc/util/common.rs +++ b/src/librustc/util/common.rs @@ -29,9 +29,9 @@ pub fn time(do_it: bool, what: &str, u: U, f: &fn(U) -> T) -> T { pub fn indent(op: &fn() -> R) -> R { // Use in conjunction with the log post-processor like `src/etc/indenter` // to make debug output more readable. - debug2!(">>"); + debug!(">>"); let r = op(); - debug2!("<< (Result = {:?})", r); + debug!("<< (Result = {:?})", r); r } @@ -40,7 +40,7 @@ pub struct _indenter { } impl Drop for _indenter { - fn drop(&mut self) { debug2!("<<"); } + fn drop(&mut self) { debug!("<<"); } } pub fn _indenter(_i: ()) -> _indenter { @@ -50,7 +50,7 @@ pub fn _indenter(_i: ()) -> _indenter { } pub fn indenter() -> _indenter { - debug2!(">>"); + debug!(">>"); _indenter(()) } diff --git a/src/librustdoc/clean.rs b/src/librustdoc/clean.rs index 169363c75538..6ee7f8c17274 100644 --- a/src/librustdoc/clean.rs +++ b/src/librustdoc/clean.rs @@ -86,7 +86,7 @@ impl Clean for visit_ast::RustdocVisitor { Crate { name: match maybe_meta { Some(x) => x.to_owned(), - None => fail2!("rustdoc requires a \\#[link(name=\"foo\")] \ + None => fail!("rustdoc requires a \\#[link(name=\"foo\")] \ crate attribute"), }, module: Some(self.module.clean()), @@ -623,9 +623,9 @@ pub enum TypeKind { impl Clean for ast::Ty { fn clean(&self) -> Type { use syntax::ast::*; - debug2!("cleaning type `{:?}`", self); + debug!("cleaning type `{:?}`", self); let codemap = local_data::get(super::ctxtkey, |x| *x.unwrap()).sess.codemap; - debug2!("span corresponds to `{}`", codemap.span_to_str(self.span)); + debug!("span corresponds to `{}`", codemap.span_to_str(self.span)); match self.node { ty_nil => Unit, ty_ptr(ref m) => RawPointer(m.mutbl.clean(), ~m.ty.clean()), @@ -643,7 +643,7 @@ impl Clean for ast::Ty { ty_closure(ref c) => Closure(~c.clean()), ty_bare_fn(ref barefn) => BareFunction(~barefn.clean()), ty_bot => Bottom, - ref x => fail2!("Unimplemented type {:?}", x), + ref x => fail!("Unimplemented type {:?}", x), } } } @@ -927,7 +927,7 @@ pub struct Static { impl Clean for doctree::Static { fn clean(&self) -> Item { - debug2!("claning static {}: {:?}", self.name.clean(), self); + debug!("claning static {}: {:?}", self.name.clean(), self); Item { name: Some(self.name.clean()), attrs: self.attrs.clean(), @@ -1107,13 +1107,13 @@ trait ToSource { impl ToSource for syntax::codemap::Span { fn to_src(&self) -> ~str { - debug2!("converting span {:?} to snippet", self.clean()); + debug!("converting span {:?} to snippet", self.clean()); let cm = local_data::get(super::ctxtkey, |x| x.unwrap().clone()).sess.codemap.clone(); let sn = match cm.span_to_snippet(*self) { Some(x) => x, None => ~"" }; - debug2!("got snippet {}", sn); + debug!("got snippet {}", sn); sn } } @@ -1139,17 +1139,17 @@ fn name_from_pat(p: &ast::Pat) -> ~str { PatWild => ~"_", PatIdent(_, ref p, _) => path_to_str(p), PatEnum(ref p, _) => path_to_str(p), - PatStruct(*) => fail2!("tried to get argument name from pat_struct, \ + PatStruct(*) => fail!("tried to get argument name from pat_struct, \ which is not allowed in function arguments"), PatTup(*) => ~"(tuple arg NYI)", PatBox(p) => name_from_pat(p), PatUniq(p) => name_from_pat(p), PatRegion(p) => name_from_pat(p), - PatLit(*) => fail2!("tried to get argument name from pat_lit, \ + PatLit(*) => fail!("tried to get argument name from pat_lit, \ which is not allowed in function arguments"), - PatRange(*) => fail2!("tried to get argument name from pat_range, \ + PatRange(*) => fail!("tried to get argument name from pat_range, \ which is not allowed in function arguments"), - PatVec(*) => fail2!("tried to get argument name from pat_vec, \ + PatVec(*) => fail!("tried to get argument name from pat_vec, \ which is not allowed in function arguments") } } @@ -1158,14 +1158,14 @@ fn name_from_pat(p: &ast::Pat) -> ~str { fn resolve_type(path: Path, tpbs: Option<~[TyParamBound]>, id: ast::NodeId) -> Type { let cx = local_data::get(super::ctxtkey, |x| *x.unwrap()); - debug2!("searching for {:?} in defmap", id); + debug!("searching for {:?} in defmap", id); let d = match cx.tycx.def_map.find(&id) { Some(k) => k, None => { let ctxt = local_data::get(super::ctxtkey, |x| *x.unwrap()); - debug2!("could not find {:?} in defmap (`{}`)", id, + debug!("could not find {:?} in defmap (`{}`)", id, syntax::ast_map::node_id_to_str(ctxt.tycx.items, id, ctxt.sess.intr())); - fail2!("Unexpected failure: unresolved id not in defmap (this is a bug!)") + fail!("Unexpected failure: unresolved id not in defmap (this is a bug!)") } }; @@ -1174,7 +1174,7 @@ fn resolve_type(path: Path, tpbs: Option<~[TyParamBound]>, ast::DefSelf(i) | ast::DefSelfTy(i) => return Self(i), ast::DefTy(i) => (i, TypeEnum), ast::DefTrait(i) => { - debug2!("saw DefTrait in def_to_id"); + debug!("saw DefTrait in def_to_id"); (i, TypeTrait) }, ast::DefPrimTy(p) => match p { @@ -1185,10 +1185,10 @@ fn resolve_type(path: Path, tpbs: Option<~[TyParamBound]>, ast::DefTyParam(i, _) => return Generic(i.node), ast::DefStruct(i) => (i, TypeStruct), ast::DefTyParamBinder(i) => { - debug2!("found a typaram_binder, what is it? {}", i); + debug!("found a typaram_binder, what is it? {}", i); return TyParamBinder(i); }, - x => fail2!("resolved type maps to a weird def {:?}", x), + x => fail!("resolved type maps to a weird def {:?}", x), }; if ast_util::is_local(def_id) { ResolvedPath{ path: path, typarams: tpbs, id: def_id.node } diff --git a/src/librustdoc/core.rs b/src/librustdoc/core.rs index d596139f5c00..b6e16720459e 100644 --- a/src/librustdoc/core.rs +++ b/src/librustdoc/core.rs @@ -84,7 +84,7 @@ fn get_ast_and_resolve(cpath: &Path, .to_owned_vec()); } - debug2!("crate: {:?}", crate); + debug!("crate: {:?}", crate); return (DocContext { crate: crate, tycx: ty_cx, sess: sess }, CrateAnalysis { reexports: reexports, exported_items: exported_items }); } @@ -92,9 +92,9 @@ fn get_ast_and_resolve(cpath: &Path, pub fn run_core (libs: ~[Path], path: &Path) -> (clean::Crate, CrateAnalysis) { let (ctxt, analysis) = get_ast_and_resolve(path, libs); let ctxt = @ctxt; - debug2!("defmap:"); + debug!("defmap:"); for (k, v) in ctxt.tycx.def_map.iter() { - debug2!("{:?}: {:?}", k, v); + debug!("{:?}: {:?}", k, v); } local_data::set(super::ctxtkey, ctxt); diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs index 8b089e76f3a0..e92d159b5a15 100644 --- a/src/librustdoc/html/render.rs +++ b/src/librustdoc/html/render.rs @@ -291,7 +291,7 @@ pub fn run(mut crate: clean::Crate, dst: Path) { // Render all source files (this may turn into a giant no-op) { - info2!("emitting source files"); + info!("emitting source files"); let dst = cx.dst.join("src"); mkdir(&dst); let dst = dst.join(crate.name.as_slice()); @@ -323,9 +323,9 @@ fn write(dst: Path, contents: &str) { /// skipping if the directory already exists. fn mkdir(path: &Path) { do io::io_error::cond.trap(|err| { - error2!("Couldn't create directory `{}`: {}", + error!("Couldn't create directory `{}`: {}", path.display(), err.desc); - fail2!() + fail!() }).inside { if !path.is_dir() { file::mkdir(path); @@ -647,7 +647,7 @@ impl Context { /// sure it always points to the top (relatively) fn recurse(&mut self, s: ~str, f: &fn(&mut Context) -> T) -> T { if s.len() == 0 { - fail2!("what {:?}", self); + fail!("what {:?}", self); } let prev = self.dst.clone(); self.dst.push(s.as_slice()); @@ -679,7 +679,7 @@ impl Context { let workers = match os::getenv("RUSTDOC_WORKERS") { Some(s) => { match from_str::(s) { - Some(n) => n, None => fail2!("{} not a number", s) + Some(n) => n, None => fail!("{} not a number", s) } } None => 10, @@ -974,7 +974,7 @@ fn document(w: &mut io::Writer, item: &clean::Item) { fn item_module(w: &mut io::Writer, cx: &Context, item: &clean::Item, items: &[clean::Item]) { document(w, item); - debug2!("{:?}", items); + debug!("{:?}", items); let mut indices = vec::from_fn(items.len(), |i| i); fn lt(i1: &clean::Item, i2: &clean::Item, idx1: uint, idx2: uint) -> bool { @@ -1013,12 +1013,12 @@ fn item_module(w: &mut io::Writer, cx: &Context, } } - debug2!("{:?}", indices); + debug!("{:?}", indices); do sort::quick_sort(indices) |&i1, &i2| { lt(&items[i1], &items[i2], i1, i2) } - debug2!("{:?}", indices); + debug!("{:?}", indices); let mut curty = ""; for &idx in indices.iter() { let myitem = &items[idx]; diff --git a/src/librustdoc/passes.rs b/src/librustdoc/passes.rs index e11552cb08fa..1e7c42455f24 100644 --- a/src/librustdoc/passes.rs +++ b/src/librustdoc/passes.rs @@ -34,7 +34,7 @@ pub fn strip_hidden(crate: clean::Crate) -> plugins::PluginResult { for innerattr in l.iter() { match innerattr { &clean::Word(ref s) if "hidden" == *s => { - debug2!("found one in strip_hidden; removing"); + debug!("found one in strip_hidden; removing"); return None; }, _ => (), diff --git a/src/librustdoc/rustdoc.rs b/src/librustdoc/rustdoc.rs index df732f1fc869..ddf686a3905d 100644 --- a/src/librustdoc/rustdoc.rs +++ b/src/librustdoc/rustdoc.rs @@ -134,7 +134,7 @@ pub fn main_args(args: &[~str]) -> int { } }; - info2!("going to format"); + info!("going to format"); let started = time::precise_time_ns(); let output = matches.opt_str("o").map(|s| Path::new(s)); match matches.opt_str("w") { @@ -150,7 +150,7 @@ pub fn main_args(args: &[~str]) -> int { } } let ended = time::precise_time_ns(); - info2!("Took {:.03f}s", (ended as f64 - started as f64) / 1e9f64); + info!("Took {:.03f}s", (ended as f64 - started as f64) / 1e9f64); return 0; } @@ -192,12 +192,12 @@ fn rust_input(cratefile: &str, matches: &getopts::Matches) -> Output { // First, parse the crate and extract all relevant information. let libs = Cell::new(matches.opt_strs("L").map(|s| Path::new(s.as_slice()))); let cr = Cell::new(Path::new(cratefile)); - info2!("starting to run rustc"); + info!("starting to run rustc"); let (crate, analysis) = do std::task::try { let cr = cr.take(); core::run_core(libs.take(), &cr) }.unwrap(); - info2!("finished with rustc"); + info!("finished with rustc"); local_data::set(analysiskey, analysis); // Process all of the crate attributes, extracting plugin metadata along @@ -238,19 +238,19 @@ fn rust_input(cratefile: &str, matches: &getopts::Matches) -> Output { let plugin = match PASSES.iter().position(|&(p, _, _)| p == *pass) { Some(i) => PASSES[i].n1(), None => { - error2!("unknown pass {}, skipping", *pass); + error!("unknown pass {}, skipping", *pass); continue }, }; pm.add_plugin(plugin); } - info2!("loading plugins..."); + info!("loading plugins..."); for pname in plugins.move_iter() { pm.load_plugin(pname); } // Run everything! - info2!("Executing passes/plugins"); + info!("Executing passes/plugins"); return pm.run_plugins(crate); } @@ -311,7 +311,7 @@ fn json_output(crate: clean::Crate, res: ~[plugins::PluginJson], dst: Path) { }; let crate_json = match json::from_str(crate_json_str) { Ok(j) => j, - Err(_) => fail2!("Rust generated JSON is invalid??") + Err(_) => fail!("Rust generated JSON is invalid??") }; json.insert(~"crate", crate_json); diff --git a/src/librustdoc/visit_ast.rs b/src/librustdoc/visit_ast.rs index 9fd4c43c2543..79ab752f295a 100644 --- a/src/librustdoc/visit_ast.rs +++ b/src/librustdoc/visit_ast.rs @@ -37,7 +37,7 @@ impl RustdocVisitor { self.attrs = crate.attrs.clone(); fn visit_struct_def(item: &ast::item, sd: @ast::struct_def, generics: &ast::Generics) -> Struct { - debug2!("Visiting struct"); + debug!("Visiting struct"); let struct_type = struct_type_from_def(sd); Struct { id: item.id, @@ -52,7 +52,7 @@ impl RustdocVisitor { } fn visit_enum_def(it: &ast::item, def: &ast::enum_def, params: &ast::Generics) -> Enum { - debug2!("Visiting enum"); + debug!("Visiting enum"); let mut vars: ~[Variant] = ~[]; for x in def.variants.iter() { vars.push(Variant { @@ -77,7 +77,7 @@ impl RustdocVisitor { fn visit_fn(item: &ast::item, fd: &ast::fn_decl, purity: &ast::purity, _abi: &AbiSet, gen: &ast::Generics) -> Function { - debug2!("Visiting fn"); + debug!("Visiting fn"); Function { id: item.id, vis: item.vis, @@ -96,7 +96,7 @@ impl RustdocVisitor { let name = match am.find(&id) { Some(m) => match m { &ast_map::node_item(ref it, _) => Some(it.ident), - _ => fail2!("mod id mapped to non-item in the ast map") + _ => fail!("mod id mapped to non-item in the ast map") }, None => None }; @@ -113,7 +113,7 @@ impl RustdocVisitor { } fn visit_item(item: &ast::item, om: &mut Module) { - debug2!("Visiting item {:?}", item); + debug!("Visiting item {:?}", item); match item.node { ast::item_mod(ref m) => { om.mods.push(visit_mod_contents(item.span, item.attrs.clone(), diff --git a/src/librustpkg/api.rs b/src/librustpkg/api.rs index 02a964022290..1f5802927a64 100644 --- a/src/librustpkg/api.rs +++ b/src/librustpkg/api.rs @@ -54,7 +54,7 @@ fn binary_is_fresh(path: &str, in_hash: &str) -> bool { pub fn new_workcache_context(p: &Path) -> workcache::Context { let db_file = p.join("rustpkg_db.json"); // ??? probably wrong - debug2!("Workcache database file: {}", db_file.display()); + debug!("Workcache database file: {}", db_file.display()); let db = RWArc::new(Database::new(db_file)); let lg = RWArc::new(Logger::new()); let cfg = Arc::new(TreeMap::new()); diff --git a/src/librustpkg/context.rs b/src/librustpkg/context.rs index 554019133b2d..3f1f2a1f59d5 100644 --- a/src/librustpkg/context.rs +++ b/src/librustpkg/context.rs @@ -154,7 +154,7 @@ impl Context { /// rustpkg from a Rust target directory. This is part of a /// kludgy hack used to adjust the sysroot. pub fn in_target(sysroot: &Path) -> bool { - debug2!("Checking whether {} is in target", sysroot.display()); + debug!("Checking whether {} is in target", sysroot.display()); let mut p = sysroot.dir_path(); p.set_filename("rustc"); os::path_is_dir(&p) diff --git a/src/librustpkg/installed_packages.rs b/src/librustpkg/installed_packages.rs index ecc0b7f07e24..767a31ed7856 100644 --- a/src/librustpkg/installed_packages.rs +++ b/src/librustpkg/installed_packages.rs @@ -31,17 +31,17 @@ pub fn list_installed_packages(f: &fn(&PkgId) -> bool) -> bool { } let libfiles = os::list_dir(&p.join("lib")); for lib in libfiles.iter() { - debug2!("Full name: {}", lib.display()); + debug!("Full name: {}", lib.display()); match has_library(lib) { Some(basename) => { let parent = p.join("lib"); - debug2!("parent = {}, child = {}", + debug!("parent = {}, child = {}", parent.display(), lib.display()); let rel_p = lib.path_relative_from(&parent).unwrap(); - debug2!("Rel: {}", rel_p.display()); + debug!("Rel: {}", rel_p.display()); let rel_path = rel_p.join(basename); do rel_path.display().with_str |s| { - debug2!("Rel name: {}", s); + debug!("Rel name: {}", s); f(&PkgId::new(s)); } } diff --git a/src/librustpkg/package_source.rs b/src/librustpkg/package_source.rs index c1e5dbf5ee5c..68d2d9662e34 100644 --- a/src/librustpkg/package_source.rs +++ b/src/librustpkg/package_source.rs @@ -77,7 +77,7 @@ impl PkgSrc { id: PkgId) -> PkgSrc { use conditions::nonexistent_package::cond; - debug2!("Checking package source for package ID {}, \ + debug!("Checking package source for package ID {}, \ workspace = {} -> {}, use_rust_path_hack = {:?}", id.to_str(), source_workspace.display(), @@ -115,13 +115,13 @@ impl PkgSrc { } - debug2!("Checking dirs: {:?}", to_try.map(|p| p.display().to_str()).connect(":")); + debug!("Checking dirs: {:?}", to_try.map(|p| p.display().to_str()).connect(":")); let path = to_try.iter().find(|&d| os::path_exists(d)); // See the comments on the definition of PkgSrc let mut build_in_destination = use_rust_path_hack; - debug2!("1. build_in_destination = {:?}", build_in_destination); + debug!("1. build_in_destination = {:?}", build_in_destination); let dir: Path = match path { Some(d) => (*d).clone(), @@ -131,7 +131,7 @@ impl PkgSrc { for (prefix, suffix) in id.prefixes_iter() { let package_id = PkgId::new(prefix.as_str().unwrap()); let path = build_dir.join(&package_id.path); - debug2!("in loop: checking if {} is a directory", path.display()); + debug!("in loop: checking if {} is a directory", path.display()); if os::path_is_dir(&path) { let ps = PkgSrc::new(source_workspace, destination_workspace, @@ -154,7 +154,7 @@ impl PkgSrc { tests: ~[], benchs: ~[] }; - debug2!("pkgsrc: Returning {}", result.to_str()); + debug!("pkgsrc: Returning {}", result.to_str()); return result; } } @@ -165,12 +165,12 @@ impl PkgSrc { // Ok, no prefixes work, so try fetching from git let mut ok_d = None; for w in output_names.iter() { - debug2!("Calling fetch_git on {}", w.display()); + debug!("Calling fetch_git on {}", w.display()); let target_dir_opt = PkgSrc::fetch_git(w, &id); for p in target_dir_opt.iter() { ok_d = Some(p.clone()); build_in_destination = true; - debug2!("2. build_in_destination = {:?}", build_in_destination); + debug!("2. build_in_destination = {:?}", build_in_destination); break; } match ok_d { @@ -232,10 +232,10 @@ impl PkgSrc { } } }; - debug2!("3. build_in_destination = {:?}", build_in_destination); - debug2!("source: {} dest: {}", source_workspace.display(), destination_workspace.display()); + debug!("3. build_in_destination = {:?}", build_in_destination); + debug!("source: {} dest: {}", source_workspace.display(), destination_workspace.display()); - debug2!("For package id {}, returning {}", id.to_str(), dir.display()); + debug!("For package id {}, returning {}", id.to_str(), dir.display()); if !os::path_is_dir(&dir) { cond.raise((id.clone(), ~"supplied path for package dir is a \ @@ -264,7 +264,7 @@ impl PkgSrc { use conditions::git_checkout_failed::cond; let cwd = os::getcwd(); - debug2!("Checking whether {} (path = {}) exists locally. Cwd = {}, does it? {:?}", + debug!("Checking whether {} (path = {}) exists locally. Cwd = {}, does it? {:?}", pkgid.to_str(), pkgid.path.display(), cwd.display(), os::path_exists(&pkgid.path)); @@ -282,7 +282,7 @@ impl PkgSrc { // FIXME (#9639): This needs to handle non-utf8 paths let url = format!("https://{}", pkgid.path.as_str().unwrap()); - debug2!("Fetching package: git clone {} {} [version={}]", + debug!("Fetching package: git clone {} {} [version={}]", url, clone_target.display(), pkgid.version.to_str()); let mut failed = false; @@ -311,7 +311,7 @@ impl PkgSrc { // return the path for it. Otherwise, None pub fn package_script_option(&self) -> Option { let maybe_path = self.start_dir.join("pkg.rs"); - debug2!("package_script_option: checking whether {} exists", maybe_path.display()); + debug!("package_script_option: checking whether {} exists", maybe_path.display()); if os::path_exists(&maybe_path) { Some(maybe_path) } else { @@ -334,7 +334,7 @@ impl PkgSrc { for c in it { sub.push(c); } - debug2!("Will compile crate {}", sub.display()); + debug!("Will compile crate {}", sub.display()); cs.push(Crate::new(&sub)); } @@ -348,7 +348,7 @@ impl PkgSrc { use conditions::missing_pkg_files::cond; let prefix = self.start_dir.component_iter().len(); - debug2!("Matching against {}", self.id.short_name); + debug!("Matching against {}", self.id.short_name); do os::walk_dir(&self.start_dir) |pth| { let maybe_known_crate_set = match pth.filename_str() { Some(filename) if filter(filename) => match filename { @@ -377,7 +377,7 @@ impl PkgSrc { cond.raise(self.id.clone()); } - debug2!("In {}, found {} libs, {} mains, {} tests, {} benchs", + debug!("In {}, found {} libs, {} mains, {} tests, {} benchs", self.start_dir.display(), self.libs.len(), self.mains.len(), @@ -393,11 +393,11 @@ impl PkgSrc { what: OutputType) { for crate in crates.iter() { let path = self.start_dir.join(&crate.file); - debug2!("build_crates: compiling {}", path.display()); + debug!("build_crates: compiling {}", path.display()); let cfgs = crate.cfgs + cfgs; do ctx.workcache_context.with_prep(crate_tag(&path)) |prep| { - debug2!("Building crate {}, declaring it as an input", path.display()); + debug!("Building crate {}, declaring it as an input", path.display()); // FIXME (#9639): This needs to handle non-utf8 paths prep.declare_input("file", path.as_str().unwrap(), workcache_support::digest_file_with_date(&path)); @@ -424,7 +424,7 @@ impl PkgSrc { // output as "Some(\"path\")". But I don't know what to do about it. // FIXME (#9639): This needs to handle non-utf8 paths let result = result.as_ref().map(|p|p.as_str().unwrap()); - debug2!("Result of compiling {} was {}", subpath.display(), result.to_str()); + debug!("Result of compiling {} was {}", subpath.display(), result.to_str()); result.to_str() } }; @@ -436,11 +436,11 @@ impl PkgSrc { pub fn declare_inputs(&self, prep: &mut workcache::Prep) { let to_do = ~[self.libs.clone(), self.mains.clone(), self.tests.clone(), self.benchs.clone()]; - debug2!("In declare inputs, self = {}", self.to_str()); + debug!("In declare inputs, self = {}", self.to_str()); for cs in to_do.iter() { for c in cs.iter() { let path = self.start_dir.join(&c.file); - debug2!("Declaring input: {}", path.display()); + debug!("Declaring input: {}", path.display()); // FIXME (#9639): This needs to handle non-utf8 paths prep.declare_input("file", path.as_str().unwrap(), workcache_support::digest_file_with_date(&path.clone())); @@ -459,14 +459,14 @@ impl PkgSrc { let mains = self.mains.clone(); let tests = self.tests.clone(); let benchs = self.benchs.clone(); - debug2!("Building libs in {}, destination = {}", + debug!("Building libs in {}, destination = {}", self.source_workspace.display(), self.build_workspace().display()); self.build_crates(build_context, &mut deps, libs, cfgs, Lib); - debug2!("Building mains"); + debug!("Building mains"); self.build_crates(build_context, &mut deps, mains, cfgs, Main); - debug2!("Building tests"); + debug!("Building tests"); self.build_crates(build_context, &mut deps, tests, cfgs, Test); - debug2!("Building benches"); + debug!("Building benches"); self.build_crates(build_context, &mut deps, benchs, cfgs, Bench); deps } @@ -486,7 +486,7 @@ impl PkgSrc { let crate_sets = [&self.libs, &self.mains, &self.tests, &self.benchs]; for crate_set in crate_sets.iter() { for c in crate_set.iter() { - debug2!("Built crate: {}", c.file.display()) + debug!("Built crate: {}", c.file.display()) } } } diff --git a/src/librustpkg/path_util.rs b/src/librustpkg/path_util.rs index 911cfde7164a..c47c89d777b4 100644 --- a/src/librustpkg/path_util.rs +++ b/src/librustpkg/path_util.rs @@ -25,7 +25,7 @@ use messages::*; pub fn default_workspace() -> Path { let p = rust_path(); if p.is_empty() { - fail2!("Empty RUST_PATH"); + fail!("Empty RUST_PATH"); } let result = p[0]; if !os::path_is_dir(&result) { @@ -88,9 +88,9 @@ pub fn workspace_contains_package_id_(pkgid: &PkgId, workspace: &Path, }; if found.is_some() { - debug2!("Found {} in {}", pkgid.to_str(), workspace.display()); + debug!("Found {} in {}", pkgid.to_str(), workspace.display()); } else { - debug2!("Didn't find {} in {}", pkgid.to_str(), workspace.display()); + debug!("Didn't find {} in {}", pkgid.to_str(), workspace.display()); } found } @@ -123,13 +123,13 @@ fn target_bin_dir(workspace: &Path) -> Path { pub fn built_executable_in_workspace(pkgid: &PkgId, workspace: &Path) -> Option { let mut result = target_build_dir(workspace); result = mk_output_path(Main, Build, pkgid, result); - debug2!("built_executable_in_workspace: checking whether {} exists", + debug!("built_executable_in_workspace: checking whether {} exists", result.display()); if os::path_exists(&result) { Some(result) } else { - debug2!("built_executable_in_workspace: {} does not exist", result.display()); + debug!("built_executable_in_workspace: {} does not exist", result.display()); None } } @@ -150,13 +150,13 @@ fn output_in_workspace(pkgid: &PkgId, workspace: &Path, what: OutputType) -> Opt let mut result = target_build_dir(workspace); // should use a target-specific subdirectory result = mk_output_path(what, Build, pkgid, result); - debug2!("output_in_workspace: checking whether {} exists", + debug!("output_in_workspace: checking whether {} exists", result.display()); if os::path_exists(&result) { Some(result) } else { - error2!("output_in_workspace: {} does not exist", result.display()); + error!("output_in_workspace: {} does not exist", result.display()); None } } @@ -186,13 +186,13 @@ pub fn installed_library_in_workspace(pkg_path: &Path, workspace: &Path) -> Opti /// `short_name` is taken as the link name of the library. pub fn library_in_workspace(path: &Path, short_name: &str, where: Target, workspace: &Path, prefix: &str, version: &Version) -> Option { - debug2!("library_in_workspace: checking whether a library named {} exists", + debug!("library_in_workspace: checking whether a library named {} exists", short_name); // We don't know what the hash is, so we have to search through the directory // contents - debug2!("short_name = {} where = {:?} workspace = {} \ + debug!("short_name = {} where = {:?} workspace = {} \ prefix = {}", short_name, where, workspace.display(), prefix); let dir_to_search = match where { @@ -209,20 +209,20 @@ pub fn system_library(sysroot: &Path, lib_name: &str) -> Option { } fn library_in(short_name: &str, version: &Version, dir_to_search: &Path) -> Option { - debug2!("Listing directory {}", dir_to_search.display()); + debug!("Listing directory {}", dir_to_search.display()); let dir_contents = os::list_dir(dir_to_search); - debug2!("dir has {:?} entries", dir_contents.len()); + debug!("dir has {:?} entries", dir_contents.len()); let lib_prefix = format!("{}{}", os::consts::DLL_PREFIX, short_name); let lib_filetype = os::consts::DLL_EXTENSION; - debug2!("lib_prefix = {} and lib_filetype = {}", lib_prefix, lib_filetype); + debug!("lib_prefix = {} and lib_filetype = {}", lib_prefix, lib_filetype); // Find a filename that matches the pattern: // (lib_prefix)-hash-(version)(lib_suffix) let mut libraries = do dir_contents.iter().filter |p| { let extension = p.extension_str(); - debug2!("p = {}, p's extension is {:?}", p.display(), extension); + debug!("p = {}, p's extension is {:?}", p.display(), extension); match extension { None => false, Some(ref s) => lib_filetype == *s @@ -243,12 +243,12 @@ fn library_in(short_name: &str, version: &Version, dir_to_search: &Path) -> Opti if f_name.is_empty() { break; } match f_name.rfind('-') { Some(i) => { - debug2!("Maybe {} is a version", f_name.slice(i + 1, f_name.len())); + debug!("Maybe {} is a version", f_name.slice(i + 1, f_name.len())); match try_parsing_version(f_name.slice(i + 1, f_name.len())) { Some(ref found_vers) if version == found_vers => { match f_name.slice(0, i).rfind('-') { Some(j) => { - debug2!("Maybe {} equals {}", f_name.slice(0, j), lib_prefix); + debug!("Maybe {} equals {}", f_name.slice(0, j), lib_prefix); if f_name.slice(0, j) == lib_prefix { result_filename = Some(p_path.clone()); } @@ -266,7 +266,7 @@ fn library_in(short_name: &str, version: &Version, dir_to_search: &Path) -> Opti } // for if result_filename.is_none() { - debug2!("warning: library_in_workspace didn't find a library in {} for {}", + debug!("warning: library_in_workspace didn't find a library in {} for {}", dir_to_search.display(), short_name); } @@ -274,7 +274,7 @@ fn library_in(short_name: &str, version: &Version, dir_to_search: &Path) -> Opti // (if result_filename != None) let abs_path = do result_filename.map |result_filename| { let absolute_path = dir_to_search.join(&result_filename); - debug2!("result_filename = {}", absolute_path.display()); + debug!("result_filename = {}", absolute_path.display()); absolute_path }; @@ -348,7 +348,7 @@ pub fn build_pkg_id_in_workspace(pkgid: &PkgId, workspace: &Path) -> Path { let mut result = target_build_dir(workspace); result.push(&pkgid.path); - debug2!("Creating build dir {} for package id {}", result.display(), + debug!("Creating build dir {} for package id {}", result.display(), pkgid.to_str()); if os::path_exists(&result) || os::mkdir_recursive(&result, U_RWX) { result @@ -372,7 +372,7 @@ pub fn mk_output_path(what: OutputType, where: Target, // and if we're just building, it goes in a package-specific subdir Build => workspace.join(&pkg_id.path) }; - debug2!("[{:?}:{:?}] mk_output_path: short_name = {}, path = {}", what, where, + debug!("[{:?}:{:?}] mk_output_path: short_name = {}, path = {}", what, where, if what == Lib { short_name_with_version.clone() } else { pkg_id.short_name.clone() }, dir.display()); let mut output_path = match what { @@ -390,7 +390,7 @@ pub fn mk_output_path(what: OutputType, where: Target, if !output_path.is_absolute() { output_path = os::getcwd().join(&output_path); } - debug2!("mk_output_path: returning {}", output_path.display()); + debug!("mk_output_path: returning {}", output_path.display()); output_path } @@ -431,13 +431,13 @@ pub fn find_dir_using_rust_path_hack(p: &PkgId) -> Option { // Note that this only matches if the package ID being searched for // has a name that's a single component if dir.ends_with_path(&p.path) || dir.ends_with_path(&versionize(&p.path, &p.version)) { - debug2!("In find_dir_using_rust_path_hack: checking dir {}", dir.display()); + debug!("In find_dir_using_rust_path_hack: checking dir {}", dir.display()); if dir_has_crate_file(dir) { - debug2!("Did find id {} in dir {}", p.to_str(), dir.display()); + debug!("Did find id {} in dir {}", p.to_str(), dir.display()); return Some(dir.clone()); } } - debug2!("Didn't find id {} in dir {}", p.to_str(), dir.display()) + debug!("Didn't find id {} in dir {}", p.to_str(), dir.display()) } None } diff --git a/src/librustpkg/rustpkg.rs b/src/librustpkg/rustpkg.rs index 4d7983d9ff1d..6c55f7af0c06 100644 --- a/src/librustpkg/rustpkg.rs +++ b/src/librustpkg/rustpkg.rs @@ -104,7 +104,7 @@ impl<'self> PkgScript<'self> { let binary = os::args()[0].to_managed(); // Build the rustc session data structures to pass // to the compiler - debug2!("pkgscript parse: {}", sysroot.display()); + debug!("pkgscript parse: {}", sysroot.display()); let options = @session::options { binary: binary, maybe_sysroot: Some(sysroot), @@ -120,7 +120,7 @@ impl<'self> PkgScript<'self> { let crate = driver::phase_2_configure_and_expand(sess, cfg.clone(), crate); let work_dir = build_pkg_id_in_workspace(id, workspace); - debug2!("Returning package script with id {}", id.to_str()); + debug!("Returning package script with id {}", id.to_str()); PkgScript { id: id, @@ -140,10 +140,10 @@ impl<'self> PkgScript<'self> { sysroot: &Path) -> (~[~str], ExitCode) { let sess = self.sess; - debug2!("Working directory = {}", self.build_dir.display()); + debug!("Working directory = {}", self.build_dir.display()); // Collect together any user-defined commands in the package script let crate = util::ready_crate(sess, self.crate.take_unwrap()); - debug2!("Building output filenames with script name {}", + debug!("Building output filenames with script name {}", driver::source_name(&driver::file_input(self.input.clone()))); let exe = self.build_dir.join("pkg" + util::exe_suffix()); util::compile_crate_from_input(&self.input, @@ -152,7 +152,7 @@ impl<'self> PkgScript<'self> { &self.build_dir, sess, crate); - debug2!("Running program: {} {} {}", exe.display(), + debug!("Running program: {} {} {}", exe.display(), sysroot.display(), "install"); // Discover the output // FIXME (#9639): This needs to handle non-utf8 paths @@ -165,7 +165,7 @@ impl<'self> PkgScript<'self> { return (~[], status); } else { - debug2!("Running program (configs): {} {} {}", + debug!("Running program (configs): {} {} {}", exe.display(), sysroot.display(), "configs"); // FIXME (#9639): This needs to handle non-utf8 paths let output = run::process_output(exe.as_str().unwrap(), @@ -243,7 +243,7 @@ impl CtxMethods for BuildContext { let pkgid = PkgId::new(args[0].clone()); let mut dest_ws = default_workspace(); do each_pkg_parent_workspace(&self.context, &pkgid) |workspace| { - debug2!("found pkg {} in workspace {}, trying to build", + debug!("found pkg {} in workspace {}, trying to build", pkgid.to_str(), workspace.display()); dest_ws = determine_destination(os::getcwd(), self.context.use_rust_path_hack, @@ -315,7 +315,7 @@ impl CtxMethods for BuildContext { // argument let pkgid = PkgId::new(args[0]); let workspaces = pkg_parent_workspaces(&self.context, &pkgid); - debug2!("package ID = {}, found it in {:?} workspaces", + debug!("package ID = {}, found it in {:?} workspaces", pkgid.to_str(), workspaces.len()); if workspaces.is_empty() { let d = default_workspace(); @@ -401,13 +401,13 @@ impl CtxMethods for BuildContext { self.unprefer(args[0], None); } - _ => fail2!("I don't know the command `{}`", cmd) + _ => fail!("I don't know the command `{}`", cmd) } } fn do_cmd(&self, _cmd: &str, _pkgname: &str) { // stub - fail2!("`do` not yet implemented"); + fail!("`do` not yet implemented"); } fn build(&self, pkg_src: &mut PkgSrc, what_to_build: &WhatToBuild) { @@ -416,7 +416,7 @@ impl CtxMethods for BuildContext { let workspace = pkg_src.source_workspace.clone(); let pkgid = pkg_src.id.clone(); - debug2!("build: workspace = {} (in Rust path? {:?} is git dir? {:?} \ + debug!("build: workspace = {} (in Rust path? {:?} is git dir? {:?} \ pkgid = {} pkgsrc start_dir = {}", workspace.display(), in_rust_path(&workspace), is_git_dir(&workspace.join(&pkgid.path)), pkgid.to_str(), pkg_src.start_dir.display()); @@ -435,7 +435,7 @@ impl CtxMethods for BuildContext { _ => cond.raise((pkgid.path.as_str().unwrap().to_owned(), out_dir.clone())) }; let default_ws = default_workspace(); - debug2!("Calling build recursively with {:?} and {:?}", default_ws.display(), + debug!("Calling build recursively with {:?} and {:?}", default_ws.display(), pkgid.to_str()); return self.build(&mut PkgSrc::new(default_ws.clone(), default_ws, @@ -445,9 +445,9 @@ impl CtxMethods for BuildContext { // Is there custom build logic? If so, use it let mut custom = false; - debug2!("Package source directory = {}", pkg_src.to_str()); + debug!("Package source directory = {}", pkg_src.to_str()); let opt = pkg_src.package_script_option(); - debug2!("Calling pkg_script_option on {:?}", opt); + debug!("Calling pkg_script_option on {:?}", opt); let cfgs = match pkg_src.package_script_option() { Some(package_script_path) => { let sysroot = self.sysroot_to_use(); @@ -469,16 +469,16 @@ impl CtxMethods for BuildContext { pscript.run_custom(exec, &sub_sysroot) } }; - debug2!("Command return code = {:?}", hook_result); + debug!("Command return code = {:?}", hook_result); if hook_result != 0 { - fail2!("Error running custom build command") + fail!("Error running custom build command") } custom = true; // otherwise, the package script succeeded cfgs } None => { - debug2!("No package script, continuing"); + debug!("No package script, continuing"); ~[] } } + self.context.cfgs; @@ -495,7 +495,7 @@ impl CtxMethods for BuildContext { &JustOne(ref p) => { // We expect that p is relative to the package source's start directory, // so check that assumption - debug2!("JustOne: p = {}", p.display()); + debug!("JustOne: p = {}", p.display()); assert!(os::path_exists(&pkg_src.start_dir.join(p))); if is_lib(p) { PkgSrc::push_crate(&mut pkg_src.libs, 0, p); @@ -534,7 +534,7 @@ impl CtxMethods for BuildContext { fn info(&self) { // stub - fail2!("info not yet implemented"); + fail!("info not yet implemented"); } fn install(&self, mut pkg_src: PkgSrc, what: &WhatToBuild) -> (~[Path], ~[(~str, ~str)]) { @@ -545,7 +545,7 @@ impl CtxMethods for BuildContext { let mut inputs = ~[]; let mut build_inputs = ~[]; - debug2!("Installing package source: {}", pkg_src.to_str()); + debug!("Installing package source: {}", pkg_src.to_str()); // workcache only knows about *crates*. Building a package // just means inferring all the crates in it, then building each one. @@ -553,11 +553,11 @@ impl CtxMethods for BuildContext { let to_do = ~[pkg_src.libs.clone(), pkg_src.mains.clone(), pkg_src.tests.clone(), pkg_src.benchs.clone()]; - debug2!("In declare inputs for {}", id.to_str()); + debug!("In declare inputs for {}", id.to_str()); for cs in to_do.iter() { for c in cs.iter() { let path = pkg_src.start_dir.join(&c.file); - debug2!("Recording input: {}", path.display()); + debug!("Recording input: {}", path.display()); // FIXME (#9639): This needs to handle non-utf8 paths inputs.push((~"file", path.as_str().unwrap().to_owned())); build_inputs.push(path); @@ -568,7 +568,7 @@ impl CtxMethods for BuildContext { build_inputs, &pkg_src.destination_workspace, &id).map(|s| Path::new(s.as_slice())); - debug2!("install: id = {}, about to call discover_outputs, {:?}", + debug!("install: id = {}, about to call discover_outputs, {:?}", id.to_str(), result.map(|p| p.display().to_str())); installed_files = installed_files + result; note(format!("Installed package {} to {}", @@ -585,7 +585,7 @@ impl CtxMethods for BuildContext { id: &PkgId) -> ~[~str] { use conditions::copy_failed::cond; - debug2!("install_no_build: assuming {} comes from {} with target {}", + debug!("install_no_build: assuming {} comes from {} with target {}", id.to_str(), build_workspace.display(), target_workspace.display()); // Now copy stuff into the install dirs @@ -595,7 +595,7 @@ impl CtxMethods for BuildContext { let target_lib = maybe_library.as_ref() .map(|_| target_library_in_workspace(id, target_workspace)); - debug2!("target_exec = {} target_lib = {:?} \ + debug!("target_exec = {} target_lib = {:?} \ maybe_executable = {:?} maybe_library = {:?}", target_exec.display(), target_lib, maybe_executable, maybe_library); @@ -641,7 +641,7 @@ impl CtxMethods for BuildContext { for exec in subex.iter() { - debug2!("Copying: {} -> {}", exec.display(), sub_target_ex.display()); + debug!("Copying: {} -> {}", exec.display(), sub_target_ex.display()); if !(os::mkdir_recursive(&sub_target_ex.dir_path(), U_RWX) && os::copy_file(exec, &sub_target_ex)) { cond.raise(((*exec).clone(), sub_target_ex.clone())); @@ -661,7 +661,7 @@ impl CtxMethods for BuildContext { os::copy_file(lib, &target_lib)) { cond.raise(((*lib).clone(), target_lib.clone())); } - debug2!("3. discovering output {}", target_lib.display()); + debug!("3. discovering output {}", target_lib.display()); exe_thing.discover_output("binary", target_lib.as_str().unwrap(), workcache_support::digest_only_date(&target_lib)); @@ -673,13 +673,13 @@ impl CtxMethods for BuildContext { } fn prefer(&self, _id: &str, _vers: Option<~str>) { - fail2!("prefer not yet implemented"); + fail!("prefer not yet implemented"); } fn test(&self, pkgid: &PkgId, workspace: &Path) { match built_test_in_workspace(pkgid, workspace) { Some(test_exec) => { - debug2!("test: test_exec = {}", test_exec.display()); + debug!("test: test_exec = {}", test_exec.display()); // FIXME (#9639): This needs to handle non-utf8 paths let status = run::process_status(test_exec.as_str().unwrap(), [~"--test"]); os::set_exit_status(status); @@ -700,11 +700,11 @@ impl CtxMethods for BuildContext { } fn uninstall(&self, _id: &str, _vers: Option<~str>) { - fail2!("uninstall not yet implemented"); + fail!("uninstall not yet implemented"); } fn unprefer(&self, _id: &str, _vers: Option<~str>) { - fail2!("unprefer not yet implemented"); + fail!("unprefer not yet implemented"); } } @@ -880,9 +880,9 @@ pub fn main_args(args: &[~str]) -> int { _ => filesearch::get_or_default_sysroot() }; - debug2!("Using sysroot: {}", sroot.display()); + debug!("Using sysroot: {}", sroot.display()); let ws = default_workspace(); - debug2!("Will store workcache in {}", ws.display()); + debug!("Will store workcache in {}", ws.display()); let rm_args = remaining_args.clone(); let sub_cmd = cmd.clone(); diff --git a/src/librustpkg/search.rs b/src/librustpkg/search.rs index 080ba461f05f..aec4e95f8e21 100644 --- a/src/librustpkg/search.rs +++ b/src/librustpkg/search.rs @@ -17,7 +17,7 @@ use version::Version; /// FIXME #8711: This ignores the desired version. pub fn find_installed_library_in_rust_path(pkg_path: &Path, _version: &Version) -> Option { let rp = rust_path(); - debug2!("find_installed_library_in_rust_path: looking for path {}", + debug!("find_installed_library_in_rust_path: looking for path {}", pkg_path.display()); for p in rp.iter() { match installed_library_in_workspace(pkg_path, p) { diff --git a/src/librustpkg/source_control.rs b/src/librustpkg/source_control.rs index 3c879af34cf1..9a571e075708 100644 --- a/src/librustpkg/source_control.rs +++ b/src/librustpkg/source_control.rs @@ -23,14 +23,14 @@ use path_util::chmod_read_only; /// Returns `CheckedOutSources` if the clone succeeded. pub fn safe_git_clone(source: &Path, v: &Version, target: &Path) -> CloneResult { if os::path_exists(source) { - debug2!("{} exists locally! Cloning it into {}", + debug!("{} exists locally! Cloning it into {}", source.display(), target.display()); // Ok to use target here; we know it will succeed assert!(os::path_is_dir(source)); assert!(is_git_dir(source)); if !os::path_exists(target) { - debug2!("Running: git clone {} {}", source.display(), target.display()); + debug!("Running: git clone {} {}", source.display(), target.display()); // FIXME (#9639): This needs to handle non-utf8 paths let outp = run::process_output("git", [~"clone", source.as_str().unwrap().to_owned(), @@ -44,7 +44,7 @@ pub fn safe_git_clone(source: &Path, v: &Version, target: &Path) -> CloneResult match v { &ExactRevision(ref s) => { let git_dir = target.join(".git"); - debug2!("`Running: git --work-tree={} --git-dir={} checkout {}", + debug!("`Running: git --work-tree={} --git-dir={} checkout {}", *s, target.display(), git_dir.display()); // FIXME (#9639: This needs to handle non-utf8 paths let outp = run::process_output("git", @@ -65,7 +65,7 @@ pub fn safe_git_clone(source: &Path, v: &Version, target: &Path) -> CloneResult // case where a version was requested, but I haven't implemented it. assert!(*v == NoVersion); let git_dir = target.join(".git"); - debug2!("Running: git --work-tree={} --git-dir={} pull --no-edit {}", + debug!("Running: git --work-tree={} --git-dir={} pull --no-edit {}", target.display(), git_dir.display(), source.display()); // FIXME (#9639: This needs to handle non-utf8 paths let args = [format!("--work-tree={}", target.as_str().unwrap().to_owned()), @@ -111,8 +111,8 @@ pub fn git_clone_url(source: &str, target: &Path, v: &Version) { let outp = run::process_output("git", [~"clone", source.to_owned(), target.as_str().unwrap().to_owned()]); if outp.status != 0 { - debug2!("{}", str::from_utf8_owned(outp.output.clone())); - debug2!("{}", str::from_utf8_owned(outp.error)); + debug!("{}", str::from_utf8_owned(outp.output.clone())); + debug!("{}", str::from_utf8_owned(outp.error)); cond.raise((source.to_owned(), target.clone())) } else { @@ -121,8 +121,8 @@ pub fn git_clone_url(source: &str, target: &Path, v: &Version) { let outp = process_output_in_cwd("git", [~"checkout", s.to_owned()], target); if outp.status != 0 { - debug2!("{}", str::from_utf8_owned(outp.output.clone())); - debug2!("{}", str::from_utf8_owned(outp.error)); + debug!("{}", str::from_utf8_owned(outp.output.clone())); + debug!("{}", str::from_utf8_owned(outp.error)); cond.raise((source.to_owned(), target.clone())) } } diff --git a/src/librustpkg/tests.rs b/src/librustpkg/tests.rs index 08c0fb72bf31..58c6b4ff81fb 100644 --- a/src/librustpkg/tests.rs +++ b/src/librustpkg/tests.rs @@ -115,12 +115,12 @@ fn mk_temp_workspace(short_name: &Path, version: &Version) -> (TempDir, Path) { short_name.as_str().unwrap(), version.to_str())]); - debug2!("Created {} and does it exist? {:?}", package_dir.display(), + debug!("Created {} and does it exist? {:?}", package_dir.display(), os::path_is_dir(&package_dir)); // Create main, lib, test, and bench files - debug2!("mk_workspace: creating {}", package_dir.display()); + debug!("mk_workspace: creating {}", package_dir.display()); assert!(os::mkdir_recursive(&package_dir, U_RWX)); - debug2!("Created {} and does it exist? {:?}", package_dir.display(), + debug!("Created {} and does it exist? {:?}", package_dir.display(), os::path_is_dir(&package_dir)); // Create main, lib, test, and bench files @@ -146,7 +146,7 @@ fn run_git(args: &[~str], env: Option<~[(~str, ~str)]>, cwd: &Path, err_msg: &st }); let rslt = prog.finish_with_output(); if rslt.status != 0 { - fail2!("{} [git returned {:?}, output = {}, error = {}]", err_msg, + fail!("{} [git returned {:?}, output = {}, error = {}]", err_msg, rslt.status, str::from_utf8(rslt.output), str::from_utf8(rslt.error)); } } @@ -159,7 +159,7 @@ fn init_git_repo(p: &Path) -> TempDir { let work_dir = tmp.path().join(p); let work_dir_for_opts = work_dir.clone(); assert!(os::mkdir_recursive(&work_dir, U_RWX)); - debug2!("Running: git init in {}", work_dir.display()); + debug!("Running: git init in {}", work_dir.display()); run_git([~"init"], None, &work_dir_for_opts, format!("Couldn't initialize git repository in {}", work_dir.display())); // Add stuff to the dir so that git tag succeeds @@ -239,7 +239,7 @@ fn rustpkg_exec() -> Path { second_try } else { - fail2!("in rustpkg test, can't find an installed rustpkg"); + fail!("in rustpkg test, can't find an installed rustpkg"); } } } @@ -247,7 +247,7 @@ fn rustpkg_exec() -> Path { fn command_line_test(args: &[~str], cwd: &Path) -> ProcessOutput { match command_line_test_with_env(args, cwd, None) { Success(r) => r, - Fail(error) => fail2!("Command line test failed with error {}", error) + Fail(error) => fail!("Command line test failed with error {}", error) } } @@ -260,9 +260,9 @@ fn command_line_test_expect_fail(args: &[~str], env: Option<~[(~str, ~str)]>, expected_exitcode: int) { match command_line_test_with_env(args, cwd, env) { - Success(_) => fail2!("Should have failed with {}, but it succeeded", expected_exitcode), + Success(_) => fail!("Should have failed with {}, but it succeeded", expected_exitcode), Fail(error) if error == expected_exitcode => (), // ok - Fail(other) => fail2!("Expected to fail with {}, but failed with {} instead", + Fail(other) => fail!("Expected to fail with {}, but failed with {} instead", expected_exitcode, other) } } @@ -284,7 +284,7 @@ fn command_line_test_with_env(args: &[~str], cwd: &Path, env: Option<~[(~str, ~s Some(ref pairs) => pairs.map(|&(ref k, ref v)| { format!("{}={}", *k, *v) }).connect(","), None => ~"" }; - debug2!("{} cd {}; {} {}", env_str, cwd.display(), cmd, args.connect(" ")); + debug!("{} cd {}; {} {}", env_str, cwd.display(), cmd, args.connect(" ")); assert!(os::path_is_dir(&*cwd)); let cwd = (*cwd).clone(); let mut prog = run::Process::new(cmd, args, run::ProcessOptions { @@ -295,7 +295,7 @@ fn command_line_test_with_env(args: &[~str], cwd: &Path, env: Option<~[(~str, ~s err_fd: None }); let output = prog.finish_with_output(); - debug2!("Output from command {} with args {:?} was {} \\{{}\\}[{:?}]", + debug!("Output from command {} with args {:?} was {} \\{{}\\}[{:?}]", cmd, args, str::from_utf8(output.output), str::from_utf8(output.error), output.status); @@ -306,7 +306,7 @@ So tests that use this need to check the existence of a file to make sure the command succeeded */ if output.status != 0 { - debug2!("Command {} {:?} failed with exit code {:?}; its output was --- {} ---", + debug!("Command {} {:?} failed with exit code {:?}; its output was --- {} ---", cmd, args, output.status, str::from_utf8(output.output) + str::from_utf8(output.error)); Fail(output.status) @@ -318,7 +318,7 @@ to make sure the command succeeded fn create_local_package(pkgid: &PkgId) -> TempDir { let (workspace, parent_dir) = mk_temp_workspace(&pkgid.path, &pkgid.version); - debug2!("Created empty package dir for {}, returning {}", pkgid.to_str(), parent_dir.display()); + debug!("Created empty package dir for {}, returning {}", pkgid.to_str(), parent_dir.display()); workspace } @@ -328,7 +328,7 @@ fn create_local_package_in(pkgid: &PkgId, pkgdir: &Path) -> Path { // Create main, lib, test, and bench files assert!(os::mkdir_recursive(&package_dir, U_RWX)); - debug2!("Created {} and does it exist? {:?}", package_dir.display(), + debug!("Created {} and does it exist? {:?}", package_dir.display(), os::path_is_dir(&package_dir)); // Create main, lib, test, and bench files @@ -344,7 +344,7 @@ fn create_local_package_in(pkgid: &PkgId, pkgdir: &Path) -> Path { } fn create_local_package_with_test(pkgid: &PkgId) -> TempDir { - debug2!("Dry run -- would create package {:?} with test", pkgid); + debug!("Dry run -- would create package {:?} with test", pkgid); create_local_package(pkgid) // Already has tests??? } @@ -363,7 +363,7 @@ fn create_local_package_with_dep(pkgid: &PkgId, subord_pkgid: &PkgId) -> TempDir fn create_local_package_with_custom_build_hook(pkgid: &PkgId, custom_build_hook: &str) -> TempDir { - debug2!("Dry run -- would create package {} with custom build hook {}", + debug!("Dry run -- would create package {} with custom build hook {}", pkgid.to_str(), custom_build_hook); create_local_package(pkgid) // actually write the pkg.rs with the custom build hook @@ -375,9 +375,9 @@ fn assert_lib_exists(repo: &Path, pkg_path: &Path, v: Version) { } fn lib_exists(repo: &Path, pkg_path: &Path, _v: Version) -> bool { // ??? version? - debug2!("assert_lib_exists: repo = {}, pkg_path = {}", repo.display(), pkg_path.display()); + debug!("assert_lib_exists: repo = {}, pkg_path = {}", repo.display(), pkg_path.display()); let lib = installed_library_in_workspace(pkg_path, repo); - debug2!("assert_lib_exists: checking whether {:?} exists", lib); + debug!("assert_lib_exists: checking whether {:?} exists", lib); lib.is_some() && { let libname = lib.get_ref(); os::path_exists(libname) && is_rwx(libname) @@ -389,13 +389,13 @@ fn assert_executable_exists(repo: &Path, short_name: &str) { } fn executable_exists(repo: &Path, short_name: &str) -> bool { - debug2!("executable_exists: repo = {}, short_name = {}", repo.display(), short_name); + debug!("executable_exists: repo = {}, short_name = {}", repo.display(), short_name); let exec = target_executable_in_workspace(&PkgId::new(short_name), repo); os::path_exists(&exec) && is_rwx(&exec) } fn test_executable_exists(repo: &Path, short_name: &str) -> bool { - debug2!("test_executable_exists: repo = {}, short_name = {}", repo.display(), short_name); + debug!("test_executable_exists: repo = {}, short_name = {}", repo.display(), short_name); let exec = built_test_in_workspace(&PkgId::new(short_name), repo); do exec.map_default(false) |exec| { os::path_exists(&exec) && is_rwx(&exec) @@ -414,7 +414,7 @@ fn assert_built_executable_exists(repo: &Path, short_name: &str) { } fn built_executable_exists(repo: &Path, short_name: &str) -> bool { - debug2!("assert_built_executable_exists: repo = {}, short_name = {}", + debug!("assert_built_executable_exists: repo = {}, short_name = {}", repo.display(), short_name); let exec = built_executable_in_workspace(&PkgId::new(short_name), repo); exec.is_some() && { @@ -457,7 +457,7 @@ fn assert_built_library_exists(repo: &Path, short_name: &str) { } fn built_library_exists(repo: &Path, short_name: &str) -> bool { - debug2!("assert_built_library_exists: repo = {}, short_name = {}", repo.display(), short_name); + debug!("assert_built_library_exists: repo = {}, short_name = {}", repo.display(), short_name); let lib = built_library_in_workspace(&PkgId::new(short_name), repo); lib.is_some() && { let libname = lib.get_ref(); @@ -479,7 +479,7 @@ fn command_line_test_output_with_env(args: &[~str], env: ~[(~str, ~str)]) -> ~[~ let mut result = ~[]; let p_output = match command_line_test_with_env(args, &os::getcwd(), Some(env)) { - Fail(_) => fail2!("Command-line test failed"), + Fail(_) => fail!("Command-line test failed"), Success(r) => r }; let test_output = str::from_utf8(p_output.output); @@ -491,7 +491,7 @@ fn command_line_test_output_with_env(args: &[~str], env: ~[(~str, ~str)]) -> ~[~ // assumes short_name and path are one and the same -- I should fix fn lib_output_file_name(workspace: &Path, short_name: &str) -> Path { - debug2!("lib_output_file_name: given {} and short name {}", + debug!("lib_output_file_name: given {} and short name {}", workspace.display(), short_name); library_in_workspace(&Path::new(short_name), short_name, @@ -549,11 +549,11 @@ fn frob_source_file(workspace: &Path, pkgid: &PkgId, filename: &str) { let pkg_src_dir = workspace.join_many([~"src", pkgid.to_str()]); let mut maybe_p = None; let maybe_file = pkg_src_dir.join(filename); - debug2!("Trying to frob {} -- {}", pkg_src_dir.display(), filename); + debug!("Trying to frob {} -- {}", pkg_src_dir.display(), filename); if os::path_exists(&maybe_file) { maybe_p = Some(maybe_file); } - debug2!("Frobbed? {:?}", maybe_p); + debug!("Frobbed? {:?}", maybe_p); match maybe_p { Some(ref p) => { let w = io::file_writer(p, &[io::Append]); @@ -562,7 +562,7 @@ fn frob_source_file(workspace: &Path, pkgid: &PkgId, filename: &str) { Ok(w) => w.write_line("/* hi */") } } - None => fail2!("frob_source_file failed to find a source file in {}", + None => fail!("frob_source_file failed to find a source file in {}", pkg_src_dir.display()) } } @@ -573,7 +573,7 @@ fn test_make_dir_rwx() { let dir = temp.join("quux"); assert!(!os::path_exists(&dir) || os::remove_dir_recursive(&dir)); - debug2!("Trying to make {}", dir.display()); + debug!("Trying to make {}", dir.display()); assert!(make_dir_rwx(&dir)); assert!(os::path_is_dir(&dir)); assert!(is_rwx(&dir)); @@ -589,12 +589,12 @@ fn test_install_valid() { use path_util::installed_library_in_workspace; let sysroot = test_sysroot(); - debug2!("sysroot = {}", sysroot.display()); + debug!("sysroot = {}", sysroot.display()); let temp_pkg_id = fake_pkg(); let (temp_workspace, _pkg_dir) = mk_temp_workspace(&temp_pkg_id.path, &NoVersion); let temp_workspace = temp_workspace.path(); let ctxt = fake_ctxt(sysroot, temp_workspace); - debug2!("temp_workspace = {}", temp_workspace.display()); + debug!("temp_workspace = {}", temp_workspace.display()); // should have test, bench, lib, and main let src = PkgSrc::new(temp_workspace.clone(), temp_workspace.clone(), @@ -603,19 +603,19 @@ fn test_install_valid() { ctxt.install(src, &Everything); // Check that all files exist let exec = target_executable_in_workspace(&temp_pkg_id, temp_workspace); - debug2!("exec = {}", exec.display()); + debug!("exec = {}", exec.display()); assert!(os::path_exists(&exec)); assert!(is_rwx(&exec)); let lib = installed_library_in_workspace(&temp_pkg_id.path, temp_workspace); - debug2!("lib = {:?}", lib); + debug!("lib = {:?}", lib); assert!(lib.as_ref().map_default(false, |l| os::path_exists(l))); assert!(lib.as_ref().map_default(false, |l| is_rwx(l))); // And that the test and bench executables aren't installed assert!(!os::path_exists(&target_test_in_workspace(&temp_pkg_id, temp_workspace))); let bench = target_bench_in_workspace(&temp_pkg_id, temp_workspace); - debug2!("bench = {}", bench.display()); + debug!("bench = {}", bench.display()); assert!(!os::path_exists(&bench)); // Make sure the db isn't dirty, so that it doesn't try to save() @@ -656,19 +656,19 @@ fn test_install_valid_external() { // Check that all files exist let exec = target_executable_in_workspace(&temp_pkg_id, temp_workspace); - debug2!("exec = {}", exec.display()); + debug!("exec = {}", exec.display()); assert!(os::path_exists(&exec)); assert!(is_rwx(&exec)); let lib = installed_library_in_workspace(&temp_pkg_id.path, temp_workspace); - debug2!("lib = {:?}", lib); + debug!("lib = {:?}", lib); assert!(lib.as_ref().map_default(false, |l| os::path_exists(l))); assert!(lib.as_ref().map_default(false, |l| is_rwx(l))); // And that the test and bench executables aren't installed assert!(!os::path_exists(&target_test_in_workspace(&temp_pkg_id, temp_workspace))); let bench = target_bench_in_workspace(&temp_pkg_id, temp_workspace); - debug2!("bench = {}", bench.display()); + debug!("bench = {}", bench.display()); assert!(!os::path_exists(&bench)); } @@ -689,9 +689,9 @@ fn test_install_git() { let temp_pkg_id = git_repo_pkg(); let repo = init_git_repo(&temp_pkg_id.path); let repo = repo.path(); - debug2!("repo = {}", repo.display()); + debug!("repo = {}", repo.display()); let repo_subdir = repo.join_many(["mockgithub.com", "catamorphism", "test-pkg"]); - debug2!("repo_subdir = {}", repo_subdir.display()); + debug!("repo_subdir = {}", repo_subdir.display()); writeFile(&repo_subdir.join("main.rs"), "fn main() { let _x = (); }"); @@ -703,16 +703,16 @@ fn test_install_git() { "#[bench] pub fn f() { (); }"); add_git_tag(&repo_subdir, ~"0.1"); // this has the effect of committing the files - debug2!("test_install_git: calling rustpkg install {} in {}", + debug!("test_install_git: calling rustpkg install {} in {}", temp_pkg_id.path.display(), repo.display()); // should have test, bench, lib, and main // FIXME (#9639): This needs to handle non-utf8 paths command_line_test([~"install", temp_pkg_id.path.as_str().unwrap().to_owned()], repo); let ws = repo.join(".rust"); // Check that all files exist - debug2!("Checking for files in {}", ws.display()); + debug!("Checking for files in {}", ws.display()); let exec = target_executable_in_workspace(&temp_pkg_id, &ws); - debug2!("exec = {}", exec.display()); + debug!("exec = {}", exec.display()); assert!(os::path_exists(&exec)); assert!(is_rwx(&exec)); let _built_lib = @@ -728,9 +728,9 @@ fn test_install_git() { // And that the test and bench executables aren't installed let test = target_test_in_workspace(&temp_pkg_id, &ws); assert!(!os::path_exists(&test)); - debug2!("test = {}", test.display()); + debug!("test = {}", test.display()); let bench = target_bench_in_workspace(&temp_pkg_id, &ws); - debug2!("bench = {}", bench.display()); + debug!("bench = {}", bench.display()); assert!(!os::path_exists(&bench)); } @@ -784,7 +784,7 @@ fn test_package_version() { let repo = init_git_repo(&Path::new(local_path)); let repo = repo.path(); let repo_subdir = repo.join_many(["mockgithub.com", "catamorphism", "test_pkg_version"]); - debug2!("Writing files in: {}", repo_subdir.display()); + debug!("Writing files in: {}", repo_subdir.display()); writeFile(&repo_subdir.join("main.rs"), "fn main() { let _x = (); }"); writeFile(&repo_subdir.join("lib.rs"), @@ -823,7 +823,7 @@ fn test_package_request_version() { let repo = init_git_repo(&Path::new(local_path)); let repo = repo.path(); let repo_subdir = repo.join_many(["mockgithub.com", "catamorphism", "test_pkg_version"]); - debug2!("Writing files in: {}", repo_subdir.display()); + debug!("Writing files in: {}", repo_subdir.display()); writeFile(&repo_subdir.join("main.rs"), "fn main() { let _x = (); }"); writeFile(&repo_subdir.join("lib.rs"), @@ -842,7 +842,7 @@ fn test_package_request_version() { assert!(match installed_library_in_workspace(&Path::new("test_pkg_version"), &repo.join(".rust")) { Some(p) => { - debug2!("installed: {}", p.display()); + debug!("installed: {}", p.display()); let suffix = format!("0.3{}", os::consts::DLL_SUFFIX); p.as_vec().ends_with(suffix.as_bytes()) } @@ -854,7 +854,7 @@ fn test_package_request_version() { let mut dir = target_build_dir(&repo.join(".rust")); dir.push(&Path::new("src/mockgithub.com/catamorphism/test_pkg_version-0.3")); - debug2!("dir = {}", dir.display()); + debug!("dir = {}", dir.display()); assert!(os::path_is_dir(&dir)); assert!(os::path_exists(&dir.join("version-0.3-file.txt"))); assert!(!os::path_exists(&dir.join("version-0.4-file.txt"))); @@ -874,7 +874,7 @@ fn rustpkg_library_target() { let foo_repo = foo_repo.path(); let package_dir = foo_repo.join("foo"); - debug2!("Writing files in: {}", package_dir.display()); + debug!("Writing files in: {}", package_dir.display()); writeFile(&package_dir.join("main.rs"), "fn main() { let _x = (); }"); writeFile(&package_dir.join("lib.rs"), @@ -901,14 +901,14 @@ fn rustpkg_local_pkg() { fn package_script_with_default_build() { let dir = create_local_package(&PkgId::new("fancy-lib")); let dir = dir.path(); - debug2!("dir = {}", dir.display()); + debug!("dir = {}", dir.display()); let mut source = test_sysroot().dir_path(); source.pop(); source.pop(); source.push_many(["src", "librustpkg", "testsuite", "pass", "src", "fancy-lib", "pkg.rs"]); - debug2!("package_script_with_default_build: {}", source.display()); + debug!("package_script_with_default_build: {}", source.display()); if !os::copy_file(&source, &dir.join_many(["src", "fancy-lib-0.1", "pkg.rs"])) { - fail2!("Couldn't copy file"); + fail!("Couldn't copy file"); } command_line_test([~"install", ~"fancy-lib"], dir); assert_lib_exists(dir, &Path::new("fancy-lib"), NoVersion); @@ -924,7 +924,7 @@ fn rustpkg_build_no_arg() { writeFile(&package_dir.join("main.rs"), "fn main() { let _x = (); }"); - debug2!("build_no_arg: dir = {}", package_dir.display()); + debug!("build_no_arg: dir = {}", package_dir.display()); command_line_test([~"build"], &package_dir); assert_built_executable_exists(&tmp, "foo"); } @@ -937,7 +937,7 @@ fn rustpkg_install_no_arg() { assert!(os::mkdir_recursive(&package_dir, U_RWX)); writeFile(&package_dir.join("lib.rs"), "fn main() { let _x = (); }"); - debug2!("install_no_arg: dir = {}", package_dir.display()); + debug!("install_no_arg: dir = {}", package_dir.display()); command_line_test([~"install"], &package_dir); assert_lib_exists(&tmp, &Path::new("foo"), NoVersion); } @@ -951,7 +951,7 @@ fn rustpkg_clean_no_arg() { writeFile(&package_dir.join("main.rs"), "fn main() { let _x = (); }"); - debug2!("clean_no_arg: dir = {}", package_dir.display()); + debug!("clean_no_arg: dir = {}", package_dir.display()); command_line_test([~"build"], &package_dir); assert_built_executable_exists(&tmp, "foo"); command_line_test([~"clean"], &package_dir); @@ -963,11 +963,11 @@ fn rustpkg_clean_no_arg() { fn rust_path_test() { let dir_for_path = TempDir::new("more_rust").expect("rust_path_test failed"); let dir = mk_workspace(dir_for_path.path(), &Path::new("foo"), &NoVersion); - debug2!("dir = {}", dir.display()); + debug!("dir = {}", dir.display()); writeFile(&dir.join("main.rs"), "fn main() { let _x = (); }"); let cwd = os::getcwd(); - debug2!("cwd = {}", cwd.display()); + debug!("cwd = {}", cwd.display()); // use command_line_test_with_env // FIXME (#9639): This needs to handle non-utf8 paths command_line_test_with_env([~"install", ~"foo"], @@ -1080,7 +1080,7 @@ fn install_check_duplicates() { let mut contents = ~[]; let check_dups = |p: &PkgId| { if contents.contains(p) { - fail2!("package {} appears in `list` output more than once", p.path.display()); + fail!("package {} appears in `list` output more than once", p.path.display()); } else { contents.push((*p).clone()); @@ -1104,8 +1104,8 @@ fn no_rebuilding() { match command_line_test_partial([~"build", ~"foo"], workspace) { Success(*) => (), // ok - Fail(status) if status == 65 => fail2!("no_rebuilding failed: it tried to rebuild bar"), - Fail(_) => fail2!("no_rebuilding failed for some other reason") + Fail(status) if status == 65 => fail!("no_rebuilding failed: it tried to rebuild bar"), + Fail(_) => fail!("no_rebuilding failed for some other reason") } } @@ -1122,8 +1122,8 @@ fn no_rebuilding_dep() { assert!(chmod_read_only(&bar_lib)); match command_line_test_partial([~"build", ~"foo"], workspace) { Success(*) => (), // ok - Fail(status) if status == 65 => fail2!("no_rebuilding_dep failed: it tried to rebuild bar"), - Fail(_) => fail2!("no_rebuilding_dep failed for some other reason") + Fail(status) if status == 65 => fail!("no_rebuilding_dep failed: it tried to rebuild bar"), + Fail(_) => fail!("no_rebuilding_dep failed for some other reason") } } @@ -1141,9 +1141,9 @@ fn do_rebuild_dep_dates_change() { assert!(chmod_read_only(&bar_lib_name)); match command_line_test_partial([~"build", ~"foo"], workspace) { - Success(*) => fail2!("do_rebuild_dep_dates_change failed: it didn't rebuild bar"), + Success(*) => fail!("do_rebuild_dep_dates_change failed: it didn't rebuild bar"), Fail(status) if status == 65 => (), // ok - Fail(_) => fail2!("do_rebuild_dep_dates_change failed for some other reason") + Fail(_) => fail!("do_rebuild_dep_dates_change failed for some other reason") } } @@ -1162,9 +1162,9 @@ fn do_rebuild_dep_only_contents_change() { // should adjust the datestamp match command_line_test_partial([~"build", ~"foo"], workspace) { - Success(*) => fail2!("do_rebuild_dep_only_contents_change failed: it didn't rebuild bar"), + Success(*) => fail!("do_rebuild_dep_only_contents_change failed: it didn't rebuild bar"), Fail(status) if status == 65 => (), // ok - Fail(_) => fail2!("do_rebuild_dep_only_contents_change failed for some other reason") + Fail(_) => fail!("do_rebuild_dep_only_contents_change failed for some other reason") } } @@ -1270,7 +1270,7 @@ fn test_extern_mod() { }); let outp = prog.finish_with_output(); if outp.status != 0 { - fail2!("output was {}, error was {}", + fail!("output was {}, error was {}", str::from_utf8(outp.output), str::from_utf8(outp.error)); } @@ -1304,7 +1304,7 @@ fn test_extern_mod_simpler() { let rustpkg_exec = rustpkg_exec(); let rustc = rustpkg_exec.with_filename("rustc"); let test_sys = test_sysroot(); - debug2!("RUST_PATH={} {} {} \n --sysroot {} -o {}", + debug!("RUST_PATH={} {} {} \n --sysroot {} -o {}", lib_depend_dir.display(), rustc.display(), main_file.display(), @@ -1325,7 +1325,7 @@ fn test_extern_mod_simpler() { }); let outp = prog.finish_with_output(); if outp.status != 0 { - fail2!("output was {}, error was {}", + fail!("output was {}, error was {}", str::from_utf8(outp.output), str::from_utf8(outp.error)); } @@ -1340,7 +1340,7 @@ fn test_import_rustpkg() { writeFile(&workspace.join_many(["src", "foo-0.1", "pkg.rs"]), "extern mod rustpkg; fn main() {}"); command_line_test([~"build", ~"foo"], workspace); - debug2!("workspace = {}", workspace.display()); + debug!("workspace = {}", workspace.display()); assert!(os::path_exists(&target_build_dir(workspace).join("foo").join(format!("pkg{}", os::EXE_SUFFIX)))); } @@ -1351,9 +1351,9 @@ fn test_macro_pkg_script() { let workspace = create_local_package(&p_id); let workspace = workspace.path(); writeFile(&workspace.join_many(["src", "foo-0.1", "pkg.rs"]), - "extern mod rustpkg; fn main() { debug2!(\"Hi\"); }"); + "extern mod rustpkg; fn main() { debug!(\"Hi\"); }"); command_line_test([~"build", ~"foo"], workspace); - debug2!("workspace = {}", workspace.display()); + debug!("workspace = {}", workspace.display()); assert!(os::path_exists(&target_build_dir(workspace).join("foo").join(format!("pkg{}", os::EXE_SUFFIX)))); } @@ -1367,9 +1367,9 @@ fn multiple_workspaces() { let (a_loc, _pkg_dir) = mk_temp_workspace(&Path::new("foo"), &NoVersion); let (b_loc, _pkg_dir) = mk_temp_workspace(&Path::new("foo"), &NoVersion); let (a_loc, b_loc) = (a_loc.path(), b_loc.path()); - debug2!("Trying to install foo in {}", a_loc.display()); + debug!("Trying to install foo in {}", a_loc.display()); command_line_test([~"install", ~"foo"], a_loc); - debug2!("Trying to install foo in {}", b_loc.display()); + debug!("Trying to install foo in {}", b_loc.display()); command_line_test([~"install", ~"foo"], b_loc); // FIXME (#9639): This needs to handle non-utf8 paths let env = Some(~[(~"RUST_PATH", format!("{}:{}", a_loc.as_str().unwrap(), @@ -1443,7 +1443,7 @@ fn rust_path_hack_cwd() { // FIXME (#9639): This needs to handle non-utf8 paths let rust_path = Some(~[(~"RUST_PATH", dest_workspace.as_str().unwrap().to_owned())]); command_line_test_with_env([~"install", ~"--rust-path-hack", ~"foo"], &cwd, rust_path); - debug2!("Checking that foo exists in {}", dest_workspace.display()); + debug!("Checking that foo exists in {}", dest_workspace.display()); assert_lib_exists(dest_workspace, &Path::new("foo"), NoVersion); assert_built_library_exists(dest_workspace, "foo"); assert!(!lib_exists(&cwd, &Path::new("foo"), NoVersion)); @@ -1464,7 +1464,7 @@ fn rust_path_hack_multi_path() { // FIXME (#9639): This needs to handle non-utf8 paths let rust_path = Some(~[(~"RUST_PATH", dest_workspace.as_str().unwrap().to_owned())]); command_line_test_with_env([~"install", ~"--rust-path-hack", name.clone()], &subdir, rust_path); - debug2!("Checking that {} exists in {}", name, dest_workspace.display()); + debug!("Checking that {} exists in {}", name, dest_workspace.display()); assert_lib_exists(dest_workspace, &Path::new("quux"), NoVersion); assert_built_library_exists(dest_workspace, name); assert!(!lib_exists(&subdir, &Path::new("quux"), NoVersion)); @@ -1485,7 +1485,7 @@ fn rust_path_hack_install_no_arg() { // FIXME (#9639): This needs to handle non-utf8 paths let rust_path = Some(~[(~"RUST_PATH", dest_workspace.as_str().unwrap().to_owned())]); command_line_test_with_env([~"install", ~"--rust-path-hack"], &source_dir, rust_path); - debug2!("Checking that foo exists in {}", dest_workspace.display()); + debug!("Checking that foo exists in {}", dest_workspace.display()); assert_lib_exists(dest_workspace, &Path::new("foo"), NoVersion); assert_built_library_exists(dest_workspace, "foo"); assert!(!lib_exists(&source_dir, &Path::new("foo"), NoVersion)); @@ -1505,7 +1505,7 @@ fn rust_path_hack_build_no_arg() { // FIXME (#9639): This needs to handle non-utf8 paths let rust_path = Some(~[(~"RUST_PATH", dest_workspace.as_str().unwrap().to_owned())]); command_line_test_with_env([~"build", ~"--rust-path-hack"], &source_dir, rust_path); - debug2!("Checking that foo exists in {}", dest_workspace.display()); + debug!("Checking that foo exists in {}", dest_workspace.display()); assert_built_library_exists(dest_workspace, "foo"); assert!(!built_library_exists(&source_dir, "foo")); } @@ -1515,7 +1515,7 @@ fn rust_path_install_target() { let dir_for_path = TempDir::new( "source_workspace").expect("rust_path_install_target failed"); let mut dir = mk_workspace(dir_for_path.path(), &Path::new("foo"), &NoVersion); - debug2!("dir = {}", dir.display()); + debug!("dir = {}", dir.display()); writeFile(&dir.join("main.rs"), "fn main() { let _x = (); }"); let dir_to_install_to = TempDir::new( "dest_workspace").expect("rust_path_install_target failed"); @@ -1696,7 +1696,7 @@ fn test_cfg_fail() { ~"build", ~"foo"], workspace) { - Success(*) => fail2!("test_cfg_fail failed"), + Success(*) => fail!("test_cfg_fail failed"), _ => () } } @@ -1857,7 +1857,7 @@ fn pkgid_pointing_to_subdir() { writeFile(&foo_dir.join("lib.rs"), "pub fn f() {}"); writeFile(&bar_dir.join("lib.rs"), "pub fn g() {}"); - debug2!("Creating a file in {}", workspace.display()); + debug!("Creating a file in {}", workspace.display()); let testpkg_dir = workspace.join_many(["src", "testpkg-0.1"]); assert!(os::mkdir_recursive(&testpkg_dir, U_RWX)); @@ -1888,7 +1888,7 @@ fn test_recursive_deps() { "extern mod c; use c::g; pub fn f() { g(); }"); // FIXME (#9639): This needs to handle non-utf8 paths let environment = Some(~[(~"RUST_PATH", b_workspace.as_str().unwrap().to_owned())]); - debug2!("RUST_PATH={}", b_workspace.display()); + debug!("RUST_PATH={}", b_workspace.display()); command_line_test_with_env([~"install", ~"a"], a_workspace, environment); @@ -1908,7 +1908,7 @@ fn test_install_to_rust_path() { let rust_path = Some(~[(~"RUST_PATH", format!("{}:{}", first_workspace.as_str().unwrap(), second_workspace.as_str().unwrap()))]); - debug2!("RUST_PATH={}:{}", first_workspace.display(), second_workspace.display()); + debug!("RUST_PATH={}:{}", first_workspace.display(), second_workspace.display()); let test_sys = test_sysroot(); // FIXME (#9639): This needs to handle non-utf8 paths command_line_test_with_env([test_sys.as_str().unwrap().to_owned(), @@ -2086,9 +2086,9 @@ fn test_rebuild_when_needed() { frob_source_file(foo_workspace, &foo_id, "test.rs"); chmod_read_only(&test_executable); match command_line_test_partial([~"test", ~"foo"], foo_workspace) { - Success(*) => fail2!("test_rebuild_when_needed didn't rebuild"), + Success(*) => fail!("test_rebuild_when_needed didn't rebuild"), Fail(status) if status == 65 => (), // ok - Fail(_) => fail2!("test_rebuild_when_needed failed for some other reason") + Fail(_) => fail!("test_rebuild_when_needed failed for some other reason") } } @@ -2106,8 +2106,8 @@ fn test_no_rebuilding() { chmod_read_only(&test_executable); match command_line_test_partial([~"test", ~"foo"], foo_workspace) { Success(*) => (), // ok - Fail(status) if status == 65 => fail2!("test_no_rebuilding failed: it rebuilt the tests"), - Fail(_) => fail2!("test_no_rebuilding failed for some other reason") + Fail(status) if status == 65 => fail!("test_no_rebuilding failed: it rebuilt the tests"), + Fail(_) => fail!("test_no_rebuilding failed for some other reason") } } @@ -2118,9 +2118,9 @@ fn test_installed_read_only() { let temp_pkg_id = git_repo_pkg(); let repo = init_git_repo(&temp_pkg_id.path); let repo = repo.path(); - debug2!("repo = {}", repo.display()); + debug!("repo = {}", repo.display()); let repo_subdir = repo.join_many(["mockgithub.com", "catamorphism", "test-pkg"]); - debug2!("repo_subdir = {}", repo_subdir.display()); + debug!("repo_subdir = {}", repo_subdir.display()); writeFile(&repo_subdir.join("main.rs"), "fn main() { let _x = (); }"); @@ -2133,9 +2133,9 @@ fn test_installed_read_only() { let ws = repo.join(".rust"); // Check that all files exist - debug2!("Checking for files in {}", ws.display()); + debug!("Checking for files in {}", ws.display()); let exec = target_executable_in_workspace(&temp_pkg_id, &ws); - debug2!("exec = {}", exec.display()); + debug!("exec = {}", exec.display()); assert!(os::path_exists(&exec)); assert!(is_rwx(&exec)); let built_lib = @@ -2158,9 +2158,9 @@ fn test_installed_local_changes() { let temp_pkg_id = git_repo_pkg(); let repo = init_git_repo(&temp_pkg_id.path); let repo = repo.path(); - debug2!("repo = {}", repo.display()); + debug!("repo = {}", repo.display()); let repo_subdir = repo.join_many(["mockgithub.com", "catamorphism", "test-pkg"]); - debug2!("repo_subdir = {}", repo_subdir.display()); + debug!("repo_subdir = {}", repo_subdir.display()); assert!(os::mkdir_recursive(&repo.join_many([".rust", "src"]), U_RWX)); writeFile(&repo_subdir.join("main.rs"), @@ -2181,12 +2181,12 @@ fn test_installed_local_changes() { "mockgithub.com", "catamorphism", "test-pkg-0.1"]); - debug2!("---- git clone {} {}", repo_subdir.display(), target_dir.display()); + debug!("---- git clone {} {}", repo_subdir.display(), target_dir.display()); let c_res = safe_git_clone(&repo_subdir, &NoVersion, &target_dir); match c_res { - DirToUse(_) => fail2!("test_installed_local_changes failed"), + DirToUse(_) => fail!("test_installed_local_changes failed"), CheckedOutSources => () }; @@ -2232,9 +2232,9 @@ fn test_compile_error() { writeFile(&main_crate, "pub fn main() { if 42 != ~\"the answer\" { fail!(); } }"); let result = command_line_test_partial([~"build", ~"foo"], foo_workspace); match result { - Success(*) => fail2!("Failed by succeeding!"), // should be a compile error + Success(*) => fail!("Failed by succeeding!"), // should be a compile error Fail(status) => { - debug2!("Failed with status {:?}... that's good, right?", status); + debug!("Failed with status {:?}... that's good, right?", status); } } } diff --git a/src/librustpkg/util.rs b/src/librustpkg/util.rs index 345518eddc7b..a3a4a07cfc77 100644 --- a/src/librustpkg/util.rs +++ b/src/librustpkg/util.rs @@ -175,7 +175,7 @@ pub fn compile_input(context: &BuildContext, what: OutputType) -> Option { assert!(in_file.component_iter().nth(1).is_some()); let input = driver::file_input(in_file.clone()); - debug2!("compile_input: {} / {:?}", in_file.display(), what); + debug!("compile_input: {} / {:?}", in_file.display(), what); // tjc: by default, use the package ID name as the link name // not sure if we should support anything else @@ -186,10 +186,10 @@ pub fn compile_input(context: &BuildContext, let binary = os::args()[0].to_managed(); - debug2!("flags: {}", flags.connect(" ")); - debug2!("cfgs: {}", cfgs.connect(" ")); + debug!("flags: {}", flags.connect(" ")); + debug!("cfgs: {}", cfgs.connect(" ")); let csysroot = context.sysroot(); - debug2!("compile_input's sysroot = {}", csysroot.display()); + debug!("compile_input's sysroot = {}", csysroot.display()); let crate_type = match what { Lib => lib_crate, @@ -206,7 +206,7 @@ pub fn compile_input(context: &BuildContext, + context.flag_strs() + cfgs.flat_map(|c| { ~[~"--cfg", (*c).clone()] }), driver::optgroups()).unwrap(); - debug2!("rustc flags: {:?}", matches); + debug!("rustc flags: {:?}", matches); // Hack so that rustpkg can run either out of a rustc target dir, // or the host dir @@ -221,8 +221,8 @@ pub fn compile_input(context: &BuildContext, p }; let csysroot = context.sysroot(); - debug2!("compile_input's sysroot = {}", csysroot.display()); - debug2!("sysroot_to_use = {}", sysroot_to_use.display()); + debug!("compile_input's sysroot = {}", csysroot.display()); + debug!("sysroot_to_use = {}", sysroot_to_use.display()); let output_type = match context.compile_upto() { Assemble => link::output_type_assembly, @@ -270,7 +270,7 @@ pub fn compile_input(context: &BuildContext, find_and_install_dependencies(context, pkg_id, in_file, sess, exec, &crate, deps, |p| { - debug2!("a dependency: {}", p.display()); + debug!("a dependency: {}", p.display()); // Pass the directory containing a dependency // as an additional lib search path if !addl_lib_search_paths.contains(&p) { @@ -287,7 +287,7 @@ pub fn compile_input(context: &BuildContext, Bench => format!("{}bench", pkg_id.short_name).to_managed(), _ => pkg_id.short_name.to_managed() }; - debug2!("Injecting link name: {}", name_to_use); + debug!("Injecting link name: {}", name_to_use); // FIXME (#9639): This needs to handle non-utf8 paths let link_options = ~[attr::mk_name_value_item_str(@"name", name_to_use), @@ -295,11 +295,11 @@ pub fn compile_input(context: &BuildContext, ~[attr::mk_name_value_item_str(@"package_id", pkg_id.path.as_str().unwrap().to_managed())]; - debug2!("link options: {:?}", link_options); + debug!("link options: {:?}", link_options); crate.attrs = ~[attr::mk_attr(attr::mk_list_item(@"link", link_options))]; } - debug2!("calling compile_crate_from_input, workspace = {}, + debug!("calling compile_crate_from_input, workspace = {}, building_library = {:?}", out_dir.display(), sess.building_library); let result = compile_crate_from_input(in_file, exec, @@ -315,9 +315,9 @@ pub fn compile_input(context: &BuildContext, result }; for p in discovered_output.iter() { - debug2!("About to discover output {}", p.display()); + debug!("About to discover output {}", p.display()); if os::path_exists(p) { - debug2!("4. discovering output {}", p.display()); + debug!("4. discovering output {}", p.display()); // FIXME (#9639): This needs to handle non-utf8 paths exec.discover_output("binary", p.as_str().unwrap(), digest_only_date(p)); } @@ -342,22 +342,22 @@ pub fn compile_crate_from_input(input: &Path, // Returns None if one of the flags that suppresses compilation output was // given crate: ast::Crate) -> Option { - debug2!("Calling build_output_filenames with {}, building library? {:?}", + debug!("Calling build_output_filenames with {}, building library? {:?}", out_dir.display(), sess.building_library); // bad copy - debug2!("out_dir = {}", out_dir.display()); + debug!("out_dir = {}", out_dir.display()); let outputs = driver::build_output_filenames(&driver::file_input(input.clone()), &Some(out_dir.clone()), &None, crate.attrs, sess); - debug2!("Outputs are out_filename: {} and obj_filename: {} and output type = {:?}", + debug!("Outputs are out_filename: {} and obj_filename: {} and output type = {:?}", outputs.out_filename.display(), outputs.obj_filename.display(), sess.opts.output_type); - debug2!("additional libraries:"); + debug!("additional libraries:"); for lib in sess.opts.addl_lib_search_paths.iter() { - debug2!("an additional library: {}", lib.display()); + debug!("an additional library: {}", lib.display()); } let analysis = driver::phase_3_run_analysis_passes(sess, &crate); if driver::stop_after_phase_3(sess) { return None; } @@ -375,7 +375,7 @@ pub fn compile_crate_from_input(input: &Path, // FIXME (#9639): This needs to handle non-utf8 paths exec.discover_input("file", input.as_str().unwrap(), digest_file_with_date(input)); - debug2!("Built {}, date = {:?}", outputs.out_filename.display(), + debug!("Built {}, date = {:?}", outputs.out_filename.display(), datestamp(&outputs.out_filename)); Some(outputs.out_filename) @@ -401,10 +401,10 @@ pub fn compile_crate(ctxt: &BuildContext, cfgs: &[~str], opt: bool, what: OutputType) -> Option { - debug2!("compile_crate: crate={}, workspace={}", crate.display(), workspace.display()); - debug2!("compile_crate: short_name = {}, flags =...", pkg_id.to_str()); + debug!("compile_crate: crate={}, workspace={}", crate.display(), workspace.display()); + debug!("compile_crate: short_name = {}, flags =...", pkg_id.to_str()); for fl in flags.iter() { - debug2!("+++ {}", *fl); + debug!("+++ {}", *fl); } compile_input(ctxt, exec, pkg_id, crate, workspace, deps, flags, cfgs, opt, what) } @@ -429,11 +429,11 @@ impl<'self> Visitor<()> for ViewItemVisitor<'self> { Some((p, _)) => p, None => self.sess.str_of(lib_ident) }; - debug2!("Finding and installing... {}", lib_name); + debug!("Finding and installing... {}", lib_name); // Check standard Rust library path first match system_library(&self.context.sysroot(), lib_name) { Some(ref installed_path) => { - debug2!("It exists: {}", installed_path.display()); + debug!("It exists: {}", installed_path.display()); // Say that [path for c] has a discovered dependency on // installed_path // For binary files, we only hash the datestamp, not the contents. @@ -449,7 +449,7 @@ impl<'self> Visitor<()> for ViewItemVisitor<'self> { } None => { // FIXME #8711: need to parse version out of path_opt - debug2!("Trying to install library {}, rebuilding it", + debug!("Trying to install library {}, rebuilding it", lib_name.to_str()); // Try to install it let pkg_id = PkgId::new(lib_name); @@ -479,15 +479,15 @@ impl<'self> Visitor<()> for ViewItemVisitor<'self> { pkg_id.clone()); let (outputs_disc, inputs_disc) = self.context.install(pkg_src, &JustOne(Path::new(lib_crate_filename))); - debug2!("Installed {}, returned {:?} dependencies and \ + debug!("Installed {}, returned {:?} dependencies and \ {:?} transitive dependencies", lib_name, outputs_disc.len(), inputs_disc.len()); - debug2!("discovered outputs = {:?} discovered_inputs = {:?}", + debug!("discovered outputs = {:?} discovered_inputs = {:?}", outputs_disc, inputs_disc); // It must have installed *something*... assert!(!outputs_disc.is_empty()); for dep in outputs_disc.iter() { - debug2!("Discovering a binary input: {}", dep.display()); + debug!("Discovering a binary input: {}", dep.display()); // FIXME (#9639): This needs to handle non-utf8 paths self.exec.discover_input("binary", dep.as_str().unwrap(), @@ -498,10 +498,10 @@ impl<'self> Visitor<()> for ViewItemVisitor<'self> { // Also, add an additional search path let dep_dir = dep.dir_path(); - debug2!("Installed {} into {}", dep.display(), dep_dir.display()); + debug!("Installed {} into {}", dep.display(), dep_dir.display()); (self.save)(dep_dir); } - debug2!("Installed {}, returned {} dependencies and \ + debug!("Installed {}, returned {} dependencies and \ {} transitive dependencies", lib_name, outputs_disc.len(), inputs_disc.len()); // It must have installed *something*... @@ -526,10 +526,10 @@ impl<'self> Visitor<()> for ViewItemVisitor<'self> { digest_only_date( &Path::new(dep.as_slice()))); } else { - fail2!("Bad kind: {}", *what); + fail!("Bad kind: {}", *what); } // Also, add an additional search path - debug2!("Installed {} into {}", + debug!("Installed {} into {}", lib_name, target_workspace.as_str().unwrap().to_owned()); (self.save)(target_workspace.clone()); } @@ -554,7 +554,7 @@ pub fn find_and_install_dependencies(context: &BuildContext, c: &ast::Crate, deps: &mut DepMap, save: &fn(Path)) { - debug2!("In find_and_install_dependencies..."); + debug!("In find_and_install_dependencies..."); let mut visitor = ViewItemVisitor { context: context, parent: parent, @@ -608,9 +608,9 @@ fn debug_flags() -> ~[~str] { ~[] } /// Returns the last-modified date as an Option pub fn datestamp(p: &Path) -> Option { - debug2!("Scrutinizing datestamp for {} - does it exist? {:?}", p.display(), os::path_exists(p)); + debug!("Scrutinizing datestamp for {} - does it exist? {:?}", p.display(), os::path_exists(p)); let out = p.stat().map(|stat| stat.st_mtime); - debug2!("Date = {:?}", out); + debug!("Date = {:?}", out); out.map(|t| { t as libc::time_t }) } diff --git a/src/librustpkg/version.rs b/src/librustpkg/version.rs index 218f410e4dcf..6ca19562724f 100644 --- a/src/librustpkg/version.rs +++ b/src/librustpkg/version.rs @@ -107,7 +107,7 @@ pub fn try_getting_local_version(local_path: &Path) -> Option { let outp = run::process_output("git", ["--git-dir=" + git_dir.as_str().unwrap(), ~"tag", ~"-l"]); - debug2!("git --git-dir={} tag -l ~~~> {:?}", git_dir.display(), outp.status); + debug!("git --git-dir={} tag -l ~~~> {:?}", git_dir.display(), outp.status); if outp.status != 0 { continue; @@ -136,7 +136,7 @@ pub fn try_getting_version(remote_path: &Path) -> Option { let tmp_dir = TempDir::new("test"); let tmp_dir = tmp_dir.expect("try_getting_version: couldn't create temp dir"); let tmp_dir = tmp_dir.path(); - debug2!("(to get version) executing \\{git clone https://{} {}\\}", + debug!("(to get version) executing \\{git clone https://{} {}\\}", remote_path.display(), tmp_dir.display()); // FIXME (#9639): This needs to handle non-utf8 paths @@ -144,21 +144,21 @@ pub fn try_getting_version(remote_path: &Path) -> Option { remote_path.as_str().unwrap()), tmp_dir.as_str().unwrap().to_owned()]); if outp.status == 0 { - debug2!("Cloned it... ( {}, {} )", + debug!("Cloned it... ( {}, {} )", str::from_utf8(outp.output), str::from_utf8(outp.error)); let mut output = None; let git_dir = tmp_dir.join(".git"); - debug2!("(getting version, now getting tags) executing \\{git --git-dir={} tag -l\\}", + debug!("(getting version, now getting tags) executing \\{git --git-dir={} tag -l\\}", git_dir.display()); // FIXME (#9639): This needs to handle non-utf8 paths let outp = run::process_output("git", ["--git-dir=" + git_dir.as_str().unwrap(), ~"tag", ~"-l"]); let output_text = str::from_utf8(outp.output); - debug2!("Full output: ( {} ) [{:?}]", output_text, outp.status); + debug!("Full output: ( {} ) [{:?}]", output_text, outp.status); for l in output_text.line_iter() { - debug2!("A line of output: {}", l); + debug!("A line of output: {}", l); if !l.is_whitespace() { output = Some(l); } @@ -185,7 +185,7 @@ enum ParseState { pub fn try_parsing_version(s: &str) -> Option { let s = s.trim(); - debug2!("Attempting to parse: {}", s); + debug!("Attempting to parse: {}", s); let mut parse_state = Start; for c in s.iter() { if char::is_digit(c) { @@ -248,7 +248,7 @@ fn test_parse_version() { #[test] fn test_split_version() { let s = "a/b/c#0.1"; - debug2!("== {:?} ==", split_version(s)); + debug!("== {:?} ==", split_version(s)); assert!(split_version(s) == Some((s.slice(0, 5), ExactRevision(~"0.1")))); assert!(split_version("a/b/c") == None); let s = "a#1.2"; diff --git a/src/librustpkg/workcache_support.rs b/src/librustpkg/workcache_support.rs index 34404ad625c7..0352067a7e9e 100644 --- a/src/librustpkg/workcache_support.rs +++ b/src/librustpkg/workcache_support.rs @@ -54,9 +54,9 @@ pub fn digest_only_date(path: &Path) -> ~str { /// Adds multiple discovered outputs pub fn discover_outputs(e: &mut workcache::Exec, outputs: ~[Path]) { - debug2!("Discovering {:?} outputs", outputs.len()); + debug!("Discovering {:?} outputs", outputs.len()); for p in outputs.iter() { - debug2!("Discovering output! {}", p.display()); + debug!("Discovering output! {}", p.display()); // For now, assume that all discovered outputs are binaries // FIXME (#9639): This needs to handle non-utf8 paths e.discover_output("binary", p.as_str().unwrap(), digest_only_date(p)); diff --git a/src/librustpkg/workspace.rs b/src/librustpkg/workspace.rs index 13d70f153329..a35500372467 100644 --- a/src/librustpkg/workspace.rs +++ b/src/librustpkg/workspace.rs @@ -24,7 +24,7 @@ pub fn each_pkg_parent_workspace(cx: &Context, pkgid: &PkgId, action: &fn(&Path) let workspaces = pkg_parent_workspaces(cx, pkgid); if workspaces.is_empty() { // tjc: make this a condition - fail2!("Package {} not found in any of \ + fail!("Package {} not found in any of \ the following workspaces: {}", pkgid.path.display(), rust_path().map(|p| p.display().to_str()).to_str()); diff --git a/src/libstd/at_vec.rs b/src/libstd/at_vec.rs index 8607710edc39..ee0b9b0df0b8 100644 --- a/src/libstd/at_vec.rs +++ b/src/libstd/at_vec.rs @@ -238,7 +238,7 @@ pub mod raw { let alloc = n * (*ty).size; let total_size = alloc + mem::size_of::>(); if alloc / (*ty).size != n || total_size < alloc { - fail2!("vector size is too large: {}", n); + fail!("vector size is too large: {}", n); } (*ptr) = local_realloc(*ptr as *(), total_size) as *mut Box>; (**ptr).data.alloc = alloc; diff --git a/src/libstd/c_str.rs b/src/libstd/c_str.rs index 8118907322bf..acfa02a4defd 100644 --- a/src/libstd/c_str.rs +++ b/src/libstd/c_str.rs @@ -116,7 +116,7 @@ impl CString { /// /// Fails if the CString is null. pub fn with_ref(&self, f: &fn(*libc::c_char) -> T) -> T { - if self.buf.is_null() { fail2!("CString is null!"); } + if self.buf.is_null() { fail!("CString is null!"); } f(self.buf) } @@ -126,7 +126,7 @@ impl CString { /// /// Fails if the CString is null. pub fn with_mut_ref(&mut self, f: &fn(*mut libc::c_char) -> T) -> T { - if self.buf.is_null() { fail2!("CString is null!"); } + if self.buf.is_null() { fail!("CString is null!"); } f(unsafe { cast::transmute_mut_unsafe(self.buf) }) } @@ -152,7 +152,7 @@ impl CString { /// Fails if the CString is null. #[inline] pub fn as_bytes<'a>(&'a self) -> &'a [u8] { - if self.buf.is_null() { fail2!("CString is null!"); } + if self.buf.is_null() { fail!("CString is null!"); } unsafe { cast::transmute((self.buf, self.len() + 1)) } @@ -273,7 +273,7 @@ impl<'self> ToCStr for &'self [u8] { do self.as_imm_buf |self_buf, self_len| { let buf = libc::malloc(self_len as libc::size_t + 1) as *mut u8; if buf.is_null() { - fail2!("failed to allocate memory!"); + fail!("failed to allocate memory!"); } ptr::copy_memory(buf, self_buf, self_len); diff --git a/src/libstd/cell.rs b/src/libstd/cell.rs index 4bbb0a5935ae..a1459b780dfb 100644 --- a/src/libstd/cell.rs +++ b/src/libstd/cell.rs @@ -44,7 +44,7 @@ impl Cell { pub fn take(&self) -> T { let this = unsafe { transmute_mut(self) }; if this.is_empty() { - fail2!("attempt to take an empty cell"); + fail!("attempt to take an empty cell"); } this.value.take_unwrap() @@ -60,7 +60,7 @@ impl Cell { pub fn put_back(&self, value: T) { let this = unsafe { transmute_mut(self) }; if !this.is_empty() { - fail2!("attempt to put a value back into a full cell"); + fail!("attempt to put a value back into a full cell"); } this.value = Some(value); } diff --git a/src/libstd/char.rs b/src/libstd/char.rs index 54613adf3fec..643498f000af 100644 --- a/src/libstd/char.rs +++ b/src/libstd/char.rs @@ -187,7 +187,7 @@ pub fn is_digit_radix(c: char, radix: uint) -> bool { #[inline] pub fn to_digit(c: char, radix: uint) -> Option { if radix > 36 { - fail2!("to_digit: radix {} is to high (maximum 36)", radix); + fail!("to_digit: radix {} is to high (maximum 36)", radix); } let val = match c { '0' .. '9' => c as uint - ('0' as uint), @@ -214,7 +214,7 @@ pub fn to_digit(c: char, radix: uint) -> Option { #[inline] pub fn from_digit(num: uint, radix: uint) -> Option { if radix > 36 { - fail2!("from_digit: radix {} is to high (maximum 36)", num); + fail!("from_digit: radix {} is to high (maximum 36)", num); } if num < radix { unsafe { @@ -342,7 +342,7 @@ pub fn len_utf8_bytes(c: char) -> uint { _ if code < MAX_TWO_B => 2u, _ if code < MAX_THREE_B => 3u, _ if code < MAX_FOUR_B => 4u, - _ => fail2!("invalid character!"), + _ => fail!("invalid character!"), } } diff --git a/src/libstd/cleanup.rs b/src/libstd/cleanup.rs index a8c4d9fdca3c..a9070a7a7a27 100644 --- a/src/libstd/cleanup.rs +++ b/src/libstd/cleanup.rs @@ -123,7 +123,7 @@ pub unsafe fn annihilate() { if debug_mem() { // We do logging here w/o allocation. - debug2!("annihilator stats:\n \ + debug!("annihilator stats:\n \ total boxes: {}\n \ unique boxes: {}\n \ bytes freed: {}", diff --git a/src/libstd/condition.rs b/src/libstd/condition.rs index 7828fa09d970..cb9552b189ce 100644 --- a/src/libstd/condition.rs +++ b/src/libstd/condition.rs @@ -56,7 +56,7 @@ do my_error::cond.trap(|raised_int| { Condition handling is useful in cases where propagating errors is either to cumbersome or just not necessary in the first place. It should also be noted, though, that if there is not handler installed when a condition is raised, then -the task invokes `fail2!()` and will terminate. +the task invokes `fail!()` and will terminate. ## More Info @@ -128,7 +128,7 @@ impl Condition { /// function will not return. pub fn raise(&self, t: T) -> U { let msg = format!("Unhandled condition: {}: {:?}", self.name, t); - self.raise_default(t, || fail2!("{}", msg.clone())) + self.raise_default(t, || fail!("{}", msg.clone())) } /// Performs the same functionality as `raise`, except that when no handler @@ -136,11 +136,11 @@ impl Condition { pub fn raise_default(&self, t: T, default: &fn() -> U) -> U { match local_data::pop(self.key) { None => { - debug2!("Condition.raise: found no handler"); + debug!("Condition.raise: found no handler"); default() } Some(handler) => { - debug2!("Condition.raise: found handler"); + debug!("Condition.raise: found handler"); match handler.prev { None => {} Some(hp) => local_data::set(self.key, hp) @@ -183,7 +183,7 @@ impl<'self, T, U> Trap<'self, T, U> { /// ``` pub fn inside(&self, inner: &'self fn() -> V) -> V { let _g = Guard { cond: self.cond }; - debug2!("Trap: pushing handler to TLS"); + debug!("Trap: pushing handler to TLS"); local_data::set(self.cond.key, self.handler); inner() } @@ -197,7 +197,7 @@ struct Guard<'self, T, U> { #[unsafe_destructor] impl<'self, T, U> Drop for Guard<'self, T, U> { fn drop(&mut self) { - debug2!("Guard: popping handler from TLS"); + debug!("Guard: popping handler from TLS"); let curr = local_data::pop(self.cond.key); match curr { None => {} @@ -216,20 +216,20 @@ mod test { } fn trouble(i: int) { - debug2!("trouble: raising condition"); + debug!("trouble: raising condition"); let j = sadness::cond.raise(i); - debug2!("trouble: handler recovered with {}", j); + debug!("trouble: handler recovered with {}", j); } fn nested_trap_test_inner() { let mut inner_trapped = false; do sadness::cond.trap(|_j| { - debug2!("nested_trap_test_inner: in handler"); + debug!("nested_trap_test_inner: in handler"); inner_trapped = true; 0 }).inside { - debug2!("nested_trap_test_inner: in protected block"); + debug!("nested_trap_test_inner: in protected block"); trouble(1); } @@ -241,10 +241,10 @@ mod test { let mut outer_trapped = false; do sadness::cond.trap(|_j| { - debug2!("nested_trap_test_outer: in handler"); + debug!("nested_trap_test_outer: in handler"); outer_trapped = true; 0 }).inside { - debug2!("nested_guard_test_outer: in protected block"); + debug!("nested_guard_test_outer: in protected block"); nested_trap_test_inner(); trouble(1); } @@ -256,13 +256,13 @@ mod test { let mut inner_trapped = false; do sadness::cond.trap(|_j| { - debug2!("nested_reraise_trap_test_inner: in handler"); + debug!("nested_reraise_trap_test_inner: in handler"); inner_trapped = true; let i = 10; - debug2!("nested_reraise_trap_test_inner: handler re-raising"); + debug!("nested_reraise_trap_test_inner: handler re-raising"); sadness::cond.raise(i) }).inside { - debug2!("nested_reraise_trap_test_inner: in protected block"); + debug!("nested_reraise_trap_test_inner: in protected block"); trouble(1); } @@ -274,10 +274,10 @@ mod test { let mut outer_trapped = false; do sadness::cond.trap(|_j| { - debug2!("nested_reraise_trap_test_outer: in handler"); + debug!("nested_reraise_trap_test_outer: in handler"); outer_trapped = true; 0 }).inside { - debug2!("nested_reraise_trap_test_outer: in protected block"); + debug!("nested_reraise_trap_test_outer: in protected block"); nested_reraise_trap_test_inner(); } @@ -289,10 +289,10 @@ mod test { let mut trapped = false; do sadness::cond.trap(|j| { - debug2!("test_default: in handler"); + debug!("test_default: in handler"); sadness::cond.raise_default(j, || { trapped=true; 5 }) }).inside { - debug2!("test_default: in protected block"); + debug!("test_default: in protected block"); trouble(1); } diff --git a/src/libstd/either.rs b/src/libstd/either.rs index 657212fc6922..262cdaed492a 100644 --- a/src/libstd/either.rs +++ b/src/libstd/either.rs @@ -78,7 +78,7 @@ impl Either { pub fn expect_left(self, reason: &str) -> L { match self { Left(x) => x, - Right(_) => fail2!("{}", reason.to_owned()) + Right(_) => fail!("{}", reason.to_owned()) } } @@ -94,7 +94,7 @@ impl Either { pub fn expect_right(self, reason: &str) -> R { match self { Right(x) => x, - Left(_) => fail2!("{}", reason.to_owned()) + Left(_) => fail!("{}", reason.to_owned()) } } diff --git a/src/libstd/hash.rs b/src/libstd/hash.rs index d63acb74acdb..ed7fc9eb1d95 100644 --- a/src/libstd/hash.rs +++ b/src/libstd/hash.rs @@ -493,10 +493,10 @@ mod tests { } while t < 64 { - debug2!("siphash test {}", t); + debug!("siphash test {}", t); let vec = u8to64_le!(vecs[t], 0); let out = Bytes(buf.as_slice()).hash_keyed(k0, k1); - debug2!("got {:?}, expected {:?}", out, vec); + debug!("got {:?}, expected {:?}", out, vec); assert_eq!(vec, out); stream_full.reset(); @@ -504,7 +504,7 @@ mod tests { let f = stream_full.result_str(); let i = stream_inc.result_str(); let v = to_hex_str(&vecs[t]); - debug2!("{}: ({}) => inc={} full={}", t, v, i, f); + debug!("{}: ({}) => inc={} full={}", t, v, i, f); assert!(f == i && f == v); diff --git a/src/libstd/hashmap.rs b/src/libstd/hashmap.rs index 7816480efab2..edefd39ebb4d 100644 --- a/src/libstd/hashmap.rs +++ b/src/libstd/hashmap.rs @@ -179,7 +179,7 @@ impl HashMap { fn value_for_bucket<'a>(&'a self, idx: uint) -> &'a V { match self.buckets[idx] { Some(ref bkt) => &bkt.value, - None => fail2!("HashMap::find: internal logic error"), + None => fail!("HashMap::find: internal logic error"), } } @@ -196,7 +196,7 @@ impl HashMap { /// True if there was no previous entry with that key fn insert_internal(&mut self, hash: uint, k: K, v: V) -> Option { match self.bucket_for_key_with_hash(hash, &k) { - TableFull => { fail2!("Internal logic error"); } + TableFull => { fail!("Internal logic error"); } FoundHole(idx) => { self.buckets[idx] = Some(Bucket{hash: hash, key: k, value: v}); @@ -205,7 +205,7 @@ impl HashMap { } FoundEntry(idx) => { match self.buckets[idx] { - None => { fail2!("insert_internal: Internal logic error") } + None => { fail!("insert_internal: Internal logic error") } Some(ref mut b) => { b.hash = hash; b.key = k; @@ -374,7 +374,7 @@ impl HashMap { let hash = k.hash_keyed(self.k0, self.k1) as uint; let idx = match self.bucket_for_key_with_hash(hash, &k) { - TableFull => fail2!("Internal logic error"), + TableFull => fail!("Internal logic error"), FoundEntry(idx) => { found(&k, self.mut_value_for_bucket(idx), a); idx } FoundHole(idx) => { let v = not_found(&k, a); @@ -413,7 +413,7 @@ impl HashMap { pub fn get<'a>(&'a self, k: &K) -> &'a V { match self.find(k) { Some(v) => v, - None => fail2!("No entry found for key: {:?}", k), + None => fail!("No entry found for key: {:?}", k), } } @@ -422,7 +422,7 @@ impl HashMap { pub fn get_mut<'a>(&'a mut self, k: &K) -> &'a mut V { match self.find_mut(k) { Some(v) => v, - None => fail2!("No entry found for key: {:?}", k), + None => fail!("No entry found for key: {:?}", k), } } @@ -826,7 +826,7 @@ mod test_map { assert!(m.insert(5, 14)); let new = 100; match m.find_mut(&5) { - None => fail2!(), Some(x) => *x = new + None => fail!(), Some(x) => *x = new } assert_eq!(m.find(&5), Some(&new)); } @@ -943,7 +943,7 @@ mod test_map { assert!(m.find(&1).is_none()); m.insert(1, 2); match m.find(&1) { - None => fail2!(), + None => fail!(), Some(v) => assert!(*v == 2) } } diff --git a/src/libstd/io.rs b/src/libstd/io.rs index b92806d715f0..94a6b7cfea8d 100644 --- a/src/libstd/io.rs +++ b/src/libstd/io.rs @@ -946,8 +946,8 @@ impl Reader for *libc::FILE { match libc::ferror(*self) { 0 => (), _ => { - error2!("error reading buffer: {}", os::last_os_error()); - fail2!(); + error!("error reading buffer: {}", os::last_os_error()); + fail!(); } } } @@ -1194,8 +1194,8 @@ impl Writer for *libc::FILE { len as size_t, *self); if nout != len as size_t { - error2!("error writing buffer: {}", os::last_os_error()); - fail2!(); + error!("error writing buffer: {}", os::last_os_error()); + fail!(); } } } @@ -1255,8 +1255,8 @@ impl Writer for fd_t { let vb = ptr::offset(vbuf, count as int) as *c_void; let nout = libc::write(*self, vb, len as IoSize); if nout < 0 as IoRet { - error2!("error writing buffer: {}", os::last_os_error()); - fail2!(); + error!("error writing buffer: {}", os::last_os_error()); + fail!(); } count += nout as uint; } @@ -1264,12 +1264,12 @@ impl Writer for fd_t { } } fn seek(&self, _offset: int, _whence: SeekStyle) { - error2!("need 64-bit foreign calls for seek, sorry"); - fail2!(); + error!("need 64-bit foreign calls for seek, sorry"); + fail!(); } fn tell(&self) -> uint { - error2!("need 64-bit foreign calls for tell, sorry"); - fail2!(); + error!("need 64-bit foreign calls for tell, sorry"); + fail!(); } fn flush(&self) -> int { 0 } fn get_type(&self) -> WriterType { @@ -1895,17 +1895,17 @@ mod tests { #[test] fn test_simple() { let tmpfile = &Path::new("tmp/lib-io-test-simple.tmp"); - debug2!("{}", tmpfile.display()); + debug!("{}", tmpfile.display()); let frood: ~str = ~"A hoopy frood who really knows where his towel is."; - debug2!("{}", frood.clone()); + debug!("{}", frood.clone()); { let out = io::file_writer(tmpfile, [io::Create, io::Truncate]).unwrap(); out.write_str(frood); } let inp = io::file_reader(tmpfile).unwrap(); let frood2: ~str = inp.read_c_str(); - debug2!("{}", frood2.clone()); + debug!("{}", frood2.clone()); assert_eq!(frood, frood2); } @@ -1922,14 +1922,14 @@ mod tests { { let file = io::file_reader(&path).unwrap(); do file.each_byte() |_| { - fail2!("must be empty") + fail!("must be empty") }; } { let file = io::file_reader(&path).unwrap(); do file.each_char() |_| { - fail2!("must be empty") + fail!("must be empty") }; } } @@ -2016,7 +2016,7 @@ mod tests { Err(e) => { assert_eq!(e, ~"error opening not a file"); } - Ok(_) => fail2!() + Ok(_) => fail!() } } @@ -2056,7 +2056,7 @@ mod tests { Err(e) => { assert!(e.starts_with("error opening")); } - Ok(_) => fail2!() + Ok(_) => fail!() } } diff --git a/src/libstd/iter.rs b/src/libstd/iter.rs index 4d2abd2633f9..01af3d931573 100644 --- a/src/libstd/iter.rs +++ b/src/libstd/iter.rs @@ -742,7 +742,7 @@ pub trait ExactSize : DoubleEndedIterator { Some(x) => { i = match i.checked_sub(&1) { Some(x) => x, - None => fail2!("rposition: incorrect ExactSize") + None => fail!("rposition: incorrect ExactSize") }; if predicate(x) { return Some(i) @@ -2487,7 +2487,7 @@ mod tests { assert!(v.iter().all(|&x| x < 10)); assert!(!v.iter().all(|&x| x.is_even())); assert!(!v.iter().all(|&x| x > 100)); - assert!(v.slice(0, 0).iter().all(|_| fail2!())); + assert!(v.slice(0, 0).iter().all(|_| fail!())); } #[test] @@ -2496,7 +2496,7 @@ mod tests { assert!(v.iter().any(|&x| x < 10)); assert!(v.iter().any(|&x| x.is_even())); assert!(!v.iter().any(|&x| x > 100)); - assert!(!v.slice(0, 0).iter().any(|_| fail2!())); + assert!(!v.slice(0, 0).iter().any(|_| fail!())); } #[test] @@ -2646,7 +2646,7 @@ mod tests { let mut i = 0; do v.iter().rposition |_elt| { if i == 2 { - fail2!() + fail!() } i += 1; false @@ -2790,12 +2790,12 @@ mod tests { fn test_double_ended_range() { assert_eq!(range(11i, 14).invert().collect::<~[int]>(), ~[13i, 12, 11]); for _ in range(10i, 0).invert() { - fail2!("unreachable"); + fail!("unreachable"); } assert_eq!(range(11u, 14).invert().collect::<~[uint]>(), ~[13u, 12, 11]); for _ in range(10u, 0).invert() { - fail2!("unreachable"); + fail!("unreachable"); } } diff --git a/src/libstd/local_data.rs b/src/libstd/local_data.rs index 64f02539d0f9..30175d6609b9 100644 --- a/src/libstd/local_data.rs +++ b/src/libstd/local_data.rs @@ -144,7 +144,7 @@ pub fn pop(key: Key) -> Option { match *entry { Some((k, _, loan)) if k == key_value => { if loan != NoLoan { - fail2!("TLS value cannot be removed because it is currently \ + fail!("TLS value cannot be removed because it is currently \ borrowed as {}", loan.describe()); } // Move the data out of the `entry` slot via util::replace. @@ -241,7 +241,7 @@ fn get_with(key: Key, } (ImmLoan, ImmLoan) => {} (want, cur) => { - fail2!("TLS slot cannot be borrowed as {} because \ + fail!("TLS slot cannot be borrowed as {} because \ it is already borrowed as {}", want.describe(), cur.describe()); } @@ -305,7 +305,7 @@ pub fn set(key: Key, data: T) { match *entry { Some((ekey, _, loan)) if key == ekey => { if loan != NoLoan { - fail2!("TLS value cannot be overwritten because it is + fail!("TLS value cannot be overwritten because it is already borrowed as {}", loan.describe()) } true @@ -389,15 +389,15 @@ mod tests { static my_key: Key<@~str> = &Key; modify(my_key, |data| { match data { - Some(@ref val) => fail2!("unwelcome value: {}", *val), + Some(@ref val) => fail!("unwelcome value: {}", *val), None => Some(@~"first data") } }); modify(my_key, |data| { match data { Some(@~"first data") => Some(@~"next data"), - Some(@ref val) => fail2!("wrong value: {}", *val), - None => fail2!("missing value") + Some(@ref val) => fail!("wrong value: {}", *val), + None => fail!("missing value") } }); assert!(*(pop(my_key).unwrap()) == ~"next data"); @@ -457,11 +457,11 @@ mod tests { set(str_key, @~"string data"); set(box_key, @@()); set(int_key, @42); - fail2!(); + fail!(); } // Not quite nondeterministic. set(int_key, @31337); - fail2!(); + fail!(); } #[test] diff --git a/src/libstd/num/f32.rs b/src/libstd/num/f32.rs index e99dcd6b2eb3..3103731a52fa 100644 --- a/src/libstd/num/f32.rs +++ b/src/libstd/num/f32.rs @@ -820,7 +820,7 @@ impl num::ToStrRadix for f32 { fn to_str_radix(&self, rdx: uint) -> ~str { let (r, special) = strconv::float_to_str_common( *self, rdx, true, strconv::SignNeg, strconv::DigAll); - if special { fail2!("number has a special value, \ + if special { fail!("number has a special value, \ try to_str_radix_special() if those are expected") } r } diff --git a/src/libstd/num/f64.rs b/src/libstd/num/f64.rs index f367de376d41..da8270703d72 100644 --- a/src/libstd/num/f64.rs +++ b/src/libstd/num/f64.rs @@ -868,7 +868,7 @@ impl num::ToStrRadix for f64 { fn to_str_radix(&self, rdx: uint) -> ~str { let (r, special) = strconv::float_to_str_common( *self, rdx, true, strconv::SignNeg, strconv::DigAll); - if special { fail2!("number has a special value, \ + if special { fail!("number has a special value, \ try to_str_radix_special() if those are expected") } r } diff --git a/src/libstd/num/strconv.rs b/src/libstd/num/strconv.rs index 0f253a26ccf1..d17c947ab562 100644 --- a/src/libstd/num/strconv.rs +++ b/src/libstd/num/strconv.rs @@ -473,19 +473,19 @@ pub fn from_str_bytes_common+ ) -> Option { match exponent { ExpDec if radix >= DIGIT_E_RADIX // decimal exponent 'e' - => fail2!("from_str_bytes_common: radix {:?} incompatible with \ + => fail!("from_str_bytes_common: radix {:?} incompatible with \ use of 'e' as decimal exponent", radix), ExpBin if radix >= DIGIT_P_RADIX // binary exponent 'p' - => fail2!("from_str_bytes_common: radix {:?} incompatible with \ + => fail!("from_str_bytes_common: radix {:?} incompatible with \ use of 'p' as binary exponent", radix), _ if special && radix >= DIGIT_I_RADIX // first digit of 'inf' - => fail2!("from_str_bytes_common: radix {:?} incompatible with \ + => fail!("from_str_bytes_common: radix {:?} incompatible with \ special values 'inf' and 'NaN'", radix), _ if (radix as int) < 2 - => fail2!("from_str_bytes_common: radix {:?} to low, \ + => fail!("from_str_bytes_common: radix {:?} to low, \ must lie in the range [2, 36]", radix), _ if (radix as int) > 36 - => fail2!("from_str_bytes_common: radix {:?} to high, \ + => fail!("from_str_bytes_common: radix {:?} to high, \ must lie in the range [2, 36]", radix), _ => () } diff --git a/src/libstd/option.rs b/src/libstd/option.rs index cdff32a46dc7..732dbe64d015 100644 --- a/src/libstd/option.rs +++ b/src/libstd/option.rs @@ -244,7 +244,7 @@ impl Option { pub fn get_ref<'a>(&'a self) -> &'a T { match *self { Some(ref x) => x, - None => fail2!("called `Option::get_ref()` on a `None` value"), + None => fail!("called `Option::get_ref()` on a `None` value"), } } @@ -264,7 +264,7 @@ impl Option { pub fn get_mut_ref<'a>(&'a mut self) -> &'a mut T { match *self { Some(ref mut x) => x, - None => fail2!("called `Option::get_mut_ref()` on a `None` value"), + None => fail!("called `Option::get_mut_ref()` on a `None` value"), } } @@ -286,7 +286,7 @@ impl Option { pub fn unwrap(self) -> T { match self { Some(x) => x, - None => fail2!("called `Option::unwrap()` on a `None` value"), + None => fail!("called `Option::unwrap()` on a `None` value"), } } @@ -299,7 +299,7 @@ impl Option { #[inline] pub fn take_unwrap(&mut self) -> T { if self.is_none() { - fail2!("called `Option::take_unwrap()` on a `None` value") + fail!("called `Option::take_unwrap()` on a `None` value") } self.take().unwrap() } @@ -314,7 +314,7 @@ impl Option { pub fn expect(self, reason: &str) -> T { match self { Some(val) => val, - None => fail2!("{}", reason.to_owned()), + None => fail!("{}", reason.to_owned()), } } @@ -630,7 +630,7 @@ mod tests { #[test] #[should_fail] - fn test_unwrap_fail2() { + fn test_unwrap_fail() { let x: Option<~str> = None; x.unwrap(); } diff --git a/src/libstd/os.rs b/src/libstd/os.rs index 41acd050a509..ba2b42c9b9c8 100644 --- a/src/libstd/os.rs +++ b/src/libstd/os.rs @@ -89,7 +89,7 @@ pub fn getcwd() -> Path { do buf.as_mut_buf |buf, len| { unsafe { if libc::getcwd(buf, len as size_t).is_null() { - fail2!() + fail!() } Path::new(CString::new(buf as *c_char, false)) @@ -106,7 +106,7 @@ pub fn getcwd() -> Path { do buf.as_mut_buf |buf, len| { unsafe { if libc::GetCurrentDirectoryW(len as DWORD, buf) == 0 as DWORD { - fail2!(); + fail!(); } } } @@ -197,7 +197,7 @@ pub fn env() -> ~[(~str,~str)] { }; let ch = GetEnvironmentStringsA(); if (ch as uint == 0) { - fail2!("os::env() failure getting env string from OS: {}", + fail!("os::env() failure getting env string from OS: {}", os::last_os_error()); } let result = str::raw::from_c_multistring(ch as *libc::c_char, None); @@ -213,13 +213,13 @@ pub fn env() -> ~[(~str,~str)] { } let environ = rust_env_pairs(); if (environ as uint == 0) { - fail2!("os::env() failure getting env string from OS: {}", + fail!("os::env() failure getting env string from OS: {}", os::last_os_error()); } let mut result = ~[]; ptr::array_each(environ, |e| { let env_pair = str::raw::from_c_str(e); - debug2!("get_env_pairs: {}", env_pair); + debug!("get_env_pairs: {}", env_pair); result.push(env_pair); }); result @@ -229,7 +229,7 @@ pub fn env() -> ~[(~str,~str)] { let mut pairs = ~[]; for p in input.iter() { let vs: ~[&str] = p.splitn_iter('=', 1).collect(); - debug2!("splitting: len: {}", vs.len()); + debug!("splitting: len: {}", vs.len()); assert_eq!(vs.len(), 2); pairs.push((vs[0].to_owned(), vs[1].to_owned())); } @@ -767,14 +767,14 @@ pub fn list_dir(p: &Path) -> ~[Path] { fn rust_list_dir_val(ptr: *dirent_t) -> *libc::c_char; } let mut paths = ~[]; - debug2!("os::list_dir -- BEFORE OPENDIR"); + debug!("os::list_dir -- BEFORE OPENDIR"); let dir_ptr = do p.with_c_str |buf| { opendir(buf) }; if (dir_ptr as uint != 0) { - debug2!("os::list_dir -- opendir() SUCCESS"); + debug!("os::list_dir -- opendir() SUCCESS"); let mut entry_ptr = readdir(dir_ptr); while (entry_ptr as uint != 0) { let cstr = CString::new(rust_list_dir_val(entry_ptr), false); @@ -784,9 +784,9 @@ pub fn list_dir(p: &Path) -> ~[Path] { closedir(dir_ptr); } else { - debug2!("os::list_dir -- opendir() FAILURE"); + debug!("os::list_dir -- opendir() FAILURE"); } - debug2!("os::list_dir -- AFTER -- \\#: {}", paths.len()); + debug!("os::list_dir -- AFTER -- \\#: {}", paths.len()); paths } #[cfg(windows)] @@ -820,7 +820,7 @@ pub fn list_dir(p: &Path) -> ~[Path] { while more_files != 0 { let fp_buf = rust_list_dir_wfd_fp_buf(wfd_ptr); if fp_buf as uint == 0 { - fail2!("os::list_dir() failure: got null ptr from wfd"); + fail!("os::list_dir() failure: got null ptr from wfd"); } else { let fp_vec = vec::from_buf( @@ -1143,7 +1143,7 @@ pub fn last_os_error() -> ~str { do buf.as_mut_buf |buf, len| { unsafe { if strerror_r(errno() as c_int, buf, len as size_t) < 0 { - fail2!("strerror_r failure"); + fail!("strerror_r failure"); } str::raw::from_c_str(buf as *c_char) @@ -1207,7 +1207,7 @@ pub fn last_os_error() -> ~str { len as DWORD, ptr::null()); if res == 0 { - fail2!("[{}] FormatMessage failure", errno()); + fail!("[{}] FormatMessage failure", errno()); } } @@ -1263,7 +1263,7 @@ fn real_args() -> ~[~str] { match rt::args::clone() { Some(args) => args, - None => fail2!("process arguments not initialized") + None => fail!("process arguments not initialized") } } @@ -1508,10 +1508,10 @@ impl Drop for MemoryMap { match libc::munmap(self.data as *c_void, self.len) { 0 => (), -1 => match errno() as c_int { - libc::EINVAL => error2!("invalid addr or len"), - e => error2!("unknown errno={}", e) + libc::EINVAL => error!("invalid addr or len"), + e => error!("unknown errno={}", e) }, - r => error2!("Unexpected result {}", r) + r => error!("Unexpected result {}", r) } } } @@ -1639,15 +1639,15 @@ impl Drop for MemoryMap { if libc::VirtualFree(self.data as *mut c_void, self.len, libc::MEM_RELEASE) == FALSE { - error2!("VirtualFree failed: {}", errno()); + error!("VirtualFree failed: {}", errno()); } }, MapFile(mapping) => { if libc::UnmapViewOfFile(self.data as LPCVOID) == FALSE { - error2!("UnmapViewOfFile failed: {}", errno()); + error!("UnmapViewOfFile failed: {}", errno()); } if libc::CloseHandle(mapping as HANDLE) == FALSE { - error2!("CloseHandle failed: {}", errno()); + error!("CloseHandle failed: {}", errno()); } } } @@ -1778,7 +1778,7 @@ mod tests { #[test] pub fn last_os_error() { - debug2!("{}", os::last_os_error()); + debug!("{}", os::last_os_error()); } #[test] @@ -1833,7 +1833,7 @@ mod tests { } let n = make_rand_name(); setenv(n, s); - debug2!("{}", s.clone()); + debug!("{}", s.clone()); assert_eq!(getenv(n), option::Some(s)); } @@ -1842,7 +1842,7 @@ mod tests { let path = os::self_exe_path(); assert!(path.is_some()); let path = path.unwrap(); - debug2!("{:?}", path.clone()); + debug!("{:?}", path.clone()); // Hard to test this function assert!(path.is_absolute()); @@ -1855,7 +1855,7 @@ mod tests { assert!(e.len() > 0u); for p in e.iter() { let (n, v) = (*p).clone(); - debug2!("{:?}", n.clone()); + debug!("{:?}", n.clone()); let v2 = getenv(n); // MingW seems to set some funky environment variables like // "=C:=C:\MinGW\msys\1.0\bin" and "!::=::\" that are returned @@ -1881,10 +1881,10 @@ mod tests { assert!((!Path::new("test-path").is_absolute())); let cwd = getcwd(); - debug2!("Current working directory: {}", cwd.display()); + debug!("Current working directory: {}", cwd.display()); - debug2!("{:?}", make_absolute(&Path::new("test-path"))); - debug2!("{:?}", make_absolute(&Path::new("/usr/bin"))); + debug!("{:?}", make_absolute(&Path::new("test-path"))); + debug!("{:?}", make_absolute(&Path::new("/usr/bin"))); } #[test] @@ -1949,7 +1949,7 @@ mod tests { assert!(dirs.len() > 0u); for dir in dirs.iter() { - debug2!("{:?}", (*dir).clone()); + debug!("{:?}", (*dir).clone()); } } @@ -1978,16 +1978,16 @@ mod tests { let mut dirpath = os::tmpdir(); dirpath.push(format!("rust-test-{}/test-\uac00\u4e00\u30fc\u4f60\u597d", rand::random::())); // 가一ー你好 - debug2!("path_is_dir dirpath: {}", dirpath.display()); + debug!("path_is_dir dirpath: {}", dirpath.display()); let mkdir_result = os::mkdir_recursive(&dirpath, (S_IRUSR | S_IWUSR | S_IXUSR) as i32); - debug2!("path_is_dir mkdir_result: {}", mkdir_result); + debug!("path_is_dir mkdir_result: {}", mkdir_result); assert!((os::path_is_dir(&dirpath))); let mut filepath = dirpath; filepath.push("unicode-file-\uac00\u4e00\u30fc\u4f60\u597d.rs"); - debug2!("path_is_dir filepath: {}", filepath.display()); + debug!("path_is_dir filepath: {}", filepath.display()); open(&filepath, OpenOrCreate, Read); // ignore return; touch only assert!((!os::path_is_dir(&filepath))); @@ -2048,7 +2048,7 @@ mod tests { let in_mode = input.get_mode(); let rs = os::copy_file(&input, &out); if (!os::path_exists(&input)) { - fail2!("{} doesn't exist", input.display()); + fail!("{} doesn't exist", input.display()); } assert!((rs)); // FIXME (#9639): This needs to handle non-utf8 paths @@ -2076,7 +2076,7 @@ mod tests { os::MapWritable ]) { Ok(chunk) => chunk, - Err(msg) => fail2!(msg.to_str()) + Err(msg) => fail!(msg.to_str()) }; assert!(chunk.len >= 16); @@ -2133,7 +2133,7 @@ mod tests { MapOffset(size / 2) ]) { Ok(chunk) => chunk, - Err(msg) => fail2!(msg.to_str()) + Err(msg) => fail!(msg.to_str()) }; assert!(chunk.len > 0); diff --git a/src/libstd/path/mod.rs b/src/libstd/path/mod.rs index 4962b63c8cff..f71f67a30db8 100644 --- a/src/libstd/path/mod.rs +++ b/src/libstd/path/mod.rs @@ -54,12 +54,12 @@ actually operates on the path; it is only intended for display. ```rust let mut path = Path::new("/tmp/path"); -debug2!("path: {}", path.display()); +debug!("path: {}", path.display()); path.set_filename("foo"); path.push("bar"); -debug2!("new path: {}", path.display()); +debug!("new path: {}", path.display()); let b = std::os::path_exists(&path); -debug2!("path exists: {}", b); +debug!("path exists: {}", b); ``` */ diff --git a/src/libstd/ptr.rs b/src/libstd/ptr.rs index c27665d76985..8803d39b0c67 100644 --- a/src/libstd/ptr.rs +++ b/src/libstd/ptr.rs @@ -236,16 +236,16 @@ pub fn to_mut_unsafe_ptr(thing: &mut T) -> *mut T { SAFETY NOTE: Pointer-arithmetic. Dragons be here. */ pub unsafe fn array_each_with_len(arr: **T, len: uint, cb: &fn(*T)) { - debug2!("array_each_with_len: before iterate"); + debug!("array_each_with_len: before iterate"); if (arr as uint == 0) { - fail2!("ptr::array_each_with_len failure: arr input is null pointer"); + fail!("ptr::array_each_with_len failure: arr input is null pointer"); } //let start_ptr = *arr; for e in range(0, len) { let n = offset(arr, e as int); cb(*n); } - debug2!("array_each_with_len: after iterate"); + debug!("array_each_with_len: after iterate"); } /** @@ -259,10 +259,10 @@ pub unsafe fn array_each_with_len(arr: **T, len: uint, cb: &fn(*T)) { */ pub unsafe fn array_each(arr: **T, cb: &fn(*T)) { if (arr as uint == 0) { - fail2!("ptr::array_each_with_len failure: arr input is null pointer"); + fail!("ptr::array_each_with_len failure: arr input is null pointer"); } let len = buf_len(arr); - debug2!("array_each inferred len: {}", len); + debug!("array_each inferred len: {}", len); array_each_with_len(arr, len, cb); } @@ -669,7 +669,7 @@ pub mod ptr_tests { let expected = do expected_arr[ctr].with_ref |buf| { str::raw::from_c_str(buf) }; - debug2!( + debug!( "test_ptr_array_each_with_len e: {}, a: {}", expected, actual); assert_eq!(actual, expected); @@ -706,7 +706,7 @@ pub mod ptr_tests { let expected = do expected_arr[ctr].with_ref |buf| { str::raw::from_c_str(buf) }; - debug2!( + debug!( "test_ptr_array_each e: {}, a: {}", expected, actual); assert_eq!(actual, expected); diff --git a/src/libstd/rand/mod.rs b/src/libstd/rand/mod.rs index 954db42c89be..f5c60417bacb 100644 --- a/src/libstd/rand/mod.rs +++ b/src/libstd/rand/mod.rs @@ -175,7 +175,7 @@ pub trait Rng { *b = (rand >> 8) as u8; *c = (rand >> 16) as u8; } - _ => fail2!("Rng.fill_bytes: the impossible occurred: remaining != 1, 2 or 3") + _ => fail!("Rng.fill_bytes: the impossible occurred: remaining != 1, 2 or 3") } } @@ -797,7 +797,7 @@ mod test { let mut r = rng(); let a = r.gen::(); let b = r.gen::(); - debug2!("{:?}", (a, b)); + debug!("{:?}", (a, b)); } #[test] @@ -810,9 +810,9 @@ mod test { #[test] fn test_gen_ascii_str() { let mut r = rng(); - debug2!("{}", r.gen_ascii_str(10u)); - debug2!("{}", r.gen_ascii_str(10u)); - debug2!("{}", r.gen_ascii_str(10u)); + debug!("{}", r.gen_ascii_str(10u)); + debug!("{}", r.gen_ascii_str(10u)); + debug!("{}", r.gen_ascii_str(10u)); assert_eq!(r.gen_ascii_str(0u).len(), 0u); assert_eq!(r.gen_ascii_str(10u).len(), 10u); assert_eq!(r.gen_ascii_str(16u).len(), 16u); diff --git a/src/libstd/rand/reader.rs b/src/libstd/rand/reader.rs index 961a5b2cd286..f1e67da815e1 100644 --- a/src/libstd/rand/reader.rs +++ b/src/libstd/rand/reader.rs @@ -68,9 +68,9 @@ impl Rng for ReaderRng { if v.len() == 0 { return } match self.reader.read(v) { Some(n) if n == v.len() => return, - Some(n) => fail2!("ReaderRng.fill_bytes could not fill buffer: \ + Some(n) => fail!("ReaderRng.fill_bytes could not fill buffer: \ read {} out of {} bytes.", n, v.len()), - None => fail2!("ReaderRng.fill_bytes reached eof.") + None => fail!("ReaderRng.fill_bytes reached eof.") } } } diff --git a/src/libstd/repr.rs b/src/libstd/repr.rs index a788064293ff..4feb1ca19104 100644 --- a/src/libstd/repr.rs +++ b/src/libstd/repr.rs @@ -182,7 +182,7 @@ impl<'self> ReprVisitor<'self> { } else if mtbl == 1 { // skip, this is ast::m_imm } else { - fail2!("invalid mutability value"); + fail!("invalid mutability value"); } } @@ -294,7 +294,7 @@ impl<'self> TyVisitor for ReprVisitor<'self> { // Type no longer exists, vestigial function. fn visit_estr_fixed(&mut self, _n: uint, _sz: uint, - _align: uint) -> bool { fail2!(); } + _align: uint) -> bool { fail!(); } fn visit_box(&mut self, mtbl: uint, inner: *TyDesc) -> bool { self.writer.write(['@' as u8]); @@ -337,7 +337,7 @@ impl<'self> TyVisitor for ReprVisitor<'self> { } // Type no longer exists, vestigial function. - fn visit_vec(&mut self, _mtbl: uint, _inner: *TyDesc) -> bool { fail2!(); } + fn visit_vec(&mut self, _mtbl: uint, _inner: *TyDesc) -> bool { fail!(); } fn visit_unboxed_vec(&mut self, mtbl: uint, inner: *TyDesc) -> bool { do self.get::> |this, b| { @@ -552,7 +552,7 @@ impl<'self> TyVisitor for ReprVisitor<'self> { _align: uint) -> bool { match self.var_stk.pop() { - SearchingFor(*) => fail2!("enum value matched no variant"), + SearchingFor(*) => fail!("enum value matched no variant"), _ => true } } diff --git a/src/libstd/result.rs b/src/libstd/result.rs index 92315b5d47a2..957ba4a04389 100644 --- a/src/libstd/result.rs +++ b/src/libstd/result.rs @@ -47,7 +47,7 @@ impl Result { pub fn get_ref<'a>(&'a self) -> &'a T { match *self { Ok(ref t) => t, - Err(ref e) => fail2!("called `Result::get_ref()` on `Err` value: {}", + Err(ref e) => fail!("called `Result::get_ref()` on `Err` value: {}", e.to_str()), } } @@ -108,7 +108,7 @@ impl Result { pub fn unwrap(self) -> T { match self { Ok(t) => t, - Err(e) => fail2!("called `Result::unwrap()` on `Err` value: {}", + Err(e) => fail!("called `Result::unwrap()` on `Err` value: {}", e.to_str()), } } @@ -126,7 +126,7 @@ impl Result { pub fn expect(self, reason: &str) -> T { match self { Ok(t) => t, - Err(_) => fail2!("{}", reason.to_owned()), + Err(_) => fail!("{}", reason.to_owned()), } } @@ -136,7 +136,7 @@ impl Result { pub fn expect_err(self, reason: &str) -> E { match self { Err(e) => e, - Ok(_) => fail2!("{}", reason.to_owned()), + Ok(_) => fail!("{}", reason.to_owned()), } } @@ -571,7 +571,7 @@ mod tests { Err(2)); // test that it does not take more elements than it needs - let functions = [|| Ok(()), || Err(1), || fail2!()]; + let functions = [|| Ok(()), || Err(1), || fail!()]; assert_eq!(collect(functions.iter().map(|f| (*f)())), Err(1)); @@ -591,7 +591,7 @@ mod tests { Err(2)); // test that it does not take more elements than it needs - let functions = [|| Ok(()), || Err(1), || fail2!()]; + let functions = [|| Ok(()), || Err(1), || fail!()]; assert_eq!(fold_(functions.iter() .map(|f| (*f)())), diff --git a/src/libstd/rt/args.rs b/src/libstd/rt/args.rs index 315de4b9af38..24143ba040ba 100644 --- a/src/libstd/rt/args.rs +++ b/src/libstd/rt/args.rs @@ -163,14 +163,14 @@ mod imp { } pub fn take() -> Option<~[~str]> { - fail2!() + fail!() } pub fn put(_args: ~[~str]) { - fail2!() + fail!() } pub fn clone() -> Option<~[~str]> { - fail2!() + fail!() } } diff --git a/src/libstd/rt/comm.rs b/src/libstd/rt/comm.rs index 3e3431b32c97..4eae8bdc9a82 100644 --- a/src/libstd/rt/comm.rs +++ b/src/libstd/rt/comm.rs @@ -196,7 +196,7 @@ impl PortOne { match self.try_recv() { Some(val) => val, None => { - fail2!("receiving on closed channel"); + fail!("receiving on closed channel"); } } } @@ -495,7 +495,7 @@ impl GenericPort for Port { match self.try_recv() { Some(val) => val, None => { - fail2!("receiving on closed channel"); + fail!("receiving on closed channel"); } } } @@ -650,7 +650,7 @@ impl GenericPort for SharedPort { match self.try_recv() { Some(val) => val, None => { - fail2!("receiving on a closed channel"); + fail!("receiving on a closed channel"); } } } diff --git a/src/libstd/rt/crate_map.rs b/src/libstd/rt/crate_map.rs index 96a0069e8515..d33e1af90f8d 100644 --- a/src/libstd/rt/crate_map.rs +++ b/src/libstd/rt/crate_map.rs @@ -93,7 +93,7 @@ fn do_iter_crate_map<'a>(crate_map: &'a CrateMap<'a>, f: &fn(&ModEntry), do_iter_crate_map(*child, |x| f(x), visited); } }, - _ => fail2!("invalid crate map version") + _ => fail!("invalid crate map version") } } } diff --git a/src/libstd/rt/io/comm_adapters.rs b/src/libstd/rt/io/comm_adapters.rs index 495d1f97cd2b..06424fee8bc1 100644 --- a/src/libstd/rt/io/comm_adapters.rs +++ b/src/libstd/rt/io/comm_adapters.rs @@ -15,45 +15,45 @@ use super::{Reader, Writer}; struct PortReader

; impl> PortReader

{ - pub fn new(_port: P) -> PortReader

{ fail2!() } + pub fn new(_port: P) -> PortReader

{ fail!() } } impl> Reader for PortReader

{ - fn read(&mut self, _buf: &mut [u8]) -> Option { fail2!() } + fn read(&mut self, _buf: &mut [u8]) -> Option { fail!() } - fn eof(&mut self) -> bool { fail2!() } + fn eof(&mut self) -> bool { fail!() } } struct ChanWriter; impl> ChanWriter { - pub fn new(_chan: C) -> ChanWriter { fail2!() } + pub fn new(_chan: C) -> ChanWriter { fail!() } } impl> Writer for ChanWriter { - fn write(&mut self, _buf: &[u8]) { fail2!() } + fn write(&mut self, _buf: &[u8]) { fail!() } - fn flush(&mut self) { fail2!() } + fn flush(&mut self) { fail!() } } struct ReaderPort; impl ReaderPort { - pub fn new(_reader: R) -> ReaderPort { fail2!() } + pub fn new(_reader: R) -> ReaderPort { fail!() } } impl GenericPort<~[u8]> for ReaderPort { - fn recv(&self) -> ~[u8] { fail2!() } + fn recv(&self) -> ~[u8] { fail!() } - fn try_recv(&self) -> Option<~[u8]> { fail2!() } + fn try_recv(&self) -> Option<~[u8]> { fail!() } } struct WriterChan; impl WriterChan { - pub fn new(_writer: W) -> WriterChan { fail2!() } + pub fn new(_writer: W) -> WriterChan { fail!() } } impl GenericChan<~[u8]> for WriterChan { - fn send(&self, _x: ~[u8]) { fail2!() } + fn send(&self, _x: ~[u8]) { fail!() } } diff --git a/src/libstd/rt/io/extensions.rs b/src/libstd/rt/io/extensions.rs index 69f0423bf5d3..99634b532b08 100644 --- a/src/libstd/rt/io/extensions.rs +++ b/src/libstd/rt/io/extensions.rs @@ -288,7 +288,7 @@ impl ReaderUtil for T { let mut buf = [0]; match self.read(buf) { Some(0) => { - debug2!("read 0 bytes. trying again"); + debug!("read 0 bytes. trying again"); self.read_byte() } Some(1) => Some(buf[0]), diff --git a/src/libstd/rt/io/file.rs b/src/libstd/rt/io/file.rs index 39c3c5692f8a..a5d593d2454d 100644 --- a/src/libstd/rt/io/file.rs +++ b/src/libstd/rt/io/file.rs @@ -59,7 +59,7 @@ use path::Path; /// }).inside { /// let stream = match open(p, Create, ReadWrite) { /// Some(s) => s, -/// None => fail2!("whoops! I'm sure this raised, anyways.."); +/// None => fail!("whoops! I'm sure this raised, anyways.."); /// } /// // do some stuff with that stream /// @@ -223,7 +223,7 @@ pub fn rmdir(path: &P) { /// }).inside { /// let info = match stat(p) { /// Some(s) => s, -/// None => fail2!("whoops! I'm sure this raised, anyways.."); +/// None => fail!("whoops! I'm sure this raised, anyways.."); /// } /// if stat.is_file { /// // just imagine the possibilities ... @@ -271,7 +271,7 @@ pub fn stat(path: &P) -> Option { /// else { cb(entry); } /// } /// } -/// else { fail2!("nope"); } +/// else { fail!("nope"); } /// } /// /// # Errors @@ -596,7 +596,7 @@ impl FileInfo for Path { } /// else { cb(entry); } /// } /// } -/// else { fail2!("nope"); } +/// else { fail!("nope"); } /// } /// ``` pub trait DirectoryInfo : FileSystemInfo { @@ -713,7 +713,7 @@ mod test { let mut read_stream = open(filename, Open, Read).unwrap(); let mut read_buf = [0, .. 1028]; let read_str = match read_stream.read(read_buf).unwrap() { - -1|0 => fail2!("shouldn't happen"), + -1|0 => fail!("shouldn't happen"), n => str::from_utf8(read_buf.slice_to(n)) }; assert!(read_str == message.to_owned()); @@ -881,7 +881,7 @@ mod test { } let stat_res = match stat(filename) { Some(s) => s, - None => fail2!("shouldn't happen") + None => fail!("shouldn't happen") }; assert!(stat_res.is_file); unlink(filename); @@ -895,7 +895,7 @@ mod test { mkdir(filename); let stat_res = match stat(filename) { Some(s) => s, - None => fail2!("shouldn't happen") + None => fail!("shouldn't happen") }; assert!(stat_res.is_dir); rmdir(filename); @@ -964,7 +964,7 @@ mod test { r.read(mem); let read_str = str::from_utf8(mem); let expected = match n { - None|Some("") => fail2!("really shouldn't happen.."), + None|Some("") => fail!("really shouldn't happen.."), Some(n) => prefix+n }; assert!(expected == read_str); @@ -972,7 +972,7 @@ mod test { f.unlink(); } }, - None => fail2!("shouldn't happen") + None => fail!("shouldn't happen") } dir.rmdir(); } diff --git a/src/libstd/rt/io/flate.rs b/src/libstd/rt/io/flate.rs index 72029d07263e..7c72ce6ba891 100644 --- a/src/libstd/rt/io/flate.rs +++ b/src/libstd/rt/io/flate.rs @@ -29,9 +29,9 @@ impl DeflateWriter { } impl Writer for DeflateWriter { - fn write(&mut self, _buf: &[u8]) { fail2!() } + fn write(&mut self, _buf: &[u8]) { fail!() } - fn flush(&mut self) { fail2!() } + fn flush(&mut self) { fail!() } } impl Decorator for DeflateWriter { @@ -68,9 +68,9 @@ impl InflateReader { } impl Reader for InflateReader { - fn read(&mut self, _buf: &mut [u8]) -> Option { fail2!() } + fn read(&mut self, _buf: &mut [u8]) -> Option { fail!() } - fn eof(&mut self) -> bool { fail2!() } + fn eof(&mut self) -> bool { fail!() } } impl Decorator for InflateReader { diff --git a/src/libstd/rt/io/mem.rs b/src/libstd/rt/io/mem.rs index 1f396a4476e1..5f6b4398c22f 100644 --- a/src/libstd/rt/io/mem.rs +++ b/src/libstd/rt/io/mem.rs @@ -40,7 +40,7 @@ impl Writer for MemWriter { impl Seek for MemWriter { fn tell(&self) -> u64 { self.buf.len() as u64 } - fn seek(&mut self, _pos: i64, _style: SeekStyle) { fail2!() } + fn seek(&mut self, _pos: i64, _style: SeekStyle) { fail!() } } impl Decorator<~[u8]> for MemWriter { @@ -102,7 +102,7 @@ impl Reader for MemReader { impl Seek for MemReader { fn tell(&self) -> u64 { self.pos as u64 } - fn seek(&mut self, _pos: i64, _style: SeekStyle) { fail2!() } + fn seek(&mut self, _pos: i64, _style: SeekStyle) { fail!() } } impl Decorator<~[u8]> for MemReader { @@ -143,15 +143,15 @@ impl<'self> BufWriter<'self> { } impl<'self> Writer for BufWriter<'self> { - fn write(&mut self, _buf: &[u8]) { fail2!() } + fn write(&mut self, _buf: &[u8]) { fail!() } - fn flush(&mut self) { fail2!() } + fn flush(&mut self) { fail!() } } impl<'self> Seek for BufWriter<'self> { - fn tell(&self) -> u64 { fail2!() } + fn tell(&self) -> u64 { fail!() } - fn seek(&mut self, _pos: i64, _style: SeekStyle) { fail2!() } + fn seek(&mut self, _pos: i64, _style: SeekStyle) { fail!() } } @@ -193,7 +193,7 @@ impl<'self> Reader for BufReader<'self> { impl<'self> Seek for BufReader<'self> { fn tell(&self) -> u64 { self.pos as u64 } - fn seek(&mut self, _pos: i64, _style: SeekStyle) { fail2!() } + fn seek(&mut self, _pos: i64, _style: SeekStyle) { fail!() } } ///Calls a function with a MemWriter and returns diff --git a/src/libstd/rt/io/mod.rs b/src/libstd/rt/io/mod.rs index d505c97ba0f9..c0971b5d3cd5 100644 --- a/src/libstd/rt/io/mod.rs +++ b/src/libstd/rt/io/mod.rs @@ -611,7 +611,7 @@ pub fn standard_error(kind: IoErrorKind) -> IoError { detail: None } } - _ => fail2!() + _ => fail!() } } diff --git a/src/libstd/rt/io/native/file.rs b/src/libstd/rt/io/native/file.rs index dc8d34d1b110..d68209811817 100644 --- a/src/libstd/rt/io/native/file.rs +++ b/src/libstd/rt/io/native/file.rs @@ -241,7 +241,7 @@ mod tests { assert_eq!(buf[2], 's' as u8); assert_eq!(buf[3], 't' as u8); } - r => fail2!("invalid read: {:?}", r) + r => fail!("invalid read: {:?}", r) } let mut raised = false; @@ -276,7 +276,7 @@ mod tests { assert_eq!(buf[2], 's' as u8); assert_eq!(buf[3], 't' as u8); } - r => fail2!("invalid read: {:?}", r) + r => fail!("invalid read: {:?}", r) } } } diff --git a/src/libstd/rt/io/native/process.rs b/src/libstd/rt/io/native/process.rs index 57367beacd83..91fff6d92630 100644 --- a/src/libstd/rt/io/native/process.rs +++ b/src/libstd/rt/io/native/process.rs @@ -124,7 +124,7 @@ impl Process { pub fn input<'a>(&'a mut self) -> &'a mut io::Writer { match self.input { Some(ref mut fd) => fd as &mut io::Writer, - None => fail2!("This process has no stdin") + None => fail!("This process has no stdin") } } @@ -138,7 +138,7 @@ impl Process { pub fn output<'a>(&'a mut self) -> &'a mut io::Reader { match self.input { Some(ref mut fd) => fd as &mut io::Reader, - None => fail2!("This process has no stdout") + None => fail!("This process has no stdout") } } @@ -152,7 +152,7 @@ impl Process { pub fn error<'a>(&'a mut self) -> &'a mut io::Reader { match self.error { Some(ref mut fd) => fd as &mut io::Reader, - None => fail2!("This process has no stderr") + None => fail!("This process has no stderr") } } @@ -283,29 +283,29 @@ fn spawn_process_os(prog: &str, args: &[~str], let orig_std_in = get_osfhandle(in_fd) as HANDLE; if orig_std_in == INVALID_HANDLE_VALUE as HANDLE { - fail2!("failure in get_osfhandle: {}", os::last_os_error()); + fail!("failure in get_osfhandle: {}", os::last_os_error()); } if DuplicateHandle(cur_proc, orig_std_in, cur_proc, &mut si.hStdInput, 0, TRUE, DUPLICATE_SAME_ACCESS) == FALSE { - fail2!("failure in DuplicateHandle: {}", os::last_os_error()); + fail!("failure in DuplicateHandle: {}", os::last_os_error()); } let orig_std_out = get_osfhandle(out_fd) as HANDLE; if orig_std_out == INVALID_HANDLE_VALUE as HANDLE { - fail2!("failure in get_osfhandle: {}", os::last_os_error()); + fail!("failure in get_osfhandle: {}", os::last_os_error()); } if DuplicateHandle(cur_proc, orig_std_out, cur_proc, &mut si.hStdOutput, 0, TRUE, DUPLICATE_SAME_ACCESS) == FALSE { - fail2!("failure in DuplicateHandle: {}", os::last_os_error()); + fail!("failure in DuplicateHandle: {}", os::last_os_error()); } let orig_std_err = get_osfhandle(err_fd) as HANDLE; if orig_std_err == INVALID_HANDLE_VALUE as HANDLE { - fail2!("failure in get_osfhandle: {}", os::last_os_error()); + fail!("failure in get_osfhandle: {}", os::last_os_error()); } if DuplicateHandle(cur_proc, orig_std_err, cur_proc, &mut si.hStdError, 0, TRUE, DUPLICATE_SAME_ACCESS) == FALSE { - fail2!("failure in DuplicateHandle: {}", os::last_os_error()); + fail!("failure in DuplicateHandle: {}", os::last_os_error()); } let cmd = make_command_line(prog, args); @@ -330,7 +330,7 @@ fn spawn_process_os(prog: &str, args: &[~str], CloseHandle(si.hStdError); for msg in create_err.iter() { - fail2!("failure in CreateProcess: {}", *msg); + fail!("failure in CreateProcess: {}", *msg); } // We close the thread handle because we don't care about keeping the @@ -471,7 +471,7 @@ fn spawn_process_os(prog: &str, args: &[~str], let pid = fork(); if pid < 0 { - fail2!("failure in fork: {}", os::last_os_error()); + fail!("failure in fork: {}", os::last_os_error()); } else if pid > 0 { return SpawnProcessResult {pid: pid, handle: ptr::null()}; } @@ -479,13 +479,13 @@ fn spawn_process_os(prog: &str, args: &[~str], rustrt::rust_unset_sigprocmask(); if dup2(in_fd, 0) == -1 { - fail2!("failure in dup2(in_fd, 0): {}", os::last_os_error()); + fail!("failure in dup2(in_fd, 0): {}", os::last_os_error()); } if dup2(out_fd, 1) == -1 { - fail2!("failure in dup2(out_fd, 1): {}", os::last_os_error()); + fail!("failure in dup2(out_fd, 1): {}", os::last_os_error()); } if dup2(err_fd, 2) == -1 { - fail2!("failure in dup3(err_fd, 2): {}", os::last_os_error()); + fail!("failure in dup3(err_fd, 2): {}", os::last_os_error()); } // close all other fds for fd in range(3, getdtablesize()).invert() { @@ -494,7 +494,7 @@ fn spawn_process_os(prog: &str, args: &[~str], do with_dirp(dir) |dirp| { if !dirp.is_null() && chdir(dirp) == -1 { - fail2!("failure in chdir: {}", os::last_os_error()); + fail!("failure in chdir: {}", os::last_os_error()); } } @@ -505,7 +505,7 @@ fn spawn_process_os(prog: &str, args: &[~str], do with_argv(prog, args) |argv| { execvp(*argv, argv); // execvp only returns if an error occurred - fail2!("failure in execvp: {}", os::last_os_error()); + fail!("failure in execvp: {}", os::last_os_error()); } } } @@ -651,14 +651,14 @@ fn waitpid(pid: pid_t) -> int { let proc = OpenProcess(SYNCHRONIZE | PROCESS_QUERY_INFORMATION, FALSE, pid as DWORD); if proc.is_null() { - fail2!("failure in OpenProcess: {}", os::last_os_error()); + fail!("failure in OpenProcess: {}", os::last_os_error()); } loop { let mut status = 0; if GetExitCodeProcess(proc, &mut status) == FALSE { CloseHandle(proc); - fail2!("failure in GetExitCodeProcess: {}", os::last_os_error()); + fail!("failure in GetExitCodeProcess: {}", os::last_os_error()); } if status != STILL_ACTIVE { CloseHandle(proc); @@ -666,7 +666,7 @@ fn waitpid(pid: pid_t) -> int { } if WaitForSingleObject(proc, INFINITE) == WAIT_FAILED { CloseHandle(proc); - fail2!("failure in WaitForSingleObject: {}", os::last_os_error()); + fail!("failure in WaitForSingleObject: {}", os::last_os_error()); } } } @@ -704,7 +704,7 @@ fn waitpid(pid: pid_t) -> int { let mut status = 0 as c_int; if unsafe { waitpid(pid, &mut status, 0) } == -1 { - fail2!("failure in waitpid: {}", os::last_os_error()); + fail!("failure in waitpid: {}", os::last_os_error()); } return if WIFEXITED(status) { diff --git a/src/libstd/rt/io/net/tcp.rs b/src/libstd/rt/io/net/tcp.rs index 3b894b9d3319..f29e17cfc2f3 100644 --- a/src/libstd/rt/io/net/tcp.rs +++ b/src/libstd/rt/io/net/tcp.rs @@ -84,7 +84,7 @@ impl Reader for TcpStream { } } - fn eof(&mut self) -> bool { fail2!() } + fn eof(&mut self) -> bool { fail!() } } impl Writer for TcpStream { @@ -324,7 +324,7 @@ mod test { if cfg!(windows) { assert_eq!(e.kind, NotConnected); } else { - fail2!(); + fail!(); } }).inside { let nread = stream.read(buf); @@ -359,7 +359,7 @@ mod test { if cfg!(windows) { assert_eq!(e.kind, NotConnected); } else { - fail2!(); + fail!(); } }).inside { let nread = stream.read(buf); diff --git a/src/libstd/rt/io/net/udp.rs b/src/libstd/rt/io/net/udp.rs index 2f9babf57896..27faae0838b1 100644 --- a/src/libstd/rt/io/net/udp.rs +++ b/src/libstd/rt/io/net/udp.rs @@ -94,7 +94,7 @@ impl Reader for UdpStream { } } - fn eof(&mut self) -> bool { fail2!() } + fn eof(&mut self) -> bool { fail!() } } impl Writer for UdpStream { @@ -104,7 +104,7 @@ impl Writer for UdpStream { } } - fn flush(&mut self) { fail2!() } + fn flush(&mut self) { fail!() } } #[cfg(test)] @@ -153,10 +153,10 @@ mod test { assert_eq!(buf[0], 99); assert_eq!(src, client_ip); } - None => fail2!() + None => fail!() } } - None => fail2!() + None => fail!() } } @@ -166,7 +166,7 @@ mod test { port.take().recv(); client.sendto([99], server_ip) } - None => fail2!() + None => fail!() } } } @@ -192,10 +192,10 @@ mod test { assert_eq!(buf[0], 99); assert_eq!(src, client_ip); } - None => fail2!() + None => fail!() } } - None => fail2!() + None => fail!() } } @@ -205,7 +205,7 @@ mod test { port.take().recv(); client.sendto([99], server_ip) } - None => fail2!() + None => fail!() } } } @@ -232,10 +232,10 @@ mod test { assert_eq!(nread, 1); assert_eq!(buf[0], 99); } - None => fail2!() + None => fail!() } } - None => fail2!() + None => fail!() } } @@ -247,7 +247,7 @@ mod test { port.take().recv(); stream.write([99]); } - None => fail2!() + None => fail!() } } } @@ -274,10 +274,10 @@ mod test { assert_eq!(nread, 1); assert_eq!(buf[0], 99); } - None => fail2!() + None => fail!() } } - None => fail2!() + None => fail!() } } @@ -289,7 +289,7 @@ mod test { port.take().recv(); stream.write([99]); } - None => fail2!() + None => fail!() } } } diff --git a/src/libstd/rt/io/net/unix.rs b/src/libstd/rt/io/net/unix.rs index 07de33935ee2..1771a963ba78 100644 --- a/src/libstd/rt/io/net/unix.rs +++ b/src/libstd/rt/io/net/unix.rs @@ -16,36 +16,36 @@ pub struct UnixStream; impl UnixStream { pub fn connect(_path: &P) -> Option { - fail2!() + fail!() } } impl Reader for UnixStream { - fn read(&mut self, _buf: &mut [u8]) -> Option { fail2!() } + fn read(&mut self, _buf: &mut [u8]) -> Option { fail!() } - fn eof(&mut self) -> bool { fail2!() } + fn eof(&mut self) -> bool { fail!() } } impl Writer for UnixStream { - fn write(&mut self, _v: &[u8]) { fail2!() } + fn write(&mut self, _v: &[u8]) { fail!() } - fn flush(&mut self) { fail2!() } + fn flush(&mut self) { fail!() } } pub struct UnixListener; impl UnixListener { pub fn bind(_path: &P) -> Option { - fail2!() + fail!() } } impl Listener for UnixListener { - fn listen(self) -> Option { fail2!() } + fn listen(self) -> Option { fail!() } } pub struct UnixAcceptor; impl Acceptor for UnixAcceptor { - fn accept(&mut self) -> Option { fail2!() } + fn accept(&mut self) -> Option { fail!() } } diff --git a/src/libstd/rt/io/pipe.rs b/src/libstd/rt/io/pipe.rs index 251795ab238f..d2cd531ed266 100644 --- a/src/libstd/rt/io/pipe.rs +++ b/src/libstd/rt/io/pipe.rs @@ -64,7 +64,7 @@ impl Reader for PipeStream { } } - fn eof(&mut self) -> bool { fail2!() } + fn eof(&mut self) -> bool { fail!() } } impl Writer for PipeStream { @@ -77,5 +77,5 @@ impl Writer for PipeStream { } } - fn flush(&mut self) { fail2!() } + fn flush(&mut self) { fail!() } } diff --git a/src/libstd/rt/kill.rs b/src/libstd/rt/kill.rs index 6043ae318fec..8029e3f64317 100644 --- a/src/libstd/rt/kill.rs +++ b/src/libstd/rt/kill.rs @@ -403,7 +403,7 @@ impl KillHandle { // FIXME(#7544)(bblum): is it really necessary to prohibit double kill? match inner.unkillable.compare_and_swap(KILL_RUNNING, KILL_UNKILLABLE, Relaxed) { KILL_RUNNING => { }, // normal case - KILL_KILLED => if !already_failing { fail2!("{}", KILLED_MSG) }, + KILL_KILLED => if !already_failing { fail!("{}", KILLED_MSG) }, _ => rtabort!("inhibit_kill: task already unkillable"), } } @@ -416,7 +416,7 @@ impl KillHandle { // FIXME(#7544)(bblum): is it really necessary to prohibit double kill? match inner.unkillable.compare_and_swap(KILL_UNKILLABLE, KILL_RUNNING, Relaxed) { KILL_UNKILLABLE => { }, // normal case - KILL_KILLED => if !already_failing { fail2!("{}", KILLED_MSG) }, + KILL_KILLED => if !already_failing { fail!("{}", KILLED_MSG) }, _ => rtabort!("allow_kill: task already killable"), } } @@ -624,7 +624,7 @@ impl Death { // synchronization during unwinding or cleanup (for example, // sending on a notify port). In that case failing won't help. if self.unkillable == 0 && (!already_failing) && kill_handle.killed() { - fail2!("{}", KILLED_MSG); + fail!("{}", KILLED_MSG); }, // This may happen during task death (see comments in collect_failure). None => rtassert!(self.unkillable > 0), @@ -650,7 +650,7 @@ impl Death { if self.unkillable == 0 { // we need to decrement the counter before failing. self.unkillable -= 1; - fail2!("Cannot enter a rekillable() block without a surrounding unkillable()"); + fail!("Cannot enter a rekillable() block without a surrounding unkillable()"); } self.unkillable -= 1; if self.unkillable == 0 { diff --git a/src/libstd/rt/sched.rs b/src/libstd/rt/sched.rs index 93ac308df3a2..336d2518e437 100644 --- a/src/libstd/rt/sched.rs +++ b/src/libstd/rt/sched.rs @@ -1292,12 +1292,12 @@ mod test { while (true) { match p.recv() { (1, end_chan) => { - debug2!("{}\n", id); + debug!("{}\n", id); end_chan.send(()); return; } (token, end_chan) => { - debug2!("thread: {} got token: {}", id, token); + debug!("thread: {} got token: {}", id, token); ch.send((token - 1, end_chan)); if token <= n_tasks { return; diff --git a/src/libstd/rt/task.rs b/src/libstd/rt/task.rs index 28c38ac9b53c..a6f9e11e40e9 100644 --- a/src/libstd/rt/task.rs +++ b/src/libstd/rt/task.rs @@ -626,7 +626,7 @@ mod test { let result = spawntask_try(||()); rtdebug!("trying first assert"); assert!(result.is_ok()); - let result = spawntask_try(|| fail2!()); + let result = spawntask_try(|| fail!()); rtdebug!("trying second assert"); assert!(result.is_err()); } @@ -644,7 +644,7 @@ mod test { #[test] fn logging() { do run_in_newsched_task() { - info2!("here i am. logging in a newsched task"); + info!("here i am. logging in a newsched task"); } } @@ -686,7 +686,7 @@ mod test { fn linked_failure() { do run_in_newsched_task() { let res = do spawntask_try { - spawntask_random(|| fail2!()); + spawntask_random(|| fail!()); }; assert!(res.is_err()); } diff --git a/src/libstd/rt/test.rs b/src/libstd/rt/test.rs index 9f4e6558ac59..4f7ebb4a7219 100644 --- a/src/libstd/rt/test.rs +++ b/src/libstd/rt/test.rs @@ -115,7 +115,7 @@ mod darwin_fd_limit { to_mut_unsafe_ptr(&mut size), mut_null(), 0) != 0 { let err = last_os_error(); - error2!("raise_fd_limit: error calling sysctl: {}", err); + error!("raise_fd_limit: error calling sysctl: {}", err); return; } @@ -123,7 +123,7 @@ mod darwin_fd_limit { let mut rlim = rlimit{rlim_cur: 0, rlim_max: 0}; if getrlimit(RLIMIT_NOFILE, to_mut_unsafe_ptr(&mut rlim)) != 0 { let err = last_os_error(); - error2!("raise_fd_limit: error calling getrlimit: {}", err); + error!("raise_fd_limit: error calling getrlimit: {}", err); return; } @@ -133,7 +133,7 @@ mod darwin_fd_limit { // Set our newly-increased resource limit if setrlimit(RLIMIT_NOFILE, to_unsafe_ptr(&rlim)) != 0 { let err = last_os_error(); - error2!("raise_fd_limit: error calling setrlimit: {}", err); + error!("raise_fd_limit: error calling setrlimit: {}", err); return; } } diff --git a/src/libstd/rt/uv/file.rs b/src/libstd/rt/uv/file.rs index cb5054626d4c..3a6d858df791 100644 --- a/src/libstd/rt/uv/file.rs +++ b/src/libstd/rt/uv/file.rs @@ -505,7 +505,7 @@ mod test { let unlink_req = FsRequest::new(); let result = unlink_req.unlink_sync(&loop_, &Path::new(path_str)); assert!(result.is_ok()); - } else { fail2!("nread was 0.. wudn't expectin' that."); } + } else { fail!("nread was 0.. wudn't expectin' that."); } loop_.close(); } } diff --git a/src/libstd/rt/uv/net.rs b/src/libstd/rt/uv/net.rs index 2c27db982aa3..a2608bf6b240 100644 --- a/src/libstd/rt/uv/net.rs +++ b/src/libstd/rt/uv/net.rs @@ -34,7 +34,7 @@ fn sockaddr_to_UvSocketAddr(addr: *uvll::sockaddr) -> UvSocketAddr { match addr { _ if is_ip4_addr(addr) => UvIpv4SocketAddr(addr as *uvll::sockaddr_in), _ if is_ip6_addr(addr) => UvIpv6SocketAddr(addr as *uvll::sockaddr_in6), - _ => fail2!(), + _ => fail!(), } } } diff --git a/src/libstd/run.rs b/src/libstd/run.rs index 0d32efbba883..a40605863182 100644 --- a/src/libstd/run.rs +++ b/src/libstd/run.rs @@ -229,7 +229,7 @@ impl Process { ((1, o), (2, e)) => (e, o), ((2, e), (1, o)) => (e, o), ((x, _), (y, _)) => { - fail2!("unexpected file numbers: {}, {}", x, y); + fail!("unexpected file numbers: {}, {}", x, y); } }; diff --git a/src/libstd/select.rs b/src/libstd/select.rs index 8ce23f4b53b2..62a099847949 100644 --- a/src/libstd/select.rs +++ b/src/libstd/select.rs @@ -35,7 +35,7 @@ pub trait SelectPort : SelectPortInner { } /// port whose data is ready. (If multiple are ready, returns the lowest index.) pub fn select(ports: &mut [A]) -> uint { if ports.is_empty() { - fail2!("can't select on an empty list"); + fail!("can't select on an empty list"); } for (index, port) in ports.mut_iter().enumerate() { @@ -116,7 +116,7 @@ pub fn select2, TB, B: SelectPort>(mut a: A, mut b: B) match result { 0 => Left ((a.recv_ready(), b)), 1 => Right((a, b.recv_ready())), - x => fail2!("impossible case in select2: {:?}", x) + x => fail!("impossible case in select2: {:?}", x) } } @@ -335,7 +335,7 @@ mod test { let _ = dead_cs; } do task::spawn { - fail2!(); // should kill sibling awake + fail!(); // should kill sibling awake } // wait for killed selector to close (NOT send on) its c. diff --git a/src/libstd/str.rs b/src/libstd/str.rs index 9d2f60fc27cb..883934124a6c 100644 --- a/src/libstd/str.rs +++ b/src/libstd/str.rs @@ -1229,7 +1229,7 @@ pub mod raw { match ctr { 0 => assert_eq!(x, &~"zero"), 1 => assert_eq!(x, &~"one"), - _ => fail2!("shouldn't happen!") + _ => fail!("shouldn't happen!") } ctr += 1; } @@ -2001,8 +2001,8 @@ impl<'self> StrSlice<'self> for &'self str { if end_byte.is_none() && count == end { end_byte = Some(self.len()) } match (begin_byte, end_byte) { - (None, _) => fail2!("slice_chars: `begin` is beyond end of string"), - (_, None) => fail2!("slice_chars: `end` is beyond end of string"), + (None, _) => fail!("slice_chars: `begin` is beyond end of string"), + (_, None) => fail!("slice_chars: `end` is beyond end of string"), (Some(a), Some(b)) => unsafe { raw::slice_bytes(*self, a, b) } } } @@ -3246,7 +3246,7 @@ mod tests { // original problem code path anymore.) let s = ~""; let _bytes = s.as_bytes(); - fail2!(); + fail!(); } #[test] @@ -3304,8 +3304,8 @@ mod tests { while i < n1 { let a: u8 = s1[i]; let b: u8 = s2[i]; - debug2!("{}", a); - debug2!("{}", b); + debug!("{}", a); + debug!("{}", b); assert_eq!(a, b); i += 1u; } diff --git a/src/libstd/task/mod.rs b/src/libstd/task/mod.rs index 51b1ab603ed5..970a62b676fc 100644 --- a/src/libstd/task/mod.rs +++ b/src/libstd/task/mod.rs @@ -192,7 +192,7 @@ pub fn task() -> TaskBuilder { impl TaskBuilder { fn consume(&mut self) -> TaskBuilder { if self.consumed { - fail2!("Cannot copy a task_builder"); // Fake move mode on self + fail!("Cannot copy a task_builder"); // Fake move mode on self } self.consumed = true; let gen_body = self.gen_body.take(); @@ -280,7 +280,7 @@ impl TaskBuilder { // sending out messages. if self.opts.notify_chan.is_some() { - fail2!("Can't set multiple future_results for one task!"); + fail!("Can't set multiple future_results for one task!"); } // Construct the future and give it to the caller. @@ -540,7 +540,7 @@ pub fn with_task_name(blk: &fn(Option<&str>) -> U) -> U { } } } else { - fail2!("no task name exists in non-green task context") + fail!("no task name exists in non-green task context") } } @@ -648,7 +648,7 @@ fn test_kill_unkillable_task() { do run_in_newsched_task { do task::try { do task::spawn { - fail2!(); + fail!(); } do task::unkillable { } }; @@ -667,7 +667,7 @@ fn test_kill_rekillable_task() { do task::unkillable { do task::rekillable { do task::spawn { - fail2!(); + fail!(); } } } @@ -697,7 +697,7 @@ fn test_rekillable_nested_failure() { do unkillable { do rekillable { let (port,chan) = comm::stream(); - do task::spawn { chan.send(()); fail2!(); } + do task::spawn { chan.send(()); fail!(); } port.recv(); // wait for child to exist port.recv(); // block forever, expect to get killed. } @@ -741,7 +741,7 @@ fn test_spawn_unlinked_unsup_no_fail_down() { // grandchild sends on a port do 16.times { task::deschedule(); } ch.send(()); // If killed first, grandparent hangs. } - fail2!(); // Shouldn't kill either (grand)parent or (grand)child. + fail!(); // Shouldn't kill either (grand)parent or (grand)child. } po.recv(); } @@ -751,7 +751,7 @@ fn test_spawn_unlinked_unsup_no_fail_down() { // grandchild sends on a port fn test_spawn_unlinked_unsup_no_fail_up() { // child unlinked fails use rt::test::run_in_newsched_task; do run_in_newsched_task { - do spawn_unlinked { fail2!(); } + do spawn_unlinked { fail!(); } } } #[ignore(reason = "linked failure")] @@ -759,7 +759,7 @@ fn test_spawn_unlinked_unsup_no_fail_up() { // child unlinked fails fn test_spawn_unlinked_sup_no_fail_up() { // child unlinked fails use rt::test::run_in_newsched_task; do run_in_newsched_task { - do spawn_supervised { fail2!(); } + do spawn_supervised { fail!(); } // Give child a chance to fail-but-not-kill-us. do 16.times { task::deschedule(); } } @@ -771,7 +771,7 @@ fn test_spawn_unlinked_sup_fail_down() { do run_in_newsched_task { let result: Result<(),()> = do try { do spawn_supervised { block_forever(); } - fail2!(); // Shouldn't leave a child hanging around. + fail!(); // Shouldn't leave a child hanging around. }; assert!(result.is_err()); } @@ -791,7 +791,7 @@ fn test_spawn_linked_sup_fail_up() { // child fails; parent fails b0.opts.supervised = true; do b0.spawn { - fail2!(); + fail!(); } block_forever(); // We should get punted awake }; @@ -810,7 +810,7 @@ fn test_spawn_linked_sup_fail_down() { // parent fails; child fails b0.opts.linked = true; b0.opts.supervised = true; do b0.spawn { block_forever(); } - fail2!(); // *both* mechanisms would be wrong if this didn't kill the child + fail!(); // *both* mechanisms would be wrong if this didn't kill the child }; assert!(result.is_err()); } @@ -822,7 +822,7 @@ fn test_spawn_linked_unsup_fail_up() { // child fails; parent fails do run_in_newsched_task { let result: Result<(),()> = do try { // Default options are to spawn linked & unsupervised. - do spawn { fail2!(); } + do spawn { fail!(); } block_forever(); // We should get punted awake }; assert!(result.is_err()); @@ -836,7 +836,7 @@ fn test_spawn_linked_unsup_fail_down() { // parent fails; child fails let result: Result<(),()> = do try { // Default options are to spawn linked & unsupervised. do spawn { block_forever(); } - fail2!(); + fail!(); }; assert!(result.is_err()); } @@ -851,7 +851,7 @@ fn test_spawn_linked_unsup_default_opts() { // parent fails; child fails let mut builder = task(); builder.linked(); do builder.spawn { block_forever(); } - fail2!(); + fail!(); }; assert!(result.is_err()); } @@ -871,7 +871,7 @@ fn test_spawn_failure_propagate_grandchild() { do spawn_supervised { block_forever(); } } do 16.times { task::deschedule(); } - fail2!(); + fail!(); }; assert!(result.is_err()); } @@ -888,7 +888,7 @@ fn test_spawn_failure_propagate_secondborn() { do spawn { block_forever(); } // linked } do 16.times { task::deschedule(); } - fail2!(); + fail!(); }; assert!(result.is_err()); } @@ -905,7 +905,7 @@ fn test_spawn_failure_propagate_nephew_or_niece() { do spawn_supervised { block_forever(); } } do 16.times { task::deschedule(); } - fail2!(); + fail!(); }; assert!(result.is_err()); } @@ -922,7 +922,7 @@ fn test_spawn_linked_sup_propagate_sibling() { do spawn { block_forever(); } // linked } do 16.times { task::deschedule(); } - fail2!(); + fail!(); }; assert!(result.is_err()); } @@ -1030,7 +1030,7 @@ fn test_future_result() { let result = builder.future_result(); builder.unlinked(); do builder.spawn { - fail2!(); + fail!(); } assert_eq!(result.recv(), Failure); } @@ -1048,17 +1048,17 @@ fn test_try_success() { ~"Success!" } { result::Ok(~"Success!") => (), - _ => fail2!() + _ => fail!() } } #[test] fn test_try_fail() { match do try { - fail2!() + fail!() } { result::Err(()) => (), - result::Ok(()) => fail2!() + result::Ok(()) => fail!() } } @@ -1248,7 +1248,7 @@ fn test_unkillable() { deschedule(); // We want to fail after the unkillable task // blocks on recv - fail2!(); + fail!(); } unsafe { @@ -1283,7 +1283,7 @@ fn test_unkillable_nested() { deschedule(); // We want to fail after the unkillable task // blocks on recv - fail2!(); + fail!(); } unsafe { @@ -1348,7 +1348,7 @@ fn test_spawn_watched() { t.watched(); do t.spawn { task::deschedule(); - fail2!(); + fail!(); } } }; @@ -1384,7 +1384,7 @@ fn test_indestructible() { do t.spawn { p3.recv(); task::deschedule(); - fail2!(); + fail!(); } c3.send(()); p2.recv(); diff --git a/src/libstd/task/spawn.rs b/src/libstd/task/spawn.rs index 611d2f1fdb67..7cf0f04c7e9f 100644 --- a/src/libstd/task/spawn.rs +++ b/src/libstd/task/spawn.rs @@ -631,7 +631,7 @@ pub fn spawn_raw(mut opts: TaskOpts, f: ~fn()) { let (thread_port, thread_chan) = oneshot(); let thread_port_cell = Cell::new(thread_port); let join_task = do Task::build_child(None) { - debug2!("running join task"); + debug!("running join task"); let thread_port = thread_port_cell.take(); let thread: Thread = thread_port.recv(); thread.join(); @@ -648,11 +648,11 @@ pub fn spawn_raw(mut opts: TaskOpts, f: ~fn()) { let join_task = join_task_cell.take(); let bootstrap_task = ~do Task::new_root(&mut new_sched.stack_pool, None) || { - debug2!("boostrapping a 1:1 scheduler"); + debug!("boostrapping a 1:1 scheduler"); }; new_sched.bootstrap(bootstrap_task); - debug2!("enqueing join_task"); + debug!("enqueing join_task"); // Now tell the original scheduler to join with this thread // by scheduling a thread-joining task on the original scheduler orig_sched_handle.send_task_from_friend(join_task); @@ -684,7 +684,7 @@ pub fn spawn_raw(mut opts: TaskOpts, f: ~fn()) { } task.name = opts.name.take(); - debug2!("spawn calling run_task"); + debug!("spawn calling run_task"); Scheduler::run_task(task); } @@ -707,7 +707,7 @@ fn test_spawn_raw_unsupervise() { .. default_task_opts() }; do spawn_raw(opts) { - fail2!(); + fail!(); } } @@ -736,7 +736,7 @@ fn test_spawn_raw_notify_failure() { .. default_task_opts() }; do spawn_raw(opts) { - fail2!(); + fail!(); } assert_eq!(notify_po.recv(), Failure); } diff --git a/src/libstd/trie.rs b/src/libstd/trie.rs index b42d3c904d74..c561fb6cc8a4 100644 --- a/src/libstd/trie.rs +++ b/src/libstd/trie.rs @@ -422,7 +422,7 @@ fn remove(count: &mut uint, child: &mut Child, key: uint, External(stored, _) if stored == key => { match replace(child, Nothing) { External(_, value) => (Some(value), true), - _ => fail2!() + _ => fail!() } } External(*) => (None, false), @@ -531,7 +531,7 @@ mod test_map { assert!(m.insert(5, 14)); let new = 100; match m.find_mut(&5) { - None => fail2!(), Some(x) => *x = new + None => fail!(), Some(x) => *x = new } assert_eq!(m.find(&5), Some(&new)); } diff --git a/src/libstd/unstable/dynamic_lib.rs b/src/libstd/unstable/dynamic_lib.rs index 58ff51fe102b..d3d768bc0c6f 100644 --- a/src/libstd/unstable/dynamic_lib.rs +++ b/src/libstd/unstable/dynamic_lib.rs @@ -33,7 +33,7 @@ impl Drop for DynamicLibrary { } } { Ok(()) => {}, - Err(str) => fail2!("{}", str) + Err(str) => fail!("{}", str) } } } @@ -94,13 +94,13 @@ mod test { // The math library does not need to be loaded since it is already // statically linked in let libm = match DynamicLibrary::open(None) { - Err(error) => fail2!("Could not load self as module: {}", error), + Err(error) => fail!("Could not load self as module: {}", error), Ok(libm) => libm }; let cosine: extern fn(libc::c_double) -> libc::c_double = unsafe { match libm.symbol("cos") { - Err(error) => fail2!("Could not load function cos: {}", error), + Err(error) => fail!("Could not load function cos: {}", error), Ok(cosine) => cosine } }; @@ -109,7 +109,7 @@ mod test { let expected_result = 1.0; let result = cosine(argument); if result != expected_result { - fail2!("cos({:?}) != {:?} but equaled {:?} instead", argument, + fail!("cos({:?}) != {:?} but equaled {:?} instead", argument, expected_result, result) } } @@ -124,7 +124,7 @@ mod test { let path = GenericPath::new("/dev/null"); match DynamicLibrary::open(Some(&path)) { Err(_) => {} - Ok(_) => fail2!("Successfully opened the empty library.") + Ok(_) => fail!("Successfully opened the empty library.") } } } diff --git a/src/libstd/unstable/finally.rs b/src/libstd/unstable/finally.rs index 9fe3435c21ba..c1365a44bc91 100644 --- a/src/libstd/unstable/finally.rs +++ b/src/libstd/unstable/finally.rs @@ -87,7 +87,7 @@ fn test_fail() { let mut i = 0; do (|| { i = 10; - fail2!(); + fail!(); }).finally { assert!(failing()); assert_eq!(i, 10); diff --git a/src/libstd/unstable/sync.rs b/src/libstd/unstable/sync.rs index cf6bf839ccc0..4c6ad469d8cb 100644 --- a/src/libstd/unstable/sync.rs +++ b/src/libstd/unstable/sync.rs @@ -172,7 +172,7 @@ impl UnsafeArc { // If 'put' returns the server end back to us, we were rejected; // someone else was trying to unwrap. Avoid guaranteed deadlock. cast::forget(data); - fail2!("Another task is already unwrapping this Arc!"); + fail!("Another task is already unwrapping this Arc!"); } } } @@ -386,7 +386,7 @@ impl Exclusive { let rec = self.x.get(); do (*rec).lock.lock { if (*rec).failed { - fail2!("Poisoned Exclusive::new - another task failed inside!"); + fail!("Poisoned Exclusive::new - another task failed inside!"); } (*rec).failed = true; let result = f(&mut (*rec).data); @@ -617,7 +617,7 @@ mod tests { let x2 = x.clone(); do task::spawn { do 10.times { task::deschedule(); } // try to let the unwrapper go - fail2!(); // punt it awake from its deadlock + fail!(); // punt it awake from its deadlock } let _z = x.unwrap(); unsafe { do x2.with |_hello| { } } diff --git a/src/libstd/vec.rs b/src/libstd/vec.rs index d298507aa8cb..b10d0ded5b47 100644 --- a/src/libstd/vec.rs +++ b/src/libstd/vec.rs @@ -1063,7 +1063,7 @@ impl<'self,T> ImmutableVector<'self, T> for &'self [T] { #[inline] fn head(&self) -> &'self T { - if self.len() == 0 { fail2!("head: empty vector") } + if self.len() == 0 { fail!("head: empty vector") } &self[0] } @@ -1090,7 +1090,7 @@ impl<'self,T> ImmutableVector<'self, T> for &'self [T] { #[inline] fn last(&self) -> &'self T { - if self.len() == 0 { fail2!("last: empty vector") } + if self.len() == 0 { fail!("last: empty vector") } &self[self.len() - 1] } @@ -1409,7 +1409,7 @@ impl OwnedVector for ~[T] { let alloc = n * mem::nonzero_size_of::(); let size = alloc + mem::size_of::>(); if alloc / mem::nonzero_size_of::() != n || size < alloc { - fail2!("vector size is too large: {}", n); + fail!("vector size is too large: {}", n); } *ptr = realloc_raw(*ptr as *mut c_void, size) as *mut Vec<()>; @@ -1428,7 +1428,7 @@ impl OwnedVector for ~[T] { fn reserve_additional(&mut self, n: uint) { if self.capacity() - self.len() < n { match self.len().checked_add(&n) { - None => fail2!("vec::reserve_additional: `uint` overflow"), + None => fail!("vec::reserve_additional: `uint` overflow"), Some(new_cap) => self.reserve_at_least(new_cap) } } @@ -1622,7 +1622,7 @@ impl OwnedVector for ~[T] { fn swap_remove(&mut self, index: uint) -> T { let ln = self.len(); if index >= ln { - fail2!("vec::swap_remove - index {} >= length {}", index, ln); + fail!("vec::swap_remove - index {} >= length {}", index, ln); } if index < ln - 1 { self.swap(index, ln - 1); @@ -2997,7 +2997,7 @@ mod tests { 3 => assert_eq!(v, [2, 3, 1]), 4 => assert_eq!(v, [2, 1, 3]), 5 => assert_eq!(v, [1, 2, 3]), - _ => fail2!(), + _ => fail!(), } } } @@ -3244,7 +3244,7 @@ mod tests { #[should_fail] fn test_from_fn_fail() { do from_fn(100) |v| { - if v == 50 { fail2!() } + if v == 50 { fail!() } (~0, @0) }; } @@ -3263,7 +3263,7 @@ mod tests { fn clone(&self) -> S { let s = unsafe { cast::transmute_mut(self) }; s.f += 1; - if s.f == 10 { fail2!() } + if s.f == 10 { fail!() } S { f: s.f, boxes: s.boxes.clone() } } } @@ -3280,7 +3280,7 @@ mod tests { push((~0, @0)); push((~0, @0)); push((~0, @0)); - fail2!(); + fail!(); }; } @@ -3290,7 +3290,7 @@ mod tests { let mut v = ~[]; do v.grow_fn(100) |i| { if i == 50 { - fail2!() + fail!() } (~0, @0) } @@ -3303,7 +3303,7 @@ mod tests { let mut i = 0; do v.map |_elt| { if i == 2 { - fail2!() + fail!() } i += 1; ~[(~0, @0)] @@ -3317,7 +3317,7 @@ mod tests { let mut i = 0; do flat_map(v) |_elt| { if i == 2 { - fail2!() + fail!() } i += 1; ~[(~0, @0)] @@ -3331,7 +3331,7 @@ mod tests { let mut i = 0; for _ in v.permutations_iter() { if i == 2 { - fail2!() + fail!() } i += 1; } @@ -3342,7 +3342,7 @@ mod tests { fn test_as_imm_buf_fail() { let v = [(~0, @0), (~0, @0), (~0, @0), (~0, @0)]; do v.as_imm_buf |_buf, _i| { - fail2!() + fail!() } } @@ -3351,7 +3351,7 @@ mod tests { fn test_as_mut_buf_fail() { let mut v = [(~0, @0), (~0, @0), (~0, @0), (~0, @0)]; do v.as_mut_buf |_buf, _i| { - fail2!() + fail!() } } @@ -3816,7 +3816,7 @@ mod bench { sum += *x; } // sum == 11806, to stop dead code elimination. - if sum == 0 {fail2!()} + if sum == 0 {fail!()} } } diff --git a/src/libsyntax/abi.rs b/src/libsyntax/abi.rs index 4875ef6d3caa..ed20b160eb4d 100644 --- a/src/libsyntax/abi.rs +++ b/src/libsyntax/abi.rs @@ -221,7 +221,7 @@ impl AbiSet { let data = abi.data(); for other_abi in abis.slice(0, i).iter() { let other_data = other_abi.data(); - debug2!("abis=({:?},{:?}) datas=({:?},{:?})", + debug!("abis=({:?},{:?}) datas=({:?},{:?})", abi, data.abi_arch, other_abi, other_data.abi_arch); match (&data.abi_arch, &other_data.abi_arch) { @@ -306,7 +306,7 @@ fn cannot_combine(n: Abi, m: Abi) { (m == a && n == b)); } None => { - fail2!("Invalid match not detected"); + fail!("Invalid match not detected"); } } } @@ -318,7 +318,7 @@ fn can_combine(n: Abi, m: Abi) { set.add(m); match set.check_valid() { Some((_, _)) => { - fail2!("Valid match declared invalid"); + fail!("Valid match declared invalid"); } None => {} } @@ -367,7 +367,7 @@ fn abi_to_str_c_aaps() { let mut set = AbiSet::empty(); set.add(Aapcs); set.add(C); - debug2!("set = {}", set.to_str()); + debug!("set = {}", set.to_str()); assert!(set.to_str() == ~"\"aapcs C\""); } @@ -375,7 +375,7 @@ fn abi_to_str_c_aaps() { fn abi_to_str_rust() { let mut set = AbiSet::empty(); set.add(Rust); - debug2!("set = {}", set.to_str()); + debug!("set = {}", set.to_str()); assert!(set.to_str() == ~"\"Rust\""); } diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index 34b359ef3db8..01033e829f6a 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -47,7 +47,7 @@ impl Eq for Ident { // if it should be non-hygienic (most things are), just compare the // 'name' fields of the idents. Or, even better, replace the idents // with Name's. - fail2!("not allowed to compare these idents: {:?}, {:?}. + fail!("not allowed to compare these idents: {:?}, {:?}. Probably related to issue \\#6993", self, other); } } diff --git a/src/libsyntax/ast_map.rs b/src/libsyntax/ast_map.rs index 83205ccc9818..17613d19c7ef 100644 --- a/src/libsyntax/ast_map.rs +++ b/src/libsyntax/ast_map.rs @@ -185,7 +185,7 @@ impl Ctx { item, p)); } - _ => fail2!("struct def parent wasn't an item") + _ => fail!("struct def parent wasn't an item") } } } @@ -485,6 +485,6 @@ pub fn node_item_query(items: map, id: NodeId, error_msg: ~str) -> Result { match items.find(&id) { Some(&node_item(it, _)) => query(it), - _ => fail2!("{}", error_msg) + _ => fail!("{}", error_msg) } } diff --git a/src/libsyntax/ast_util.rs b/src/libsyntax/ast_util.rs index 7295081afba2..bdebc9872e69 100644 --- a/src/libsyntax/ast_util.rs +++ b/src/libsyntax/ast_util.rs @@ -45,7 +45,7 @@ pub fn stmt_id(s: &Stmt) -> NodeId { StmtDecl(_, id) => id, StmtExpr(_, id) => id, StmtSemi(_, id) => id, - StmtMac(*) => fail2!("attempted to analyze unexpanded stmt") + StmtMac(*) => fail!("attempted to analyze unexpanded stmt") } } @@ -72,7 +72,7 @@ pub fn def_id_of_def(d: Def) -> DefId { local_def(id) } - DefPrimTy(_) => fail2!() + DefPrimTy(_) => fail!() } } @@ -735,7 +735,7 @@ pub fn new_mark_internal(m:Mrk, tail:SyntaxContext,table:&mut SCTable) } true => { match table.mark_memo.find(&key) { - None => fail2!("internal error: key disappeared 2013042901"), + None => fail!("internal error: key disappeared 2013042901"), Some(idxptr) => {*idxptr} } } @@ -762,7 +762,7 @@ pub fn new_rename_internal(id:Ident, to:Name, tail:SyntaxContext, table: &mut SC } true => { match table.rename_memo.find(&key) { - None => fail2!("internal error: key disappeared 2013042902"), + None => fail!("internal error: key disappeared 2013042902"), Some(idxptr) => {*idxptr} } } @@ -795,9 +795,9 @@ pub fn get_sctable() -> @mut SCTable { /// print out an SCTable for debugging pub fn display_sctable(table : &SCTable) { - error2!("SC table:"); + error!("SC table:"); for (idx,val) in table.table.iter().enumerate() { - error2!("{:4u} : {:?}",idx,val); + error!("{:4u} : {:?}",idx,val); } } @@ -859,7 +859,7 @@ pub fn resolve_internal(id : Ident, resolvedthis } } - IllegalCtxt() => fail2!("expected resolvable context, got IllegalCtxt") + IllegalCtxt() => fail!("expected resolvable context, got IllegalCtxt") } }; resolve_table.insert(key,resolved); @@ -900,7 +900,7 @@ pub fn marksof(ctxt: SyntaxContext, stopname: Name, table: &SCTable) -> ~[Mrk] { loopvar = tl; } } - IllegalCtxt => fail2!("expected resolvable context, got IllegalCtxt") + IllegalCtxt => fail!("expected resolvable context, got IllegalCtxt") } } } @@ -911,7 +911,7 @@ pub fn mtwt_outer_mark(ctxt: SyntaxContext) -> Mrk { let sctable = get_sctable(); match sctable.table[ctxt] { ast::Mark(mrk,_) => mrk, - _ => fail2!("can't retrieve outer mark when outside is not a mark") + _ => fail!("can't retrieve outer mark when outside is not a mark") } } @@ -1043,7 +1043,7 @@ mod test { sc = tail; continue; } - IllegalCtxt => fail2!("expected resolvable context, got IllegalCtxt") + IllegalCtxt => fail!("expected resolvable context, got IllegalCtxt") } } } diff --git a/src/libsyntax/attr.rs b/src/libsyntax/attr.rs index 47b31a4f76d5..40b7ff29e241 100644 --- a/src/libsyntax/attr.rs +++ b/src/libsyntax/attr.rs @@ -168,17 +168,17 @@ pub fn mk_sugared_doc_attr(text: @str, lo: BytePos, hi: BytePos) -> Attribute { /// span included in the `==` comparison a plain MetaItem. pub fn contains(haystack: &[@ast::MetaItem], needle: @ast::MetaItem) -> bool { - debug2!("attr::contains (name={})", needle.name()); + debug!("attr::contains (name={})", needle.name()); do haystack.iter().any |item| { - debug2!(" testing: {}", item.name()); + debug!(" testing: {}", item.name()); item.node == needle.node } } pub fn contains_name(metas: &[AM], name: &str) -> bool { - debug2!("attr::contains_name (name={})", name); + debug!("attr::contains_name (name={})", name); do metas.iter().any |item| { - debug2!(" testing: {}", item.name()); + debug!(" testing: {}", item.name()); name == item.name() } } @@ -279,23 +279,23 @@ pub fn test_cfg> // this would be much nicer as a chain of iterator adaptors, but // this doesn't work. let some_cfg_matches = do metas.any |mi| { - debug2!("testing name: {}", mi.name()); + debug!("testing name: {}", mi.name()); if "cfg" == mi.name() { // it is a #[cfg()] attribute - debug2!("is cfg"); + debug!("is cfg"); no_cfgs = false; // only #[cfg(...)] ones are understood. match mi.meta_item_list() { Some(cfg_meta) => { - debug2!("is cfg(...)"); + debug!("is cfg(...)"); do cfg_meta.iter().all |cfg_mi| { - debug2!("cfg({}[...])", cfg_mi.name()); + debug!("cfg({}[...])", cfg_mi.name()); match cfg_mi.node { ast::MetaList(s, ref not_cfgs) if "not" == s => { - debug2!("not!"); + debug!("not!"); // inside #[cfg(not(...))], so these need to all // not match. not_cfgs.iter().all(|mi| { - debug2!("cfg(not({}[...]))", mi.name()); + debug!("cfg(not({}[...]))", mi.name()); !contains(cfg, *mi) }) } @@ -309,7 +309,7 @@ pub fn test_cfg> false } }; - debug2!("test_cfg (no_cfgs={}, some_cfg_matches={})", no_cfgs, some_cfg_matches); + debug!("test_cfg (no_cfgs={}, some_cfg_matches={})", no_cfgs, some_cfg_matches); no_cfgs || some_cfg_matches } diff --git a/src/libsyntax/codemap.rs b/src/libsyntax/codemap.rs index de8f45c880d2..5e4355161f40 100644 --- a/src/libsyntax/codemap.rs +++ b/src/libsyntax/codemap.rs @@ -374,7 +374,7 @@ impl CodeMap { for fm in self.files.iter() { if filename == fm.name { return *fm; } } //XXjdm the following triggers a mismatched type bug // (or expected function, found _|_) - fail2!(); // ("asking for " + filename + " which we don't know about"); + fail!(); // ("asking for " + filename + " which we don't know about"); } } @@ -393,7 +393,7 @@ impl CodeMap { } } if (a >= len) { - fail2!("position {} does not resolve to a source location", pos.to_uint()) + fail!("position {} does not resolve to a source location", pos.to_uint()) } return a; @@ -419,11 +419,11 @@ impl CodeMap { let chpos = self.bytepos_to_local_charpos(pos); let linebpos = f.lines[a]; let linechpos = self.bytepos_to_local_charpos(linebpos); - debug2!("codemap: byte pos {:?} is on the line at byte pos {:?}", + debug!("codemap: byte pos {:?} is on the line at byte pos {:?}", pos, linebpos); - debug2!("codemap: char pos {:?} is on the line at char pos {:?}", + debug!("codemap: char pos {:?} is on the line at char pos {:?}", chpos, linechpos); - debug2!("codemap: byte is on line: {:?}", line); + debug!("codemap: byte is on line: {:?}", line); assert!(chpos >= linechpos); return Loc { file: f, @@ -450,7 +450,7 @@ impl CodeMap { // Converts an absolute BytePos to a CharPos relative to the file it is // located in fn bytepos_to_local_charpos(&self, bpos: BytePos) -> CharPos { - debug2!("codemap: converting {:?} to char pos", bpos); + debug!("codemap: converting {:?} to char pos", bpos); let idx = self.lookup_filemap_idx(bpos); let map = self.files[idx]; @@ -458,7 +458,7 @@ impl CodeMap { let mut total_extra_bytes = 0; for mbc in map.multibyte_chars.iter() { - debug2!("codemap: {:?}-byte char at {:?}", mbc.bytes, mbc.pos); + debug!("codemap: {:?}-byte char at {:?}", mbc.bytes, mbc.pos); if mbc.pos < bpos { total_extra_bytes += mbc.bytes; // We should never see a byte position in the middle of a diff --git a/src/libsyntax/diagnostic.rs b/src/libsyntax/diagnostic.rs index 7f659a765ad2..bbbaf2a2f604 100644 --- a/src/libsyntax/diagnostic.rs +++ b/src/libsyntax/diagnostic.rs @@ -72,7 +72,7 @@ struct CodemapT { impl span_handler for CodemapT { fn span_fatal(@mut self, sp: Span, msg: &str) -> ! { self.handler.emit(Some((self.cm, sp)), msg, fatal); - fail2!(); + fail!(); } fn span_err(@mut self, sp: Span, msg: &str) { self.handler.emit(Some((self.cm, sp)), msg, error); @@ -98,7 +98,7 @@ impl span_handler for CodemapT { impl handler for HandlerT { fn fatal(@mut self, msg: &str) -> ! { self.emit.emit(None, msg, fatal); - fail2!(); + fail!(); } fn err(@mut self, msg: &str) { self.emit.emit(None, msg, error); diff --git a/src/libsyntax/ext/base.rs b/src/libsyntax/ext/base.rs index 78c4d6b6f4b3..1f9fe28a46d5 100644 --- a/src/libsyntax/ext/base.rs +++ b/src/libsyntax/ext/base.rs @@ -540,11 +540,11 @@ impl MapChain{ // names? I think not. // delaying implementing this.... pub fn each_key (&self, _f: &fn (&K)->bool) { - fail2!("unimplemented 2013-02-15T10:01"); + fail!("unimplemented 2013-02-15T10:01"); } pub fn each_value (&self, _f: &fn (&V) -> bool) { - fail2!("unimplemented 2013-02-15T10:02"); + fail!("unimplemented 2013-02-15T10:02"); } // Returns a copy of the value that the name maps to. @@ -587,7 +587,7 @@ impl MapChain{ if satisfies_pred(map,&n,pred) { map.insert(key,ext); } else { - fail2!("expected map chain containing satisfying frame") + fail!("expected map chain containing satisfying frame") } }, ConsMapChain (~ref mut map, rest) => { diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs index 620594a0a171..1018e79aabc6 100644 --- a/src/libsyntax/ext/expand.rs +++ b/src/libsyntax/ext/expand.rs @@ -429,7 +429,7 @@ fn insert_macro(exts: SyntaxEnv, name: ast::Name, transformer: @Transformer) { match t { &@BlockInfo(BlockInfo {macros_escape:false,_}) => true, &@BlockInfo(BlockInfo {_}) => false, - _ => fail2!("special identifier {:?} was bound to a non-BlockInfo", + _ => fail!("special identifier {:?} was bound to a non-BlockInfo", special_block_name) } }; @@ -741,7 +741,7 @@ pub fn expand_block_elts(exts: SyntaxEnv, b: &Block, fld: &MacroExpander) fn mustbesome(val : Option) -> T { match val { Some(v) => v, - None => fail2!("rename_fold returned None") + None => fail!("rename_fold returned None") } } @@ -749,7 +749,7 @@ fn mustbesome(val : Option) -> T { fn get_block_info(exts : SyntaxEnv) -> BlockInfo { match exts.find_in_topmost_frame(&intern(special_block_name)) { Some(@BlockInfo(bi)) => bi, - _ => fail2!("special identifier {:?} was bound to a non-BlockInfo", + _ => fail!("special identifier {:?} was bound to a non-BlockInfo", @" block") } } @@ -782,7 +782,7 @@ pub fn renames_to_fold(renames: @mut ~[(ast::Ident,ast::Name)]) -> @ast_fold { fn apply_pending_renames(folder : @ast_fold, stmt : ast::Stmt) -> @ast::Stmt { match folder.fold_stmt(&stmt) { Some(s) => s, - None => fail2!("renaming of stmt produced None") + None => fail!("renaming of stmt produced None") } } @@ -838,14 +838,6 @@ pub fn std_macros() -> @str { ) ) - // NOTE (acrichto): remove these after the next snapshot - macro_rules! log2( ($($arg:tt)*) => (log!($($arg)*)) ) - macro_rules! error2( ($($arg:tt)*) => (error!($($arg)*)) ) - macro_rules! warn2 ( ($($arg:tt)*) => (warn!($($arg)*)) ) - macro_rules! info2 ( ($($arg:tt)*) => (info!($($arg)*)) ) - macro_rules! debug2( ($($arg:tt)*) => (debug!($($arg)*)) ) - macro_rules! fail2( ($($arg:tt)*) => (fail!($($arg)*)) ) - macro_rules! assert( ($cond:expr) => { if !$cond { @@ -873,7 +865,7 @@ pub fn std_macros() -> @str { // check both directions of equality.... if !((*given_val == *expected_val) && (*expected_val == *given_val)) { - fail2!(\"assertion failed: `(left == right) && (right == \ + fail!(\"assertion failed: `(left == right) && (right == \ left)` (left: `{:?}`, right: `{:?}`)\", *given_val, *expected_val); } @@ -893,7 +885,7 @@ pub fn std_macros() -> @str { given_val.approx_eq(&expected_val) && expected_val.approx_eq(&given_val) ) { - fail2!(\"left: {:?} does not approximately equal right: {:?}\", + fail!(\"left: {:?} does not approximately equal right: {:?}\", given_val, expected_val); } } @@ -910,7 +902,7 @@ pub fn std_macros() -> @str { given_val.approx_eq_eps(&expected_val, &epsilon_val) && expected_val.approx_eq_eps(&given_val, &epsilon_val) ) { - fail2!(\"left: {:?} does not approximately equal right: \ + fail!(\"left: {:?} does not approximately equal right: \ {:?} with epsilon: {:?}\", given_val, expected_val, epsilon_val); } @@ -945,7 +937,7 @@ pub fn std_macros() -> @str { */ macro_rules! unreachable (() => ( - fail2!(\"internal error: entered unreachable code\"); + fail!(\"internal error: entered unreachable code\"); )) macro_rules! condition ( @@ -1123,7 +1115,7 @@ pub fn inject_std_macros(parse_sess: @mut parse::ParseSess, ~[], parse_sess) { Some(item) => item, - None => fail2!("expected core macros to parse correctly") + None => fail!("expected core macros to parse correctly") }; let injector = @Injector { @@ -1381,16 +1373,16 @@ mod test { use util::parser_testing::{string_to_pat, string_to_tts, strs_to_idents}; use visit; - // make sure that fail2! is present + // make sure that fail! is present #[test] fn fail_exists_test () { - let src = @"fn main() { fail2!(\"something appropriately gloomy\");}"; + let src = @"fn main() { fail!(\"something appropriately gloomy\");}"; let sess = parse::new_parse_sess(None); let crate_ast = parse::parse_crate_from_source_str( @"", src, ~[],sess); let crate_ast = inject_std_macros(sess, ~[], crate_ast); - // don't bother with striping, doesn't affect fail2!. + // don't bother with striping, doesn't affect fail!. expand_crate(sess,~[],crate_ast); } @@ -1448,7 +1440,7 @@ mod test { cfg,~[],sess); match item_ast { Some(_) => (), // success - None => fail2!("expected this to parse") + None => fail!("expected this to parse") } } @@ -1487,7 +1479,7 @@ mod test { let marked_once_ctxt = match marked_once[0] { ast::tt_tok(_,token::IDENT(id,_)) => id.ctxt, - _ => fail2!(format!("unexpected shape for marked tts: {:?}",marked_once[0])) + _ => fail!(format!("unexpected shape for marked tts: {:?}",marked_once[0])) }; assert_eq!(mtwt_marksof(marked_once_ctxt,invalid_name),~[fm]); let remarked = mtwt_cancel_outer_mark(marked_once,marked_once_ctxt); @@ -1495,7 +1487,7 @@ mod test { match remarked[0] { ast::tt_tok(_,token::IDENT(id,_)) => assert_eq!(mtwt_marksof(id.ctxt,invalid_name),~[]), - _ => fail2!(format!("unexpected shape for marked tts: {:?}",remarked[0])) + _ => fail!(format!("unexpected shape for marked tts: {:?}",remarked[0])) } } @@ -1700,7 +1692,7 @@ foo_module!() bindings.iter().filter(|b|{@"xx" == (ident_to_str(*b))}).collect(); let cxbind = match cxbinds { [b] => b, - _ => fail2!("expected just one binding for ext_cx") + _ => fail!("expected just one binding for ext_cx") }; let resolved_binding = mtwt_resolve(*cxbind); // find all the xx varrefs: diff --git a/src/libsyntax/ext/quote.rs b/src/libsyntax/ext/quote.rs index 4bef96018552..d10ec4229874 100644 --- a/src/libsyntax/ext/quote.rs +++ b/src/libsyntax/ext/quote.rs @@ -255,8 +255,8 @@ pub mod rt { match res { Some(ast) => ast, None => { - error2!("Parse error with ```\n{}\n```", s); - fail2!() + error!("Parse error with ```\n{}\n```", s); + fail!() } } } @@ -490,7 +490,7 @@ fn mk_token(cx: @ExtCtxt, sp: Span, tok: &token::Token) -> @ast::Expr { ~[mk_ident(cx, sp, ident)]); } - INTERPOLATED(_) => fail2!("quote! with interpolated token"), + INTERPOLATED(_) => fail!("quote! with interpolated token"), _ => () } @@ -528,7 +528,7 @@ fn mk_token(cx: @ExtCtxt, sp: Span, tok: &token::Token) -> @ast::Expr { DOLLAR => "DOLLAR", UNDERSCORE => "UNDERSCORE", EOF => "EOF", - _ => fail2!() + _ => fail!() }; cx.expr_ident(sp, id_ext(name)) } @@ -553,7 +553,7 @@ fn mk_tt(cx: @ExtCtxt, sp: Span, tt: &ast::token_tree) } ast::tt_delim(ref tts) => mk_tts(cx, sp, **tts), - ast::tt_seq(*) => fail2!("tt_seq in quote!"), + ast::tt_seq(*) => fail!("tt_seq in quote!"), ast::tt_nonterminal(sp, ident) => { diff --git a/src/libsyntax/ext/tt/macro_parser.rs b/src/libsyntax/ext/tt/macro_parser.rs index 7db64feb8098..50688afc56a5 100644 --- a/src/libsyntax/ext/tt/macro_parser.rs +++ b/src/libsyntax/ext/tt/macro_parser.rs @@ -122,7 +122,7 @@ pub struct MatcherPos { pub fn copy_up(mpu: &matcher_pos_up) -> ~MatcherPos { match *mpu { matcher_pos_up(Some(ref mp)) => (*mp).clone(), - _ => fail2!() + _ => fail!() } } @@ -387,7 +387,7 @@ pub fn parse( format!("{} ('{}')", ident_to_str(name), ident_to_str(bind)) } - _ => fail2!() + _ => fail!() } }).connect(" or "); return error(sp, format!( "Local ambiguity: multiple parsing options: \ @@ -412,7 +412,7 @@ pub fn parse( parse_nt(&rust_parser, ident_to_str(name)))); ei.idx += 1u; } - _ => fail2!() + _ => fail!() } cur_eis.push(ei); diff --git a/src/libsyntax/fold.rs b/src/libsyntax/fold.rs index 84ff98b0188c..37bc00d5827b 100644 --- a/src/libsyntax/fold.rs +++ b/src/libsyntax/fold.rs @@ -891,7 +891,7 @@ mod test { let a_val = $a; let b_val = $b; if !(pred_val(a_val,b_val)) { - fail2!("expected args satisfying {}, got {:?} and {:?}", + fail!("expected args satisfying {}, got {:?} and {:?}", $predname, a_val, b_val); } } diff --git a/src/libsyntax/opt_vec.rs b/src/libsyntax/opt_vec.rs index ca93cbaea39e..2000d0b97461 100644 --- a/src/libsyntax/opt_vec.rs +++ b/src/libsyntax/opt_vec.rs @@ -66,7 +66,7 @@ impl OptVec { pub fn get<'a>(&'a self, i: uint) -> &'a T { match *self { - Empty => fail2!("Invalid index {}", i), + Empty => fail!("Invalid index {}", i), Vec(ref v) => &v[i] } } diff --git a/src/libsyntax/parse/attr.rs b/src/libsyntax/parse/attr.rs index dba2f0b94171..a8132860b9b4 100644 --- a/src/libsyntax/parse/attr.rs +++ b/src/libsyntax/parse/attr.rs @@ -32,7 +32,7 @@ impl parser_attr for Parser { fn parse_outer_attributes(&self) -> ~[ast::Attribute] { let mut attrs: ~[ast::Attribute] = ~[]; loop { - debug2!("parse_outer_attributes: self.token={:?}", + debug!("parse_outer_attributes: self.token={:?}", self.token); match *self.token { token::INTERPOLATED(token::nt_attr(*)) => { @@ -67,7 +67,7 @@ impl parser_attr for Parser { // if permit_inner is true, then a trailing `;` indicates an inner // attribute fn parse_attribute(&self, permit_inner: bool) -> ast::Attribute { - debug2!("parse_attributes: permit_inner={:?} self.token={:?}", + debug!("parse_attributes: permit_inner={:?} self.token={:?}", permit_inner, self.token); let (span, value) = match *self.token { INTERPOLATED(token::nt_attr(attr)) => { diff --git a/src/libsyntax/parse/comments.rs b/src/libsyntax/parse/comments.rs index f163bec7d4ee..38921648a2bc 100644 --- a/src/libsyntax/parse/comments.rs +++ b/src/libsyntax/parse/comments.rs @@ -134,7 +134,7 @@ pub fn strip_doc_comment_decoration(comment: &str) -> ~str { return lines.connect("\n"); } - fail2!("not a doc-comment: {}", comment); + fail!("not a doc-comment: {}", comment); } fn read_to_eol(rdr: @mut StringReader) -> ~str { @@ -161,7 +161,7 @@ fn consume_non_eol_whitespace(rdr: @mut StringReader) { } fn push_blank_line_comment(rdr: @mut StringReader, comments: &mut ~[cmnt]) { - debug2!(">>> blank-line comment"); + debug!(">>> blank-line comment"); let v: ~[~str] = ~[]; comments.push(cmnt {style: blank_line, lines: v, pos: rdr.last_pos}); } @@ -179,9 +179,9 @@ fn consume_whitespace_counting_blank_lines(rdr: @mut StringReader, fn read_shebang_comment(rdr: @mut StringReader, code_to_the_left: bool, comments: &mut ~[cmnt]) { - debug2!(">>> shebang comment"); + debug!(">>> shebang comment"); let p = rdr.last_pos; - debug2!("<<< shebang comment"); + debug!("<<< shebang comment"); comments.push(cmnt { style: if code_to_the_left { trailing } else { isolated }, lines: ~[read_one_line_comment(rdr)], @@ -191,19 +191,19 @@ fn read_shebang_comment(rdr: @mut StringReader, code_to_the_left: bool, fn read_line_comments(rdr: @mut StringReader, code_to_the_left: bool, comments: &mut ~[cmnt]) { - debug2!(">>> line comments"); + debug!(">>> line comments"); let p = rdr.last_pos; let mut lines: ~[~str] = ~[]; while rdr.curr == '/' && nextch(rdr) == '/' { let line = read_one_line_comment(rdr); - debug2!("{}", line); + debug!("{}", line); if is_doc_comment(line) { // doc-comments are not put in comments break; } lines.push(line); consume_non_eol_whitespace(rdr); } - debug2!("<<< line comments"); + debug!("<<< line comments"); if !lines.is_empty() { comments.push(cmnt { style: if code_to_the_left { trailing } else { isolated }, @@ -242,14 +242,14 @@ fn trim_whitespace_prefix_and_push_line(lines: &mut ~[~str], } None => s, }; - debug2!("pushing line: {}", s1); + debug!("pushing line: {}", s1); lines.push(s1); } fn read_block_comment(rdr: @mut StringReader, code_to_the_left: bool, comments: &mut ~[cmnt]) { - debug2!(">>> block comment"); + debug!(">>> block comment"); let p = rdr.last_pos; let mut lines: ~[~str] = ~[]; let col: CharPos = rdr.col; @@ -275,7 +275,7 @@ fn read_block_comment(rdr: @mut StringReader, } else { let mut level: int = 1; while level > 0 { - debug2!("=== block comment level {}", level); + debug!("=== block comment level {}", level); if is_eof(rdr) { (rdr as @mut reader).fatal(~"unterminated block comment"); } @@ -311,7 +311,7 @@ fn read_block_comment(rdr: @mut StringReader, if !is_eof(rdr) && rdr.curr != '\n' && lines.len() == 1u { style = mixed; } - debug2!("<<< block comment"); + debug!("<<< block comment"); comments.push(cmnt {style: style, lines: lines, pos: p}); } @@ -324,15 +324,15 @@ fn peeking_at_comment(rdr: @mut StringReader) -> bool { fn consume_comment(rdr: @mut StringReader, code_to_the_left: bool, comments: &mut ~[cmnt]) { - debug2!(">>> consume comment"); + debug!(">>> consume comment"); if rdr.curr == '/' && nextch(rdr) == '/' { read_line_comments(rdr, code_to_the_left, comments); } else if rdr.curr == '/' && nextch(rdr) == '*' { read_block_comment(rdr, code_to_the_left, comments); } else if rdr.curr == '#' && nextch(rdr) == '!' { read_shebang_comment(rdr, code_to_the_left, comments); - } else { fail2!(); } - debug2!("<<< consume comment"); + } else { fail!(); } + debug!("<<< consume comment"); } #[deriving(Clone)] @@ -378,11 +378,11 @@ pub fn gather_comments_and_literals(span_diagnostic: let TokenAndSpan {tok: tok, sp: sp} = rdr.peek(); if token::is_lit(&tok) { do with_str_from(rdr, bstart) |s| { - debug2!("tok lit: {}", s); + debug!("tok lit: {}", s); literals.push(lit {lit: s.to_owned(), pos: sp.lo}); } } else { - debug2!("tok: {}", token::to_str(get_ident_interner(), &tok)); + debug!("tok: {}", token::to_str(get_ident_interner(), &tok)); } first_read = false; } diff --git a/src/libsyntax/parse/lexer.rs b/src/libsyntax/parse/lexer.rs index 8edc171fcaca..7ac999c46a40 100644 --- a/src/libsyntax/parse/lexer.rs +++ b/src/libsyntax/parse/lexer.rs @@ -133,7 +133,7 @@ impl reader for TtReader { fn is_eof(@mut self) -> bool { self.cur_tok == token::EOF } fn next_token(@mut self) -> TokenAndSpan { let r = tt_next_token(self); - debug2!("TtReader: r={:?}", r); + debug!("TtReader: r={:?}", r); return r; } fn fatal(@mut self, m: ~str) -> ! { @@ -273,7 +273,7 @@ fn hex_digit_val(c: char) -> int { if in_range(c, '0', '9') { return (c as int) - ('0' as int); } if in_range(c, 'a', 'f') { return (c as int) - ('a' as int) + 10; } if in_range(c, 'A', 'F') { return (c as int) - ('A' as int) + 10; } - fail2!(); + fail!(); } fn bin_digit_value(c: char) -> int { if c == '0' { return 0; } return 1; } @@ -576,7 +576,7 @@ fn scan_number(c: char, rdr: @mut StringReader) -> token::Token { ~"int literal is too large") }; - debug2!("lexing {} as an unsuffixed integer literal", num_str); + debug!("lexing {} as an unsuffixed integer literal", num_str); return token::LIT_INT_UNSUFFIXED(parsed as i64); } } diff --git a/src/libsyntax/parse/mod.rs b/src/libsyntax/parse/mod.rs index 05998d802139..c9405d72464b 100644 --- a/src/libsyntax/parse/mod.rs +++ b/src/libsyntax/parse/mod.rs @@ -417,18 +417,18 @@ mod test { _ => assert_eq!("wrong 4","correct") }, _ => { - error2!("failing value 3: {:?}",first_set); + error!("failing value 3: {:?}",first_set); assert_eq!("wrong 3","correct") } }, _ => { - error2!("failing value 2: {:?}",delim_elts); + error!("failing value 2: {:?}",delim_elts); assert_eq!("wrong","correct"); } }, _ => { - error2!("failing value: {:?}",tts); + error!("failing value: {:?}",tts); assert_eq!("wrong 1","correct"); } } diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index c776e5bfd38f..ed6019e1a55a 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -448,7 +448,7 @@ impl Parser { // followed by some token from the set edible + inedible. Recover // from anticipated input errors, discarding erroneous characters. pub fn commit_expr(&self, e: @Expr, edible: &[token::Token], inedible: &[token::Token]) { - debug2!("commit_expr {:?}", e); + debug!("commit_expr {:?}", e); match e.node { ExprPath(*) => { // might be unit-struct construction; check for recoverableinput error. @@ -468,7 +468,7 @@ impl Parser { // followed by some token from the set edible + inedible. Check // for recoverable input errors, discarding erroneous characters. pub fn commit_stmt(&self, s: @Stmt, edible: &[token::Token], inedible: &[token::Token]) { - debug2!("commit_stmt {:?}", s); + debug!("commit_stmt {:?}", s); let _s = s; // unused, but future checks might want to inspect `s`. if self.last_token.as_ref().map_default(false, |t| is_ident_or_path(*t)) { let expected = vec::append(edible.to_owned(), inedible); @@ -933,13 +933,13 @@ impl Parser { }; let hi = p.last_span.hi; - debug2!("parse_trait_methods(): trait method signature ends in \ + debug!("parse_trait_methods(): trait method signature ends in \ `{}`", self.this_token_to_str()); match *p.token { token::SEMI => { p.bump(); - debug2!("parse_trait_methods(): parsing required method"); + debug!("parse_trait_methods(): parsing required method"); // NB: at the moment, visibility annotations on required // methods are ignored; this could change. if vis != ast::inherited { @@ -958,7 +958,7 @@ impl Parser { }) } token::LBRACE => { - debug2!("parse_trait_methods(): parsing provided method"); + debug!("parse_trait_methods(): parsing provided method"); let (inner_attrs, body) = p.parse_inner_attrs_and_block(); let attrs = vec::append(attrs, inner_attrs); @@ -1196,7 +1196,7 @@ impl Parser { _ => 0 }; - debug2!("parser is_named_argument offset:{}", offset); + debug!("parser is_named_argument offset:{}", offset); if offset == 0 { is_plain_ident_or_underscore(&*self.token) @@ -1212,7 +1212,7 @@ impl Parser { pub fn parse_arg_general(&self, require_name: bool) -> arg { let is_mutbl = self.eat_keyword(keywords::Mut); let pat = if require_name || self.is_named_argument() { - debug2!("parse_arg_general parse_pat (require_name:{:?})", + debug!("parse_arg_general parse_pat (require_name:{:?})", require_name); let pat = self.parse_pat(); @@ -1223,7 +1223,7 @@ impl Parser { self.expect(&token::COLON); pat } else { - debug2!("parse_arg_general ident_to_pat"); + debug!("parse_arg_general ident_to_pat"); ast_util::ident_to_pat(ast::DUMMY_NODE_ID, *self.last_span, special_idents::invalid) @@ -2470,7 +2470,7 @@ impl Parser { // There may be other types of expressions that can // represent the callee in `for` and `do` expressions // but they aren't represented by tests - debug2!("sugary call on {:?}", e.node); + debug!("sugary call on {:?}", e.node); self.span_fatal( e.span, format!("`{}` must be followed by a block call", keyword)); @@ -3916,7 +3916,7 @@ impl Parser { attrs = attrs_remaining + attrs; first = false; } - debug2!("parse_mod_items: parse_item_or_view_item(attrs={:?})", + debug!("parse_mod_items: parse_item_or_view_item(attrs={:?})", attrs); match self.parse_item_or_view_item(attrs, true /* macros allowed */) { @@ -4629,7 +4629,7 @@ impl Parser { let first_ident = self.parse_ident(); let mut path = ~[first_ident]; - debug2!("parsed view_path: {}", self.id_to_str(first_ident)); + debug!("parsed view_path: {}", self.id_to_str(first_ident)); match *self.token { token::EQ => { // x = foo::bar @@ -4837,7 +4837,7 @@ impl Parser { break; } iovi_foreign_item(_) => { - fail2!(); + fail!(); } } attrs = self.parse_outer_attributes(); @@ -4860,7 +4860,7 @@ impl Parser { items.push(item) } iovi_foreign_item(_) => { - fail2!(); + fail!(); } } } diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs index eae3e665b580..27747d94b661 100644 --- a/src/libsyntax/parse/token.rs +++ b/src/libsyntax/parse/token.rs @@ -219,8 +219,8 @@ pub fn to_str(input: @ident_interner, t: &Token) -> ~str { nt_block(*) => ~"block", nt_stmt(*) => ~"statement", nt_pat(*) => ~"pattern", - nt_attr(*) => fail2!("should have been handled"), - nt_expr(*) => fail2!("should have been handled above"), + nt_attr(*) => fail!("should have been handled"), + nt_expr(*) => fail!("should have been handled above"), nt_ty(*) => ~"type", nt_ident(*) => ~"identifier", nt_path(*) => ~"path", @@ -275,7 +275,7 @@ pub fn flip_delimiter(t: &token::Token) -> token::Token { RPAREN => LPAREN, RBRACE => LBRACE, RBRACKET => LBRACKET, - _ => fail2!() + _ => fail!() } } diff --git a/src/libsyntax/print/pp.rs b/src/libsyntax/print/pp.rs index 58d73ad687c4..871584003b51 100644 --- a/src/libsyntax/print/pp.rs +++ b/src/libsyntax/print/pp.rs @@ -152,7 +152,7 @@ pub fn mk_printer(out: @io::Writer, linewidth: uint) -> @mut Printer { // Yes 3, it makes the ring buffers big enough to never // fall behind. let n: uint = 3 * linewidth; - debug2!("mk_printer {}", linewidth); + debug!("mk_printer {}", linewidth); let token: ~[token] = vec::from_elem(n, EOF); let size: ~[int] = vec::from_elem(n, 0); let scan_stack: ~[uint] = vec::from_elem(n, 0u); @@ -288,7 +288,7 @@ impl Printer { self.token[self.right] = t; } pub fn pretty_print(&mut self, t: token) { - debug2!("pp ~[{},{}]", self.left, self.right); + debug!("pp ~[{},{}]", self.left, self.right); match t { EOF => { if !self.scan_stack_empty { @@ -305,7 +305,7 @@ impl Printer { self.left = 0u; self.right = 0u; } else { self.advance_right(); } - debug2!("pp BEGIN({})/buffer ~[{},{}]", + debug!("pp BEGIN({})/buffer ~[{},{}]", b.offset, self.left, self.right); self.token[self.right] = t; self.size[self.right] = -self.right_total; @@ -313,10 +313,10 @@ impl Printer { } END => { if self.scan_stack_empty { - debug2!("pp END/print ~[{},{}]", self.left, self.right); + debug!("pp END/print ~[{},{}]", self.left, self.right); self.print(t, 0); } else { - debug2!("pp END/buffer ~[{},{}]", self.left, self.right); + debug!("pp END/buffer ~[{},{}]", self.left, self.right); self.advance_right(); self.token[self.right] = t; self.size[self.right] = -1; @@ -330,7 +330,7 @@ impl Printer { self.left = 0u; self.right = 0u; } else { self.advance_right(); } - debug2!("pp BREAK({})/buffer ~[{},{}]", + debug!("pp BREAK({})/buffer ~[{},{}]", b.offset, self.left, self.right); self.check_stack(0); self.scan_push(self.right); @@ -340,11 +340,11 @@ impl Printer { } STRING(s, len) => { if self.scan_stack_empty { - debug2!("pp STRING('{}')/print ~[{},{}]", + debug!("pp STRING('{}')/print ~[{},{}]", s, self.left, self.right); self.print(t, len); } else { - debug2!("pp STRING('{}')/buffer ~[{},{}]", + debug!("pp STRING('{}')/buffer ~[{},{}]", s, self.left, self.right); self.advance_right(); self.token[self.right] = t; @@ -356,14 +356,14 @@ impl Printer { } } pub fn check_stream(&mut self) { - debug2!("check_stream ~[{}, {}] with left_total={}, right_total={}", + debug!("check_stream ~[{}, {}] with left_total={}, right_total={}", self.left, self.right, self.left_total, self.right_total); if self.right_total - self.left_total > self.space { - debug2!("scan window is {}, longer than space on line ({})", + debug!("scan window is {}, longer than space on line ({})", self.right_total - self.left_total, self.space); if !self.scan_stack_empty { if self.left == self.scan_stack[self.bottom] { - debug2!("setting {} to infinity and popping", self.left); + debug!("setting {} to infinity and popping", self.left); self.size[self.scan_pop_bottom()] = size_infinity; } } @@ -372,7 +372,7 @@ impl Printer { } } pub fn scan_push(&mut self, x: uint) { - debug2!("scan_push {}", x); + debug!("scan_push {}", x); if self.scan_stack_empty { self.scan_stack_empty = false; } else { @@ -408,7 +408,7 @@ impl Printer { assert!((self.right != self.left)); } pub fn advance_left(&mut self, x: token, L: int) { - debug2!("advnce_left ~[{},{}], sizeof({})={}", self.left, self.right, + debug!("advnce_left ~[{},{}], sizeof({})={}", self.left, self.right, self.left, L); if L >= 0 { self.print(x, L); @@ -451,13 +451,13 @@ impl Printer { } } pub fn print_newline(&mut self, amount: int) { - debug2!("NEWLINE {}", amount); + debug!("NEWLINE {}", amount); (*self.out).write_str("\n"); self.pending_indentation = 0; self.indent(amount); } pub fn indent(&mut self, amount: int) { - debug2!("INDENT {}", amount); + debug!("INDENT {}", amount); self.pending_indentation += amount; } pub fn get_top(&mut self) -> print_stack_elt { @@ -480,9 +480,9 @@ impl Printer { (*self.out).write_str(s); } pub fn print(&mut self, x: token, L: int) { - debug2!("print {} {} (remaining line space={})", tok_str(x), L, + debug!("print {} {} (remaining line space={})", tok_str(x), L, self.space); - debug2!("{}", buf_str(self.token.clone(), + debug!("{}", buf_str(self.token.clone(), self.size.clone(), self.left, self.right, @@ -491,13 +491,13 @@ impl Printer { BEGIN(b) => { if L > self.space { let col = self.margin - self.space + b.offset; - debug2!("print BEGIN -> push broken block at col {}", col); + debug!("print BEGIN -> push broken block at col {}", col); self.print_stack.push(print_stack_elt { offset: col, pbreak: broken(b.breaks) }); } else { - debug2!("print BEGIN -> push fitting block"); + debug!("print BEGIN -> push fitting block"); self.print_stack.push(print_stack_elt { offset: 0, pbreak: fits @@ -505,7 +505,7 @@ impl Printer { } } END => { - debug2!("print END -> pop END"); + debug!("print END -> pop END"); let print_stack = &mut *self.print_stack; assert!((print_stack.len() != 0u)); print_stack.pop(); @@ -514,24 +514,24 @@ impl Printer { let top = self.get_top(); match top.pbreak { fits => { - debug2!("print BREAK({}) in fitting block", b.blank_space); + debug!("print BREAK({}) in fitting block", b.blank_space); self.space -= b.blank_space; self.indent(b.blank_space); } broken(consistent) => { - debug2!("print BREAK({}+{}) in consistent block", + debug!("print BREAK({}+{}) in consistent block", top.offset, b.offset); self.print_newline(top.offset + b.offset); self.space = self.margin - (top.offset + b.offset); } broken(inconsistent) => { if L > self.space { - debug2!("print BREAK({}+{}) w/ newline in inconsistent", + debug!("print BREAK({}+{}) w/ newline in inconsistent", top.offset, b.offset); self.print_newline(top.offset + b.offset); self.space = self.margin - (top.offset + b.offset); } else { - debug2!("print BREAK({}) w/o newline in inconsistent", + debug!("print BREAK({}) w/o newline in inconsistent", b.blank_space); self.indent(b.blank_space); self.space -= b.blank_space; @@ -540,7 +540,7 @@ impl Printer { } } STRING(s, len) => { - debug2!("print STRING({})", s); + debug!("print STRING({})", s); assert_eq!(L, len); // assert!(L <= space); self.space -= len; @@ -548,7 +548,7 @@ impl Printer { } EOF => { // EOF should never get here. - fail2!(); + fail!(); } } } diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index 0d442dca9b68..b245bd75ace7 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -453,10 +453,10 @@ pub fn print_type(s: @ps, ty: &ast::Ty) { word(s.s, ")"); } ast::ty_mac(_) => { - fail2!("print_type doesn't know how to print a ty_mac"); + fail!("print_type doesn't know how to print a ty_mac"); } ast::ty_infer => { - fail2!("print_type shouldn't see a ty_infer"); + fail!("print_type shouldn't see a ty_infer"); } } @@ -701,7 +701,7 @@ pub fn print_struct(s: @ps, popen(s); do commasep(s, inconsistent, struct_def.fields) |s, field| { match field.node.kind { - ast::named_field(*) => fail2!("unexpected named field"), + ast::named_field(*) => fail!("unexpected named field"), ast::unnamed_field => { maybe_print_comment(s, field.span.lo); print_type(s, &field.node.ty); @@ -720,7 +720,7 @@ pub fn print_struct(s: @ps, for field in struct_def.fields.iter() { match field.node.kind { - ast::unnamed_field => fail2!("unexpected unnamed field"), + ast::unnamed_field => fail!("unexpected unnamed field"), ast::named_field(ident, visibility) => { hardbreak_if_not_bol(s); maybe_print_comment(s, field.span.lo); @@ -1009,7 +1009,7 @@ pub fn print_if(s: @ps, test: &ast::Expr, blk: &ast::Block, } // BLEAH, constraints would be great here _ => { - fail2!("print_if saw if with weird alternative"); + fail!("print_if saw if with weird alternative"); } } } @@ -1311,7 +1311,7 @@ pub fn print_expr(s: @ps, expr: &ast::Expr) { } end(s); // close enclosing cbox } - None => fail2!() + None => fail!() } } else { // the block will close the pattern's ibox @@ -2304,7 +2304,7 @@ mod test { fn string_check (given : &T, expected: &T) { if !(given == expected) { - fail2!("given {:?}, expected {:?}", given, expected); + fail!("given {:?}, expected {:?}", given, expected); } } diff --git a/src/test/auxiliary/cci_class_4.rs b/src/test/auxiliary/cci_class_4.rs index 78f9d62087ba..98e5c8c2b5bb 100644 --- a/src/test/auxiliary/cci_class_4.rs +++ b/src/test/auxiliary/cci_class_4.rs @@ -21,11 +21,11 @@ pub mod kitties { pub fn eat(&mut self) -> bool { if self.how_hungry > 0 { - error2!("OM NOM NOM"); + error!("OM NOM NOM"); self.how_hungry -= 2; return true; } else { - error2!("Not hungry!"); + error!("Not hungry!"); return false; } } @@ -33,7 +33,7 @@ pub mod kitties { impl cat { pub fn meow(&mut self) { - error2!("Meow"); + error!("Meow"); self.meows += 1u; if self.meows % 5u == 0u { self.how_hungry += 1; diff --git a/src/test/auxiliary/cci_class_cast.rs b/src/test/auxiliary/cci_class_cast.rs index 906928d1b792..8fac4a3f322a 100644 --- a/src/test/auxiliary/cci_class_cast.rs +++ b/src/test/auxiliary/cci_class_cast.rs @@ -21,7 +21,7 @@ pub mod kitty { impl cat { fn meow(&mut self) { - error2!("Meow"); + error!("Meow"); self.meows += 1u; if self.meows % 5u == 0u { self.how_hungry += 1; @@ -35,12 +35,12 @@ pub mod kitty { pub fn eat(&mut self) -> bool { if self.how_hungry > 0 { - error2!("OM NOM NOM"); + error!("OM NOM NOM"); self.how_hungry -= 2; return true; } else { - error2!("Not hungry!"); + error!("Not hungry!"); return false; } } diff --git a/src/test/auxiliary/cci_nested_lib.rs b/src/test/auxiliary/cci_nested_lib.rs index 626947306c72..350bd09826fa 100644 --- a/src/test/auxiliary/cci_nested_lib.rs +++ b/src/test/auxiliary/cci_nested_lib.rs @@ -33,7 +33,7 @@ pub fn alist_get uint { unsafe { - info2!("n = {}", n); + info!("n = {}", n); rustrt::rust_dbg_call(cb, n) } } diff --git a/src/test/auxiliary/issue2378a.rs b/src/test/auxiliary/issue2378a.rs index 20b3a3280ec8..ea14229cc48a 100644 --- a/src/test/auxiliary/issue2378a.rs +++ b/src/test/auxiliary/issue2378a.rs @@ -17,7 +17,7 @@ impl Index for maybe { fn index(&self, _idx: &uint) -> T { match self { &just(ref t) => (*t).clone(), - ¬hing => { fail2!(); } + ¬hing => { fail!(); } } } } diff --git a/src/test/auxiliary/issue_2723_a.rs b/src/test/auxiliary/issue_2723_a.rs index 384f69c736cf..b3fa8e73cc22 100644 --- a/src/test/auxiliary/issue_2723_a.rs +++ b/src/test/auxiliary/issue_2723_a.rs @@ -9,5 +9,5 @@ // except according to those terms. pub unsafe fn f(xs: ~[int]) { - xs.map(|_x| { unsafe fn q() { fail2!(); } }); + xs.map(|_x| { unsafe fn q() { fail!(); } }); } diff --git a/src/test/auxiliary/logging_right_crate.rs b/src/test/auxiliary/logging_right_crate.rs index 84bf6f0240fb..4fc7de9f7d2f 100644 --- a/src/test/auxiliary/logging_right_crate.rs +++ b/src/test/auxiliary/logging_right_crate.rs @@ -9,6 +9,6 @@ // except according to those terms. pub fn foo() { - fn death() -> int { fail2!() } - debug2!("{:?}", (||{ death() })()); + fn death() -> int { fail!() } + debug!("{:?}", (||{ death() })()); } diff --git a/src/test/auxiliary/static-methods-crate.rs b/src/test/auxiliary/static-methods-crate.rs index ef173d52bc4f..6978b9209d8b 100644 --- a/src/test/auxiliary/static-methods-crate.rs +++ b/src/test/auxiliary/static-methods-crate.rs @@ -38,6 +38,6 @@ impl read for bool { pub fn read(s: ~str) -> T { match read::readMaybe(s) { Some(x) => x, - _ => fail2!("read failed!") + _ => fail!("read failed!") } } diff --git a/src/test/bench/core-std.rs b/src/test/bench/core-std.rs index 6ce289620fb7..f549f747ef79 100644 --- a/src/test/bench/core-std.rs +++ b/src/test/bench/core-std.rs @@ -138,7 +138,7 @@ fn is_utf8_ascii() { for _ in range(0u, 20000) { v.push('b' as u8); if !str::is_utf8(v) { - fail2!("is_utf8 failed"); + fail!("is_utf8 failed"); } } } @@ -149,7 +149,7 @@ fn is_utf8_multibyte() { for _ in range(0u, 5000) { v.push_all(s.as_bytes()); if !str::is_utf8(v) { - fail2!("is_utf8 failed"); + fail!("is_utf8 failed"); } } } diff --git a/src/test/bench/core-uint-to-str.rs b/src/test/bench/core-uint-to-str.rs index ef6610cd93a3..aec0bfb1e657 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 i in range(0u, n) { let x = i.to_str(); - info2!("{}", x); + info!("{}", x); } } diff --git a/src/test/bench/msgsend-pipes-shared.rs b/src/test/bench/msgsend-pipes-shared.rs index ff2eb575ec5c..97479fc133a6 100644 --- a/src/test/bench/msgsend-pipes-shared.rs +++ b/src/test/bench/msgsend-pipes-shared.rs @@ -42,7 +42,7 @@ fn server(requests: &Port, responses: &Chan) { match requests.try_recv() { Some(get_count) => { responses.send(count.clone()); } Some(bytes(b)) => { - //error2!("server: received {:?} bytes", b); + //error!("server: received {:?} bytes", b); count += b; } None => { done = true; } @@ -50,7 +50,7 @@ fn server(requests: &Port, responses: &Chan) { } } responses.send(count); - //error2!("server exiting"); + //error!("server exiting"); } fn run(args: &[~str]) { @@ -70,10 +70,10 @@ fn run(args: &[~str]) { worker_results.push(builder.future_result()); do builder.spawn { for _ in range(0u, size / workers) { - //error2!("worker {:?}: sending {:?} bytes", i, num_bytes); + //error!("worker {:?}: sending {:?} bytes", i, num_bytes); to_child.send(bytes(num_bytes)); } - //error2!("worker {:?} exiting", i); + //error!("worker {:?} exiting", i); } } do task::spawn || { @@ -84,7 +84,7 @@ fn run(args: &[~str]) { r.recv(); } - //error2!("sending stop message"); + //error!("sending stop message"); to_child.send(stop); move_out(to_child); let result = from_child.recv(); @@ -107,6 +107,6 @@ fn main() { args.clone() }; - info2!("{:?}", args); + info!("{:?}", args); run(args); } diff --git a/src/test/bench/msgsend-pipes.rs b/src/test/bench/msgsend-pipes.rs index 4ce9fb493eb7..584a8b8befcc 100644 --- a/src/test/bench/msgsend-pipes.rs +++ b/src/test/bench/msgsend-pipes.rs @@ -37,7 +37,7 @@ fn server(requests: &Port, responses: &Chan) { match requests.try_recv() { Some(get_count) => { responses.send(count.clone()); } Some(bytes(b)) => { - //error2!("server: received {:?} bytes", b); + //error!("server: received {:?} bytes", b); count += b; } None => { done = true; } @@ -45,7 +45,7 @@ fn server(requests: &Port, responses: &Chan) { } } responses.send(count); - //error2!("server exiting"); + //error!("server exiting"); } fn run(args: &[~str]) { @@ -64,10 +64,10 @@ fn run(args: &[~str]) { worker_results.push(builder.future_result()); do builder.spawn { for _ in range(0u, size / workers) { - //error2!("worker {:?}: sending {:?} bytes", i, num_bytes); + //error!("worker {:?}: sending {:?} bytes", i, num_bytes); to_child.send(bytes(num_bytes)); } - //error2!("worker {:?} exiting", i); + //error!("worker {:?} exiting", i); }; } do task::spawn || { @@ -78,7 +78,7 @@ fn run(args: &[~str]) { r.recv(); } - //error2!("sending stop message"); + //error!("sending stop message"); to_child.send(stop); move_out(to_child); let result = from_child.recv(); @@ -101,6 +101,6 @@ fn main() { args.clone() }; - info2!("{:?}", args); + info!("{:?}", args); run(args); } diff --git a/src/test/bench/shootout-chameneos-redux.rs b/src/test/bench/shootout-chameneos-redux.rs index 1fa48755663b..96e87788b70d 100644 --- a/src/test/bench/shootout-chameneos-redux.rs +++ b/src/test/bench/shootout-chameneos-redux.rs @@ -66,7 +66,7 @@ fn show_digit(nn: uint) -> ~str { 7 => {~"seven"} 8 => {~"eight"} 9 => {~"nine"} - _ => {fail2!("expected digits from 0 to 9...")} + _ => {fail!("expected digits from 0 to 9...")} } } diff --git a/src/test/bench/shootout-pfib.rs b/src/test/bench/shootout-pfib.rs index b4f6e7e4b710..88b3cfdff429 100644 --- a/src/test/bench/shootout-pfib.rs +++ b/src/test/bench/shootout-pfib.rs @@ -66,7 +66,7 @@ fn parse_opts(argv: ~[~str]) -> Config { Ok(ref m) => { return Config {stress: m.opt_present("stress")} } - Err(_) => { fail2!(); } + Err(_) => { fail!(); } } } @@ -76,7 +76,7 @@ fn stress_task(id: int) { let n = 15; assert_eq!(fib(n), fib(n)); i += 1; - error2!("{}: Completed {} iterations", id, i); + error!("{}: Completed {} iterations", id, i); } } diff --git a/src/test/bench/shootout-threadring.rs b/src/test/bench/shootout-threadring.rs index 0c0c5226dcea..5e0968163064 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 => { - info2!("thread: {} got token: {}", id, token); + info!("thread: {} got token: {}", id, token); ch.send(token - 1); if token <= n_tasks { return; diff --git a/src/test/bench/sudoku.rs b/src/test/bench/sudoku.rs index 91d9c9656af9..a4e32b4c074a 100644 --- a/src/test/bench/sudoku.rs +++ b/src/test/bench/sudoku.rs @@ -79,7 +79,7 @@ impl Sudoku { g[row][col] = from_str::(comps[2]).unwrap() as u8; } else { - fail2!("Invalid sudoku file"); + fail!("Invalid sudoku file"); } } return Sudoku::new(g) @@ -117,7 +117,7 @@ impl Sudoku { ptr = ptr + 1u; } else { // no: redo this field aft recoloring pred; unless there is none - if ptr == 0u { fail2!("No solution found for this sudoku"); } + if ptr == 0u { fail!("No solution found for this sudoku"); } ptr = ptr - 1u; } } diff --git a/src/test/bench/task-perf-alloc-unwind.rs b/src/test/bench/task-perf-alloc-unwind.rs index 639cbd05cbf7..7ee0c3e13ce9 100644 --- a/src/test/bench/task-perf-alloc-unwind.rs +++ b/src/test/bench/task-perf-alloc-unwind.rs @@ -31,11 +31,11 @@ fn main() { fn run(repeat: int, depth: int) { for _ in range(0, repeat) { - info2!("starting {:.4f}", precise_time_s()); + info!("starting {:.4f}", precise_time_s()); do task::try { recurse_or_fail(depth, None) }; - info2!("stopping {:.4f}", precise_time_s()); + info!("stopping {:.4f}", precise_time_s()); } } @@ -68,8 +68,8 @@ fn r(l: @nillist) -> r { fn recurse_or_fail(depth: int, st: Option) { if depth == 0 { - info2!("unwinding {:.4f}", precise_time_s()); - fail2!(); + info!("unwinding {:.4f}", precise_time_s()); + fail!(); } else { let depth = depth - 1; diff --git a/src/test/bench/task-perf-jargon-metal-smoke.rs b/src/test/bench/task-perf-jargon-metal-smoke.rs index ac028686f08e..0827f7d34475 100644 --- a/src/test/bench/task-perf-jargon-metal-smoke.rs +++ b/src/test/bench/task-perf-jargon-metal-smoke.rs @@ -54,6 +54,6 @@ fn main() { let (p,c) = comm::stream(); child_generation(from_str::(args[1]).unwrap(), c); if p.try_recv().is_none() { - fail2!("it happened when we slumbered"); + fail!("it happened when we slumbered"); } } diff --git a/src/test/bench/task-perf-linked-failure.rs b/src/test/bench/task-perf-linked-failure.rs index 3b64cb38c7e2..5484a3965b3a 100644 --- a/src/test/bench/task-perf-linked-failure.rs +++ b/src/test/bench/task-perf-linked-failure.rs @@ -43,13 +43,13 @@ fn grandchild_group(num_tasks: uint) { p.recv(); // block forever } } - error2!("Grandchild group getting started"); + error!("Grandchild group getting started"); for _ in range(0, num_tasks) { // Make sure all above children are fully spawned; i.e., enlisted in // their ancestor groups. po.recv(); } - error2!("Grandchild group ready to go."); + error!("Grandchild group ready to go."); // Master grandchild task exits early. } @@ -58,7 +58,7 @@ fn spawn_supervised_blocking(myname: &str, f: ~fn()) { let res = builder.future_result(); builder.supervised(); builder.spawn(f); - error2!("{} group waiting", myname); + error!("{} group waiting", myname); let x = res.recv(); assert_eq!(x, task::Success); } @@ -84,11 +84,11 @@ fn main() { grandchild_group(num_tasks); } // When grandchild group is ready to go, make the middle group exit. - error2!("Middle group wakes up and exits"); + error!("Middle group wakes up and exits"); } // Grandparent group waits for middle group to be gone, then fails - error2!("Grandparent group wakes up and fails"); - fail2!(); + error!("Grandparent group wakes up and fails"); + fail!(); }; assert!(x.is_err()); } diff --git a/src/test/compile-fail/asm-in-bad-modifier.rs b/src/test/compile-fail/asm-in-bad-modifier.rs index 87d03290b46f..4e934d988019 100644 --- a/src/test/compile-fail/asm-in-bad-modifier.rs +++ b/src/test/compile-fail/asm-in-bad-modifier.rs @@ -11,7 +11,7 @@ // xfail-fast #[feature] doesn't work with check-fast #[feature(asm)]; -fn foo(x: int) { info2!("{}", x); } +fn foo(x: int) { info!("{}", x); } #[cfg(target_arch = "x86")] #[cfg(target_arch = "x86_64")] diff --git a/src/test/compile-fail/asm-out-assign-imm.rs b/src/test/compile-fail/asm-out-assign-imm.rs index 629d8082f444..599ab76e61ce 100644 --- a/src/test/compile-fail/asm-out-assign-imm.rs +++ b/src/test/compile-fail/asm-out-assign-imm.rs @@ -11,7 +11,7 @@ // xfail-fast #[feature] doesn't work with check-fast #[feature(asm)]; -fn foo(x: int) { info2!("{}", x); } +fn foo(x: int) { info!("{}", x); } #[cfg(target_arch = "x86")] #[cfg(target_arch = "x86_64")] diff --git a/src/test/compile-fail/asm-out-no-modifier.rs b/src/test/compile-fail/asm-out-no-modifier.rs index 80237f331bca..b520c27c80ed 100644 --- a/src/test/compile-fail/asm-out-no-modifier.rs +++ b/src/test/compile-fail/asm-out-no-modifier.rs @@ -11,7 +11,7 @@ // xfail-fast #[feature] doesn't work with check-fast #[feature(asm)]; -fn foo(x: int) { info2!("{}", x); } +fn foo(x: int) { info!("{}", x); } #[cfg(target_arch = "x86")] #[cfg(target_arch = "x86_64")] diff --git a/src/test/compile-fail/asm-out-read-uninit.rs b/src/test/compile-fail/asm-out-read-uninit.rs index ce3bbcebec2a..f49624295b1d 100644 --- a/src/test/compile-fail/asm-out-read-uninit.rs +++ b/src/test/compile-fail/asm-out-read-uninit.rs @@ -11,7 +11,7 @@ // xfail-fast #[feature] doesn't work with check-fast #[feature(asm)]; -fn foo(x: int) { info2!("{}", x); } +fn foo(x: int) { info!("{}", x); } #[cfg(target_arch = "x86")] #[cfg(target_arch = "x86_64")] diff --git a/src/test/compile-fail/assign-imm-local-twice.rs b/src/test/compile-fail/assign-imm-local-twice.rs index f60b67cf8420..e11b47a1b582 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 - info2!("v={}", v); + info!("v={}", v); v = 2; //~ ERROR re-assignment of immutable variable - info2!("v={}", v); + info!("v={}", v); } fn main() { diff --git a/src/test/compile-fail/assign-to-method.rs b/src/test/compile-fail/assign-to-method.rs index 32f27f64f54d..f300bd51b24e 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 = || info2!("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/autoderef-full-lval.rs b/src/test/compile-fail/autoderef-full-lval.rs index ae911b541079..b8af09e308b4 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` - info2!("{:?}", 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` - info2!("{:?}", answer); + info!("{:?}", answer); assert_eq!(answer, 42); } diff --git a/src/test/compile-fail/bad-bang-ann.rs b/src/test/compile-fail/bad-bang-ann.rs index a9e9ed64d9a3..2ffb5dd29066 100644 --- a/src/test/compile-fail/bad-bang-ann.rs +++ b/src/test/compile-fail/bad-bang-ann.rs @@ -12,7 +12,7 @@ // Tests that a function with a ! annotation always actually fails fn bad_bang(i: uint) -> ! { - if i < 0u { } else { fail2!(); } + if i < 0u { } else { fail!(); } //~^ ERROR expected `!` but found `()` } diff --git a/src/test/compile-fail/bad-const-type.rs b/src/test/compile-fail/bad-const-type.rs index 095a85ab21e9..08ced2b002da 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() { info2!("{:?}", i); } +fn main() { info!("{:?}", i); } diff --git a/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-1.rs b/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-1.rs index 262248f9dc3b..3d1cca46085d 100644 --- a/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-1.rs +++ b/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-1.rs @@ -12,7 +12,7 @@ struct X { x: () } impl Drop for X { fn drop(&mut self) { - error2!("destructor runs"); + error!("destructor runs"); } } @@ -20,6 +20,6 @@ fn main() { let x = Some(X { x: () }); match x { Some(ref _y @ _z) => { }, //~ ERROR cannot bind by-move and by-ref in the same pattern - None => fail2!() + None => fail!() } } diff --git a/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-2.rs b/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-2.rs index bf665e6fb60b..a1803a621a53 100644 --- a/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-2.rs +++ b/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-2.rs @@ -12,7 +12,7 @@ struct X { x: (), } impl Drop for X { fn drop(&mut self) { - error2!("destructor runs"); + error!("destructor runs"); } } @@ -20,6 +20,6 @@ fn main() { let x = Some((X { x: () }, X { x: () })); match x { Some((ref _y, _z)) => { }, //~ ERROR cannot bind by-move and by-ref in the same pattern - None => fail2!() + None => fail!() } } diff --git a/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-3.rs b/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-3.rs index fcb9dbb300c8..34a9c0b8fc26 100644 --- a/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-3.rs +++ b/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-3.rs @@ -12,7 +12,7 @@ struct X { x: (), } impl Drop for X { fn drop(&mut self) { - error2!("destructor runs"); + error!("destructor runs"); } } @@ -22,6 +22,6 @@ fn main() { let x = some2(X { x: () }, X { x: () }); match x { some2(ref _y, _z) => { }, //~ ERROR cannot bind by-move and by-ref in the same pattern - none2 => fail2!() + none2 => fail!() } } diff --git a/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-4.rs b/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-4.rs index 19076181c512..2aa3379993b7 100644 --- a/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-4.rs +++ b/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-4.rs @@ -12,7 +12,7 @@ struct X { x: (), } impl Drop for X { fn drop(&mut self) { - error2!("destructor runs"); + error!("destructor runs"); } } @@ -20,6 +20,6 @@ fn main() { let x = Some((X { x: () }, X { x: () })); match x { Some((_y, ref _z)) => { }, //~ ERROR cannot bind by-move and by-ref in the same pattern - None => fail2!() + None => fail!() } } diff --git a/src/test/compile-fail/bind-by-move-no-guards.rs b/src/test/compile-fail/bind-by-move-no-guards.rs index 5c0274b03d09..348781d74977 100644 --- a/src/test/compile-fail/bind-by-move-no-guards.rs +++ b/src/test/compile-fail/bind-by-move-no-guards.rs @@ -15,8 +15,8 @@ fn main() { let x = Some(p); c.send(false); match x { - Some(z) if z.recv() => { fail2!() }, //~ ERROR cannot bind by-move into a pattern guard + Some(z) if z.recv() => { fail!() }, //~ ERROR cannot bind by-move into a pattern guard Some(z) => { assert!(!z.recv()); }, - None => fail2!() + None => fail!() } } diff --git a/src/test/compile-fail/bind-by-move-no-sub-bindings.rs b/src/test/compile-fail/bind-by-move-no-sub-bindings.rs index 9b7cc41e5c87..7143ce0252b7 100644 --- a/src/test/compile-fail/bind-by-move-no-sub-bindings.rs +++ b/src/test/compile-fail/bind-by-move-no-sub-bindings.rs @@ -12,7 +12,7 @@ struct X { x: (), } impl Drop for X { fn drop(&mut self) { - error2!("destructor runs"); + error!("destructor runs"); } } @@ -20,6 +20,6 @@ fn main() { let x = Some(X { x: () }); match x { Some(_y @ ref _z) => { }, //~ ERROR cannot bind by-move with sub-bindings - None => fail2!() + None => fail!() } } 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 71a0b8b7a8e8..7637ebdc80dc 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() -> f64 { fn main() { let x = compute1(); - info2!("{:?}", x); + info!("{:?}", x); assert_eq!(x, -4f64); } diff --git a/src/test/compile-fail/block-coerce-no.rs b/src/test/compile-fail/block-coerce-no.rs index 379b71f74117..71afba18bb1f 100644 --- a/src/test/compile-fail/block-coerce-no.rs +++ b/src/test/compile-fail/block-coerce-no.rs @@ -21,6 +21,6 @@ fn coerce(b: &fn()) -> extern fn() { fn main() { let i = 8; - let f = coerce(|| error2!("{:?}", i) ); + let f = coerce(|| error!("{:?}", i) ); f(); } diff --git a/src/test/compile-fail/bogus-tag.rs b/src/test/compile-fail/bogus-tag.rs index c14989fcbbb6..63d12b72cc63 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) => { info2!("rgb"); } - hsl(h, s, l) => { info2!("hsl"); } + rgb(r, g, b) => { info!("rgb"); } + hsl(h, s, l) => { info!("hsl"); } } } diff --git a/src/test/compile-fail/borrowck-anon-fields-variant.rs b/src/test/compile-fail/borrowck-anon-fields-variant.rs index ce3aff59d7a6..da0a9323d2c8 100644 --- a/src/test/compile-fail/borrowck-anon-fields-variant.rs +++ b/src/test/compile-fail/borrowck-anon-fields-variant.rs @@ -10,12 +10,12 @@ fn distinct_variant() { let a = match y { Y(ref mut a, _) => a, - X => fail2!() + X => fail!() }; let b = match y { Y(_, ref mut b) => b, - X => fail2!() + X => fail!() }; *a += 1; @@ -27,12 +27,12 @@ fn same_variant() { let a = match y { Y(ref mut a, _) => a, - X => fail2!() + X => fail!() }; let b = match y { Y(ref mut b, _) => b, //~ ERROR cannot borrow - X => fail2!() + X => fail!() }; *a += 1; diff --git a/src/test/compile-fail/borrowck-assign-comp-idx.rs b/src/test/compile-fail/borrowck-assign-comp-idx.rs index 8c4d681d9835..81e16b6b615e 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 - info2!("{}", *q); + info!("{}", *q); } fn borrow(_x: &[int], _f: &fn()) {} diff --git a/src/test/compile-fail/borrowck-autoref-3261.rs b/src/test/compile-fail/borrowck-autoref-3261.rs index 487a16c1836d..4bbd1b0decf5 100644 --- a/src/test/compile-fail/borrowck-autoref-3261.rs +++ b/src/test/compile-fail/borrowck-autoref-3261.rs @@ -24,7 +24,7 @@ fn main() { x = X(Left((0,0))); //~ ERROR cannot assign to `x` (*f)() }, - _ => fail2!() + _ => fail!() } } } diff --git a/src/test/compile-fail/borrowck-borrow-from-owned-ptr.rs b/src/test/compile-fail/borrowck-borrow-from-owned-ptr.rs index c7cb9ce27f2b..1051c5829ec3 100644 --- a/src/test/compile-fail/borrowck-borrow-from-owned-ptr.rs +++ b/src/test/compile-fail/borrowck-borrow-from-owned-ptr.rs @@ -18,7 +18,7 @@ struct Bar { int2: int, } -fn make_foo() -> ~Foo { fail2!() } +fn make_foo() -> ~Foo { fail!() } fn borrow_same_field_twice_mut_mut() { let mut foo = make_foo(); diff --git a/src/test/compile-fail/borrowck-borrow-from-stack-variable.rs b/src/test/compile-fail/borrowck-borrow-from-stack-variable.rs index d01fd86f2886..cdcf50c906e3 100644 --- a/src/test/compile-fail/borrowck-borrow-from-stack-variable.rs +++ b/src/test/compile-fail/borrowck-borrow-from-stack-variable.rs @@ -18,7 +18,7 @@ struct Bar { int2: int, } -fn make_foo() -> Foo { fail2!() } +fn make_foo() -> Foo { fail!() } fn borrow_same_field_twice_mut_mut() { let mut foo = make_foo(); diff --git a/src/test/compile-fail/borrowck-borrowed-uniq-rvalue-2.rs b/src/test/compile-fail/borrowck-borrowed-uniq-rvalue-2.rs index 918e06fad07d..cc196a6f7cf5 100644 --- a/src/test/compile-fail/borrowck-borrowed-uniq-rvalue-2.rs +++ b/src/test/compile-fail/borrowck-borrowed-uniq-rvalue-2.rs @@ -16,7 +16,7 @@ struct defer<'self> { impl<'self> Drop for defer<'self> { fn drop(&mut self) { unsafe { - error2!("{:?}", self.x); + error!("{:?}", self.x); } } } diff --git a/src/test/compile-fail/borrowck-lend-flow-if.rs b/src/test/compile-fail/borrowck-lend-flow-if.rs index 1058211a6e45..563f63b98be0 100644 --- a/src/test/compile-fail/borrowck-lend-flow-if.rs +++ b/src/test/compile-fail/borrowck-lend-flow-if.rs @@ -16,9 +16,9 @@ fn borrow(_v: &int) {} fn borrow_mut(_v: &mut int) {} -fn cond() -> bool { fail2!() } -fn for_func(_f: &fn() -> bool) { fail2!() } -fn produce() -> T { fail2!(); } +fn cond() -> bool { fail!() } +fn for_func(_f: &fn() -> bool) { fail!() } +fn produce() -> T { fail!(); } fn inc(v: &mut ~int) { *v = ~(**v + 1); diff --git a/src/test/compile-fail/borrowck-lend-flow-loop.rs b/src/test/compile-fail/borrowck-lend-flow-loop.rs index 99112985be67..9286340f6c9f 100644 --- a/src/test/compile-fail/borrowck-lend-flow-loop.rs +++ b/src/test/compile-fail/borrowck-lend-flow-loop.rs @@ -16,8 +16,8 @@ fn borrow(_v: &int) {} fn borrow_mut(_v: &mut int) {} -fn cond() -> bool { fail2!() } -fn produce() -> T { fail2!(); } +fn cond() -> bool { fail!() } +fn produce() -> T { fail!(); } fn inc(v: &mut ~int) { *v = ~(**v + 1); diff --git a/src/test/compile-fail/borrowck-lend-flow-match.rs b/src/test/compile-fail/borrowck-lend-flow-match.rs index b6a30da46f83..d5c5597e57fc 100644 --- a/src/test/compile-fail/borrowck-lend-flow-match.rs +++ b/src/test/compile-fail/borrowck-lend-flow-match.rs @@ -13,7 +13,7 @@ #[allow(unused_variable)]; #[allow(dead_assignment)]; -fn cond() -> bool { fail2!() } +fn cond() -> bool { fail!() } fn link<'a>(v: &'a uint, w: &mut &'a uint) -> bool { *w = v; true } fn separate_arms() { diff --git a/src/test/compile-fail/borrowck-lend-flow.rs b/src/test/compile-fail/borrowck-lend-flow.rs index c51d6117e5ca..ea840a28b4e6 100644 --- a/src/test/compile-fail/borrowck-lend-flow.rs +++ b/src/test/compile-fail/borrowck-lend-flow.rs @@ -16,9 +16,9 @@ fn borrow(_v: &int) {} fn borrow_mut(_v: &mut int) {} -fn cond() -> bool { fail2!() } -fn for_func(_f: &fn() -> bool) { fail2!() } -fn produce() -> T { fail2!(); } +fn cond() -> bool { fail!() } +fn for_func(_f: &fn() -> bool) { fail!() } +fn produce() -> T { fail!(); } fn inc(v: &mut ~int) { *v = ~(**v + 1); 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 32dfa59927f5..0284f234d9a5 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 { - info2!("v={}", *v); + info!("v={}", *v); //~^ ERROR cannot move `v` into closure } let v = ~3; let _w = &v; task::spawn(|| { - info2!("v={}", *v); + info!("v={}", *v); //~^ ERROR cannot move }); } diff --git a/src/test/compile-fail/borrowck-loan-local-as-both-mut-and-imm.rs b/src/test/compile-fail/borrowck-loan-local-as-both-mut-and-imm.rs index 9d9dd5b1ad8b..e2136c82313e 100644 --- a/src/test/compile-fail/borrowck-loan-local-as-both-mut-and-imm.rs +++ b/src/test/compile-fail/borrowck-loan-local-as-both-mut-and-imm.rs @@ -16,7 +16,7 @@ use std::either::{Either, Left, Right}; *x = Right(1.0); *z } - _ => fail2!() + _ => fail!() } } 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 145aaa405a6e..4b6a2eca1af1 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 @@ -23,7 +23,7 @@ pub fn main() { } } let z = tail[0].clone(); - info2!("{:?}", z); + info!("{:?}", z); } _ => { 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 56e047e5bc52..cab2a5565f4e 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; - info2!("{:?}", *y); + info!("{:?}", *y); } diff --git a/src/test/compile-fail/borrowck-ref-into-rvalue.rs b/src/test/compile-fail/borrowck-ref-into-rvalue.rs index bd0b4afe730c..cb56e929754d 100644 --- a/src/test/compile-fail/borrowck-ref-into-rvalue.rs +++ b/src/test/compile-fail/borrowck-ref-into-rvalue.rs @@ -14,7 +14,7 @@ fn main() { Some(ref m) => { //~ ERROR borrowed value does not live long enough msg = m; }, - None => { fail2!() } + None => { fail!() } } println(*msg); } diff --git a/src/test/compile-fail/borrowck-vec-pattern-element-loan.rs b/src/test/compile-fail/borrowck-vec-pattern-element-loan.rs index 53e69fc1611a..ca20d68e4cdc 100644 --- a/src/test/compile-fail/borrowck-vec-pattern-element-loan.rs +++ b/src/test/compile-fail/borrowck-vec-pattern-element-loan.rs @@ -2,7 +2,7 @@ fn a() -> &[int] { let vec = ~[1, 2, 3, 4]; let tail = match vec { [_, ..tail] => tail, //~ ERROR does not live long enough - _ => fail2!("a") + _ => fail!("a") }; tail } @@ -11,7 +11,7 @@ fn b() -> &[int] { let vec = ~[1, 2, 3, 4]; let init = match vec { [..init, _] => init, //~ ERROR does not live long enough - _ => fail2!("b") + _ => fail!("b") }; init } @@ -20,7 +20,7 @@ fn c() -> &[int] { let vec = ~[1, 2, 3, 4]; let slice = match vec { [_, ..slice, _] => slice, //~ ERROR does not live long enough - _ => fail2!("c") + _ => fail!("c") }; slice } diff --git a/src/test/compile-fail/borrowck-vec-pattern-nesting.rs b/src/test/compile-fail/borrowck-vec-pattern-nesting.rs index b31e49bceb50..02ba1b9d2fff 100644 --- a/src/test/compile-fail/borrowck-vec-pattern-nesting.rs +++ b/src/test/compile-fail/borrowck-vec-pattern-nesting.rs @@ -4,7 +4,7 @@ fn a() { [~ref _a] => { vec[0] = ~4; //~ ERROR cannot assign to `(*vec)[]` because it is borrowed } - _ => fail2!("foo") + _ => fail!("foo") } } diff --git a/src/test/compile-fail/borrowck-vec-pattern-tail-element-loan.rs b/src/test/compile-fail/borrowck-vec-pattern-tail-element-loan.rs index e0c2d08e4133..e542238d0356 100644 --- a/src/test/compile-fail/borrowck-vec-pattern-tail-element-loan.rs +++ b/src/test/compile-fail/borrowck-vec-pattern-tail-element-loan.rs @@ -2,7 +2,7 @@ fn a() -> &int { let vec = ~[1, 2, 3, 4]; let tail = match vec { [_a, ..tail] => &tail[0], //~ ERROR borrowed value does not live long enough - _ => fail2!("foo") + _ => fail!("foo") }; tail } diff --git a/src/test/compile-fail/class-cast-to-trait.rs b/src/test/compile-fail/class-cast-to-trait.rs index 6f483b82d818..0d1582bf8571 100644 --- a/src/test/compile-fail/class-cast-to-trait.rs +++ b/src/test/compile-fail/class-cast-to-trait.rs @@ -22,12 +22,12 @@ struct cat { impl cat { pub fn eat(&self) -> bool { if self.how_hungry > 0 { - error2!("OM NOM NOM"); + error!("OM NOM NOM"); self.how_hungry -= 2; return true; } else { - error2!("Not hungry!"); + error!("Not hungry!"); return false; } } @@ -40,7 +40,7 @@ impl noisy for cat { impl cat { fn meow(&self) { - error2!("Meow"); + error!("Meow"); self.meows += 1; if self.meows % 5 == 0 { self.how_hungry += 1; diff --git a/src/test/compile-fail/class-missing-self.rs b/src/test/compile-fail/class-missing-self.rs index 101f96ce0b47..c27c27b5942e 100644 --- a/src/test/compile-fail/class-missing-self.rs +++ b/src/test/compile-fail/class-missing-self.rs @@ -15,7 +15,7 @@ struct cat { impl cat { fn sleep(&self) { loop{} } fn meow(&self) { - error2!("Meow"); + error!("Meow"); meows += 1u; //~ ERROR unresolved name sleep(); //~ ERROR unresolved name } diff --git a/src/test/compile-fail/closure-that-fails.rs b/src/test/compile-fail/closure-that-fails.rs index 6663cff9b563..aad0e8bcbb6d 100644 --- a/src/test/compile-fail/closure-that-fails.rs +++ b/src/test/compile-fail/closure-that-fails.rs @@ -2,6 +2,6 @@ fn foo(f: &fn() -> !) {} fn main() { // Type inference didn't use to be able to handle this: - foo(|| fail2!()); + foo(|| fail!()); foo(|| 22); //~ ERROR mismatched types } diff --git a/src/test/compile-fail/copy-a-resource.rs b/src/test/compile-fail/copy-a-resource.rs index 771f2b2dfb68..7e928e190a32 100644 --- a/src/test/compile-fail/copy-a-resource.rs +++ b/src/test/compile-fail/copy-a-resource.rs @@ -26,5 +26,5 @@ fn main() { let x = foo(10); let _y = x.clone(); //~^ ERROR does not implement any method in scope - error2!("{:?}", x); + error!("{:?}", x); } diff --git a/src/test/compile-fail/deref-non-pointer.rs b/src/test/compile-fail/deref-non-pointer.rs index 86c56f7ae819..7b1b0f6243ac 100644 --- a/src/test/compile-fail/deref-non-pointer.rs +++ b/src/test/compile-fail/deref-non-pointer.rs @@ -10,6 +10,6 @@ fn main() { match *1 { //~ ERROR: cannot be dereferenced - _ => { fail2!(); } + _ => { fail!(); } } } diff --git a/src/test/compile-fail/disallowed-deconstructing-destructing-struct-let.rs b/src/test/compile-fail/disallowed-deconstructing-destructing-struct-let.rs index aac6cd118b20..945c3d629527 100644 --- a/src/test/compile-fail/disallowed-deconstructing-destructing-struct-let.rs +++ b/src/test/compile-fail/disallowed-deconstructing-destructing-struct-let.rs @@ -14,7 +14,7 @@ struct X { impl Drop for X { fn drop(&mut self) { - error2!("value: {}", self.x); + error!("value: {}", self.x); } } @@ -26,5 +26,5 @@ fn unwrap(x: X) -> ~str { fn main() { let x = X { x: ~"hello" }; let y = unwrap(x); - error2!("contents: {}", y); + error!("contents: {}", y); } diff --git a/src/test/compile-fail/disallowed-deconstructing-destructing-struct-match.rs b/src/test/compile-fail/disallowed-deconstructing-destructing-struct-match.rs index e14900c4bb44..0432920c1a6f 100644 --- a/src/test/compile-fail/disallowed-deconstructing-destructing-struct-match.rs +++ b/src/test/compile-fail/disallowed-deconstructing-destructing-struct-match.rs @@ -14,7 +14,7 @@ struct X { impl Drop for X { fn drop(&mut self) { - error2!("value: {}", self.x); + error!("value: {}", self.x); } } @@ -22,7 +22,7 @@ fn main() { let x = X { x: ~"hello" }; match x { - X { x: y } => error2!("contents: {}", y) + X { x: y } => error!("contents: {}", y) //~^ ERROR cannot move out of type `X`, which defines the `Drop` trait } } diff --git a/src/test/compile-fail/does-nothing.rs b/src/test/compile-fail/does-nothing.rs index dc32e8e10226..9d2b68ddb81e 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() { info2!("doing"); this_does_nothing_what_the; info2!("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 3fdd4000b1b9..22762eb4a7eb 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() { info2!("x"); } + fn x() { info!("x"); } pub fn y() { } } diff --git a/src/test/compile-fail/fail-expr.rs b/src/test/compile-fail/fail-expr.rs index 4dce462bd416..98270bdc5838 100644 --- a/src/test/compile-fail/fail-expr.rs +++ b/src/test/compile-fail/fail-expr.rs @@ -10,4 +10,4 @@ // error-pattern:failed to find an implementation of trait std::sys::FailWithCause for int -fn main() { fail2!(5); } +fn main() { fail!(5); } diff --git a/src/test/compile-fail/fail-simple.rs b/src/test/compile-fail/fail-simple.rs index bcede4483c74..7def16770a79 100644 --- a/src/test/compile-fail/fail-simple.rs +++ b/src/test/compile-fail/fail-simple.rs @@ -12,5 +12,5 @@ // error-pattern:unexpected token fn main() { - fail2!(@); + fail!(@); } diff --git a/src/test/compile-fail/fail-type-err.rs b/src/test/compile-fail/fail-type-err.rs index 341f60eeedf8..b6755249bcf9 100644 --- a/src/test/compile-fail/fail-type-err.rs +++ b/src/test/compile-fail/fail-type-err.rs @@ -9,4 +9,4 @@ // except according to those terms. // error-pattern:failed to find an implementation of trait std::sys::FailWithCause for ~[int] -fn main() { fail2!(~[0i]); } +fn main() { fail!(~[0i]); } diff --git a/src/test/compile-fail/if-without-else-result.rs b/src/test/compile-fail/if-without-else-result.rs index c5fb22c68210..dcda6afa6ca1 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 }; - info2!("{:?}", a); + info!("{:?}", a); } diff --git a/src/test/compile-fail/import-glob-0.rs b/src/test/compile-fail/import-glob-0.rs index 233826bcc7d5..124d4631601d 100644 --- a/src/test/compile-fail/import-glob-0.rs +++ b/src/test/compile-fail/import-glob-0.rs @@ -15,10 +15,10 @@ use module_of_many_things::*; mod module_of_many_things { - pub fn f1() { info2!("f1"); } - pub fn f2() { info2!("f2"); } - fn f3() { info2!("f3"); } - pub fn f4() { info2!("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 23b449fe061e..ae5a0f04e2c0 100644 --- a/src/test/compile-fail/import-glob-circular.rs +++ b/src/test/compile-fail/import-glob-circular.rs @@ -14,13 +14,13 @@ mod circ1 { pub use circ2::f2; - pub fn f1() { info2!("f1"); } + pub fn f1() { info!("f1"); } pub fn common() -> uint { return 0u; } } mod circ2 { pub use circ1::f1; - pub fn f2() { info2!("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 129a4aece8f5..5177dc4e4757 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() { info2!("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 8cebbdbc176f..e67a79130b1f 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() { info2!("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 f05a90acc9dd..7a7f4f20aea0 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]) { info2!("foo"); } +fn main(args: ~[str]) { info!("foo"); } diff --git a/src/test/compile-fail/import4.rs b/src/test/compile-fail/import4.rs index bcc93407ec15..087842d78c70 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]) { info2!("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 bf419db39541..e2ca7641500c 100644 --- a/src/test/compile-fail/issue-1448-2.rs +++ b/src/test/compile-fail/issue-1448-2.rs @@ -13,5 +13,5 @@ fn foo(a: uint) -> uint { a } fn main() { - info2!("{:u}", foo(10i)); //~ ERROR mismatched types + info!("{:u}", foo(10i)); //~ ERROR mismatched types } diff --git a/src/test/compile-fail/issue-1476.rs b/src/test/compile-fail/issue-1476.rs index 5e1a69227e57..ed2e75c4fa60 100644 --- a/src/test/compile-fail/issue-1476.rs +++ b/src/test/compile-fail/issue-1476.rs @@ -9,5 +9,5 @@ // except according to those terms. fn main() { - error2!("{:?}", x); //~ ERROR unresolved name `x`. + error!("{:?}", x); //~ ERROR unresolved name `x`. } diff --git a/src/test/compile-fail/issue-2149.rs b/src/test/compile-fail/issue-2149.rs index 1e427ceb4b73..3da01c6fb013 100644 --- a/src/test/compile-fail/issue-2149.rs +++ b/src/test/compile-fail/issue-2149.rs @@ -14,7 +14,7 @@ trait vec_monad { impl vec_monad for ~[A] { fn bind(&self, f: &fn(A) -> ~[B]) { - let mut r = fail2!(); + let mut r = fail!(); for elt in self.iter() { r = r + f(*elt); } //~^ ERROR the type of this value must be known } diff --git a/src/test/compile-fail/issue-2150.rs b/src/test/compile-fail/issue-2150.rs index 1c4df25f353b..64344ab42779 100644 --- a/src/test/compile-fail/issue-2150.rs +++ b/src/test/compile-fail/issue-2150.rs @@ -13,7 +13,7 @@ fn fail_len(v: ~[int]) -> uint { let mut i = 3; - fail2!(); + fail!(); for x in v.iter() { i += 1u; } //~^ ERROR: unreachable statement return i; diff --git a/src/test/compile-fail/issue-2151.rs b/src/test/compile-fail/issue-2151.rs index db02bb5e55b6..5559ba344ed1 100644 --- a/src/test/compile-fail/issue-2151.rs +++ b/src/test/compile-fail/issue-2151.rs @@ -9,6 +9,6 @@ // except according to those terms. fn main() { - let x = fail2!(); + let x = fail!(); x.clone(); //~ ERROR the type of this value must be known in this context } diff --git a/src/test/compile-fail/issue-2281-part1.rs b/src/test/compile-fail/issue-2281-part1.rs index b9b26e12b40f..7896d91443da 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]) { info2!("{:?}", foobar); } +fn main(args: ~[str]) { info!("{:?}", foobar); } diff --git a/src/test/compile-fail/issue-2330.rs b/src/test/compile-fail/issue-2330.rs index c8f835ccdc9a..6152e82294d1 100644 --- a/src/test/compile-fail/issue-2330.rs +++ b/src/test/compile-fail/issue-2330.rs @@ -16,7 +16,7 @@ trait channel { // `chan` is not a trait, it's an enum impl chan for int { //~ ERROR chan is not a trait - fn send(&self, v: int) { fail2!() } + fn send(&self, v: int) { fail!() } } fn main() { diff --git a/src/test/compile-fail/issue-2370-2.rs b/src/test/compile-fail/issue-2370-2.rs index 247ef3d751f4..dc4530d586ea 100644 --- a/src/test/compile-fail/issue-2370-2.rs +++ b/src/test/compile-fail/issue-2370-2.rs @@ -15,5 +15,5 @@ struct cat { fn main() { let kitty : cat = cat { x: () }; - error2!("{:?}", *kitty); + error!("{:?}", *kitty); } diff --git a/src/test/compile-fail/issue-2370.rs b/src/test/compile-fail/issue-2370.rs index 5754b4bb472e..656088a00b7d 100644 --- a/src/test/compile-fail/issue-2370.rs +++ b/src/test/compile-fail/issue-2370.rs @@ -15,5 +15,5 @@ struct cat { fn main() { let nyan = cat { foo: () }; - error2!("{:?}", *nyan); + error!("{:?}", *nyan); } diff --git a/src/test/compile-fail/issue-2611-4.rs b/src/test/compile-fail/issue-2611-4.rs index 77f07a9d793e..c62c28745253 100644 --- a/src/test/compile-fail/issue-2611-4.rs +++ b/src/test/compile-fail/issue-2611-4.rs @@ -20,7 +20,7 @@ struct E { } impl A for E { - fn b(_x: F) -> F { fail2!() } //~ ERROR type parameter 0 requires `Freeze` + fn b(_x: F) -> F { fail!() } //~ ERROR type parameter 0 requires `Freeze` } fn main() {} diff --git a/src/test/compile-fail/issue-2611-5.rs b/src/test/compile-fail/issue-2611-5.rs index 7dc6dd6a8520..9b8346da5c5d 100644 --- a/src/test/compile-fail/issue-2611-5.rs +++ b/src/test/compile-fail/issue-2611-5.rs @@ -21,7 +21,7 @@ struct E { impl A for E { // n.b. The error message is awful -- see #3404 - fn b(&self, _x: G) -> G { fail2!() } //~ ERROR method `b` has an incompatible type + fn b(&self, _x: G) -> G { fail!() } //~ ERROR method `b` has an incompatible type } fn main() {} diff --git a/src/test/compile-fail/issue-2823.rs b/src/test/compile-fail/issue-2823.rs index 49bc3b9ba6c3..790a5fac1830 100644 --- a/src/test/compile-fail/issue-2823.rs +++ b/src/test/compile-fail/issue-2823.rs @@ -14,7 +14,7 @@ struct C { impl Drop for C { fn drop(&mut self) { - error2!("dropping: {:?}", self.x); + error!("dropping: {:?}", self.x); } } diff --git a/src/test/compile-fail/issue-3021.rs b/src/test/compile-fail/issue-3021.rs index f8e355360d70..56ade814db02 100644 --- a/src/test/compile-fail/issue-3021.rs +++ b/src/test/compile-fail/issue-3021.rs @@ -25,7 +25,7 @@ fn siphash(k0 : u64) -> SipHash { //~^ ERROR unresolved name `k0`. } } - fail2!(); + fail!(); } fn main() {} diff --git a/src/test/compile-fail/issue-3038.rs b/src/test/compile-fail/issue-3038.rs index 3ab44b667480..d0c7a07859ea 100644 --- a/src/test/compile-fail/issue-3038.rs +++ b/src/test/compile-fail/issue-3038.rs @@ -19,13 +19,13 @@ fn main() { let _z = match g(1, 2) { - g(x, x) => { info2!("{:?}", x + x); } + g(x, x) => { info!("{:?}", x + x); } //~^ ERROR Identifier `x` is bound more than once in the same pattern }; let _z = match i(l(1, 2), m(3, 4)) { i(l(x, _), m(_, x)) //~ ERROR Identifier `x` is bound more than once in the same pattern - => { error2!("{:?}", x + x); } + => { error!("{:?}", x + x); } }; let _z = match (1, 2) { diff --git a/src/test/compile-fail/issue-3099.rs b/src/test/compile-fail/issue-3099.rs index d65001f2b041..bb220091a131 100644 --- a/src/test/compile-fail/issue-3099.rs +++ b/src/test/compile-fail/issue-3099.rs @@ -17,5 +17,5 @@ fn a(x: ~str, y: ~str) -> ~str { //~ ERROR duplicate definition of value `a` } fn main() { - info2!("Result: "); + info!("Result: "); } diff --git a/src/test/compile-fail/issue-3521-2.rs b/src/test/compile-fail/issue-3521-2.rs index 7c56064c2990..db07d9a94e84 100644 --- a/src/test/compile-fail/issue-3521-2.rs +++ b/src/test/compile-fail/issue-3521-2.rs @@ -13,5 +13,5 @@ fn main() { static y: int = foo + 1; //~ ERROR: attempt to use a non-constant value in a constant - error2!("{}", y); + error!("{}", y); } diff --git a/src/test/compile-fail/issue-3521.rs b/src/test/compile-fail/issue-3521.rs index aa82ade449d1..94ca74d2b6a7 100644 --- a/src/test/compile-fail/issue-3521.rs +++ b/src/test/compile-fail/issue-3521.rs @@ -15,5 +15,5 @@ fn main() { Bar = foo //~ ERROR attempt to use a non-constant value in a constant } - error2!("{:?}", Bar); + error!("{:?}", Bar); } diff --git a/src/test/compile-fail/issue-3601.rs b/src/test/compile-fail/issue-3601.rs index 4718c5b88a67..c37c5a3e5afa 100644 --- a/src/test/compile-fail/issue-3601.rs +++ b/src/test/compile-fail/issue-3601.rs @@ -37,6 +37,6 @@ fn main() { ~Element(ed) => match ed.kind { //~ ERROR non-exhaustive patterns ~HTMLImageElement(ref d) if d.image.is_some() => { true } }, - _ => fail2!("WAT") //~ ERROR unreachable pattern + _ => fail!("WAT") //~ ERROR unreachable pattern }; } diff --git a/src/test/compile-fail/issue-3668.rs b/src/test/compile-fail/issue-3668.rs index b6bfe79800f6..77e2e4f21e8a 100644 --- a/src/test/compile-fail/issue-3668.rs +++ b/src/test/compile-fail/issue-3668.rs @@ -16,7 +16,7 @@ trait PTrait { impl PTrait for P { fn getChildOption(&self) -> Option<@P> { static childVal: @P = self.child.get(); //~ ERROR attempt to use a non-constant value in a constant - fail2!(); + fail!(); } } diff --git a/src/test/compile-fail/issue-6458-1.rs b/src/test/compile-fail/issue-6458-1.rs index 77ff58e7427b..a54f05ec3480 100644 --- a/src/test/compile-fail/issue-6458-1.rs +++ b/src/test/compile-fail/issue-6458-1.rs @@ -9,4 +9,4 @@ // except according to those terms. fn foo(t: T) {} -fn main() { foo(fail2!()) } //~ ERROR cannot determine a type for this expression: unconstrained type +fn main() { foo(fail!()) } //~ ERROR cannot determine a type for this expression: unconstrained type diff --git a/src/test/compile-fail/lint-unused-unsafe.rs b/src/test/compile-fail/lint-unused-unsafe.rs index 9deb7d6fba42..6f0c2f1de1ab 100644 --- a/src/test/compile-fail/lint-unused-unsafe.rs +++ b/src/test/compile-fail/lint-unused-unsafe.rs @@ -19,7 +19,7 @@ mod foo { } } -fn callback(_f: &fn() -> T) -> T { fail2!() } +fn callback(_f: &fn() -> T) -> T { fail!() } unsafe fn unsf() {} fn bad1() { unsafe {} } //~ ERROR: unnecessary `unsafe` block @@ -49,7 +49,7 @@ fn good2() { sure that when purity is inherited that the source of the unsafe-ness is tracked correctly */ unsafe { - unsafe fn what() -> ~[~str] { fail2!() } + unsafe fn what() -> ~[~str] { fail!() } do callback { what(); diff --git a/src/test/compile-fail/liveness-and-init.rs b/src/test/compile-fail/liveness-and-init.rs index 71d063130bf7..134390d0b592 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; - info2!("{}", false && { i = 5; true }); - info2!("{}", 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 87cd83d8aeaf..5399127fcb67 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) -> ! { info2!("{}", 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 9438aa0e52e8..98b6cabb6ffa 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(|| { - info2!("{}", 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 37a91338d8d2..accb90769743 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; } - info2!("{}", x); //~ ERROR use of possibly uninitialized variable: `x` + info!("{}", x); //~ ERROR use of possibly uninitialized variable: `x` return 17; } -fn main() { info2!("{}", 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 5aae93df0dcd..d49e79d2c64c 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; } - info2!("{}", x); //~ ERROR use of possibly uninitialized variable: `x` + info!("{}", x); //~ ERROR use of possibly uninitialized variable: `x` return 17; } -fn main() { info2!("{}", 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 69aa47bd567a..8f9941e66889 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() { info2!("{:?}", 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 a0436d984167..8dc590b47f0c 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) { info2!("{}", 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 cf13f7117eea..55fb8222634c 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) { info2!("{:?}", x); } +fn foo(x: int) { info!("{:?}", x); } fn main() { let x: int; if 1 > 2 { - info2!("whoops"); + info!("whoops"); } else { x = 10; } diff --git a/src/test/compile-fail/liveness-init-in-fn-expr.rs b/src/test/compile-fail/liveness-init-in-fn-expr.rs index db8afdf45ae2..138163138844 100644 --- a/src/test/compile-fail/liveness-init-in-fn-expr.rs +++ b/src/test/compile-fail/liveness-init-in-fn-expr.rs @@ -13,5 +13,5 @@ fn main() { let i: int; i //~ ERROR use of possibly uninitialized variable: `i` }; - error2!("{:?}", f()); + error!("{:?}", f()); } diff --git a/src/test/compile-fail/liveness-move-in-loop.rs b/src/test/compile-fail/liveness-move-in-loop.rs index 769de1e7ef3d..6ba7d57ef88e 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 { - info2!("{:?}", 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 752c6c9f1b71..ad0cdc5451fb 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 { - info2!("{:?}", y); //~ ERROR use of moved value: `y` + info!("{:?}", y); //~ ERROR use of moved value: `y` while true { while true { while true { x = y; x.clone(); } } } //~^ 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 9ab7a64e8bdf..f878afce9691 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; - info2!("{}", false || { i = 5; true }); - info2!("{}", 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 439aff342bc6..a6ce736c89be 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) { info2!("{}", 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 8ef3c5494aec..83b8d79756ff 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; - info2!("{:?}", *x); //~ ERROR use of moved value: `x` + info!("{:?}", *x); //~ ERROR use of moved value: `x` y.clone(); } diff --git a/src/test/compile-fail/liveness-use-after-send.rs b/src/test/compile-fail/liveness-use-after-send.rs index 4f2d84ad13b0..7bc277c2eac1 100644 --- a/src/test/compile-fail/liveness-use-after-send.rs +++ b/src/test/compile-fail/liveness-use-after-send.rs @@ -9,9 +9,9 @@ // except according to those terms. fn send(ch: _chan, data: T) { - info2!("{:?}", ch); - info2!("{:?}", data); - fail2!(); + info!("{:?}", ch); + info!("{:?}", data); + fail!(); } struct _chan(int); @@ -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); - info2!("{:?}", message); //~ ERROR use of moved value: `message` + info!("{:?}", message); //~ ERROR use of moved value: `message` } -fn main() { fail2!(); } +fn main() { fail!(); } diff --git a/src/test/compile-fail/liveness-while-break.rs b/src/test/compile-fail/liveness-while-break.rs index 02d8656baff1..e5d4b6ef48cd 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; } - info2!("{}", v); //~ ERROR use of possibly uninitialized variable: `v` + info!("{}", 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 5d9ae958ce0c..8155a2fbda3e 100644 --- a/src/test/compile-fail/match-join.rs +++ b/src/test/compile-fail/match-join.rs @@ -11,11 +11,11 @@ // a good test that we merge paths correctly in the presence of a // variable that's used before it's declared -fn my_fail() -> ! { fail2!(); } +fn my_fail() -> ! { fail!(); } fn main() { match true { false => { my_fail(); } true => { } } - info2!("{:?}", x); //~ ERROR unresolved name `x`. + info!("{:?}", x); //~ ERROR unresolved name `x`. let x: int; } diff --git a/src/test/compile-fail/moves-based-on-type-exprs.rs b/src/test/compile-fail/moves-based-on-type-exprs.rs index 6531ae035843..fec0f89adbaf 100644 --- a/src/test/compile-fail/moves-based-on-type-exprs.rs +++ b/src/test/compile-fail/moves-based-on-type-exprs.rs @@ -2,7 +2,7 @@ // they occur as part of various kinds of expressions. struct Foo { f: A } -fn guard(_s: ~str) -> bool {fail2!()} +fn guard(_s: ~str) -> bool {fail!()} fn touch(_a: &A) {} fn f10() { diff --git a/src/test/compile-fail/moves-based-on-type-match-bindings.rs b/src/test/compile-fail/moves-based-on-type-match-bindings.rs index 4893c8b71979..42944a206b36 100644 --- a/src/test/compile-fail/moves-based-on-type-match-bindings.rs +++ b/src/test/compile-fail/moves-based-on-type-match-bindings.rs @@ -3,7 +3,7 @@ // terms of the binding, not the discriminant. struct Foo { f: A } -fn guard(_s: ~str) -> bool {fail2!()} +fn guard(_s: ~str) -> bool {fail!()} fn touch(_a: &A) {} fn f10() { diff --git a/src/test/compile-fail/moves-based-on-type-no-recursive-stack-closure.rs b/src/test/compile-fail/moves-based-on-type-no-recursive-stack-closure.rs index d1eae1ae6134..2762140be379 100644 --- a/src/test/compile-fail/moves-based-on-type-no-recursive-stack-closure.rs +++ b/src/test/compile-fail/moves-based-on-type-no-recursive-stack-closure.rs @@ -30,7 +30,7 @@ fn innocent_looking_victim() { (f.c)(f, true); println!("{:?}", msg); }, - None => fail2!("oops"), + None => fail!("oops"), } } } diff --git a/src/test/compile-fail/no-capture-arc.rs b/src/test/compile-fail/no-capture-arc.rs index 90a68d796f30..65e0c07b3580 100644 --- a/src/test/compile-fail/no-capture-arc.rs +++ b/src/test/compile-fail/no-capture-arc.rs @@ -26,5 +26,5 @@ fn main() { assert_eq!((arc_v.get())[2], 3); - info2!("{:?}", arc_v); + info!("{:?}", arc_v); } diff --git a/src/test/compile-fail/no-reuse-move-arc.rs b/src/test/compile-fail/no-reuse-move-arc.rs index 9eca13298245..3cd048040c6f 100644 --- a/src/test/compile-fail/no-reuse-move-arc.rs +++ b/src/test/compile-fail/no-reuse-move-arc.rs @@ -24,5 +24,5 @@ fn main() { assert_eq!((arc_v.get())[2], 3); //~ ERROR use of moved value: `arc_v` - info2!("{:?}", arc_v); //~ ERROR use of moved value: `arc_v` + info!("{:?}", arc_v); //~ ERROR use of moved value: `arc_v` } diff --git a/src/test/compile-fail/no-send-res-ports.rs b/src/test/compile-fail/no-send-res-ports.rs index f6d1aceab646..e0ce486cbd65 100644 --- a/src/test/compile-fail/no-send-res-ports.rs +++ b/src/test/compile-fail/no-send-res-ports.rs @@ -33,6 +33,6 @@ fn main() { do task::spawn { let y = x.take(); //~ ERROR does not fulfill `Send` - error2!("{:?}", y); + error!("{:?}", y); } } diff --git a/src/test/compile-fail/non-exhaustive-match-nested.rs b/src/test/compile-fail/non-exhaustive-match-nested.rs index f5660fd35106..b87b3c5245a8 100644 --- a/src/test/compile-fail/non-exhaustive-match-nested.rs +++ b/src/test/compile-fail/non-exhaustive-match-nested.rs @@ -16,7 +16,7 @@ enum u { c, d } fn main() { let x = a(c); match x { - a(d) => { fail2!("hello"); } - b => { fail2!("goodbye"); } + a(d) => { fail!("hello"); } + b => { fail!("goodbye"); } } } diff --git a/src/test/compile-fail/noncopyable-class.rs b/src/test/compile-fail/noncopyable-class.rs index 199bdaa397ad..e57ac5726fbb 100644 --- a/src/test/compile-fail/noncopyable-class.rs +++ b/src/test/compile-fail/noncopyable-class.rs @@ -39,5 +39,5 @@ fn foo(i:int) -> foo { fn main() { let x = foo(10); let _y = x.clone(); //~ ERROR does not implement any method in scope - error2!("{:?}", x); + error!("{:?}", x); } diff --git a/src/test/compile-fail/nonscalar-cast.rs b/src/test/compile-fail/nonscalar-cast.rs index 45efa8929890..5c7a85a03237 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() { - info2!("{:?}", foo{ x: 1 } as int); + info!("{:?}", foo{ x: 1 } as int); } diff --git a/src/test/compile-fail/not-enough-arguments.rs b/src/test/compile-fail/not-enough-arguments.rs index a53736580d9b..57eca3666ef1 100644 --- a/src/test/compile-fail/not-enough-arguments.rs +++ b/src/test/compile-fail/not-enough-arguments.rs @@ -13,7 +13,7 @@ // unrelated errors. fn foo(a: int, b: int, c: int, d:int) { - fail2!(); + fail!(); } fn main() { diff --git a/src/test/compile-fail/oversized-literal.rs b/src/test/compile-fail/oversized-literal.rs index 5b5cab25e046..2e4ba8855bdb 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() { info2!("{}", 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 0a5bc4ad8bb8..991a4ed9e090 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); - info2!("{:?}", oof); + info!("{:?}", oof); } } diff --git a/src/test/compile-fail/packed-struct-transmute.rs b/src/test/compile-fail/packed-struct-transmute.rs index 79978dedb567..58c5aabba126 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); - info2!("{:?}", oof); + info!("{:?}", oof); } } diff --git a/src/test/compile-fail/pattern-tyvar-2.rs b/src/test/compile-fail/pattern-tyvar-2.rs index 216280b34e92..537d095d2d7a 100644 --- a/src/test/compile-fail/pattern-tyvar-2.rs +++ b/src/test/compile-fail/pattern-tyvar-2.rs @@ -15,6 +15,6 @@ extern mod extra; enum bar { t1((), Option<~[int]>), t2, } // n.b. my change changes this error message, but I think it's right -- tjc -fn foo(t: bar) -> int { match t { t1(_, Some(x)) => { return x * 3; } _ => { fail2!(); } } } //~ ERROR binary operation * cannot be applied to +fn foo(t: bar) -> int { match t { t1(_, Some(x)) => { return x * 3; } _ => { fail!(); } } } //~ ERROR binary operation * cannot be applied to fn main() { } diff --git a/src/test/compile-fail/pattern-tyvar.rs b/src/test/compile-fail/pattern-tyvar.rs index 67a4bacbe9a9..b81e4ea92d02 100644 --- a/src/test/compile-fail/pattern-tyvar.rs +++ b/src/test/compile-fail/pattern-tyvar.rs @@ -18,9 +18,9 @@ enum bar { t1((), Option<~[int]>), t2, } fn foo(t: bar) { match t { t1(_, Some::(x)) => { - info2!("{:?}", x); + info!("{:?}", x); } - _ => { fail2!(); } + _ => { fail!(); } } } diff --git a/src/test/compile-fail/pinned-deep-copy.rs b/src/test/compile-fail/pinned-deep-copy.rs index 8baba6cccc11..69ed3ea545e9 100644 --- a/src/test/compile-fail/pinned-deep-copy.rs +++ b/src/test/compile-fail/pinned-deep-copy.rs @@ -37,7 +37,7 @@ fn main() { // Can't do this copy let x = ~~~A {y: r(i)}; let _z = x.clone(); //~ ERROR failed to find an implementation - info2!("{:?}", x); + info!("{:?}", x); } - error2!("{:?}", *i); + 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 1904f0826176..3a480a7e9631 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(); - info2!("cats_chased: {}", d.cats_chased); + info!("cats_chased: {}", d.cats_chased); } diff --git a/src/test/compile-fail/regions-fn-subtyping.rs b/src/test/compile-fail/regions-fn-subtyping.rs index 10107f64158d..5928d31a6686 100644 --- a/src/test/compile-fail/regions-fn-subtyping.rs +++ b/src/test/compile-fail/regions-fn-subtyping.rs @@ -8,8 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -fn of() -> &fn(T) { fail2!(); } -fn subtype(x: &fn(T)) { fail2!(); } +fn of() -> &fn(T) { fail!(); } +fn subtype(x: &fn(T)) { fail!(); } fn test_fn<'x,'y,'z,T>(_x: &'x T, _y: &'y T, _z: &'z T) { // Here, x, y, and z are free. Other letters diff --git a/src/test/compile-fail/regions-free-region-ordering-callee.rs b/src/test/compile-fail/regions-free-region-ordering-callee.rs index 872491adaacc..66ab4b770543 100644 --- a/src/test/compile-fail/regions-free-region-ordering-callee.rs +++ b/src/test/compile-fail/regions-free-region-ordering-callee.rs @@ -27,7 +27,7 @@ fn ordering3<'a, 'b>(x: &'a uint, y: &'b uint) -> &'a &'b uint { // Do not infer an ordering from the return value. let z: &'b uint = &*x; //~^ ERROR cannot infer an appropriate lifetime due to conflicting requirements - fail2!(); + fail!(); } fn ordering4<'a, 'b>(a: &'a uint, b: &'b uint, x: &fn(&'a &'b uint)) { diff --git a/src/test/compile-fail/regions-freevar.rs b/src/test/compile-fail/regions-freevar.rs index 06e91ddcf56d..251be9123597 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 - info2!("i={}", i); + info!("i={}", i); } } diff --git a/src/test/compile-fail/regions-ret-borrowed-1.rs b/src/test/compile-fail/regions-ret-borrowed-1.rs index 885d50b7efc4..df7831e90505 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(); - info2!("foo={}", *x); + info!("foo={}", *x); } diff --git a/src/test/compile-fail/regions-ret-borrowed.rs b/src/test/compile-fail/regions-ret-borrowed.rs index 5dea40f4ac7c..c2e48053260c 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(); - info2!("foo={}", *x); + info!("foo={}", *x); } diff --git a/src/test/compile-fail/tag-that-dare-not-speak-its-name.rs b/src/test/compile-fail/tag-that-dare-not-speak-its-name.rs index ce6d12a22655..ebd3320d9012 100644 --- a/src/test/compile-fail/tag-that-dare-not-speak-its-name.rs +++ b/src/test/compile-fail/tag-that-dare-not-speak-its-name.rs @@ -16,7 +16,7 @@ extern mod std; fn last(v: ~[&T]) -> std::option::Option { - fail2!(); + fail!(); } fn main() { diff --git a/src/test/compile-fail/tag-type-args.rs b/src/test/compile-fail/tag-type-args.rs index a88435bff6eb..f2ef1d195250 100644 --- a/src/test/compile-fail/tag-type-args.rs +++ b/src/test/compile-fail/tag-type-args.rs @@ -14,4 +14,4 @@ enum quux { bar } fn foo(c: quux) { assert!((false)); } -fn main() { fail2!(); } +fn main() { fail!(); } diff --git a/src/test/compile-fail/unique-pinned-nocopy.rs b/src/test/compile-fail/unique-pinned-nocopy.rs index 8882bd1e2681..bf62247e7e78 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 = i.clone(); //~ ERROR failed to find an implementation - info2!("{:?}", i); + info!("{:?}", i); } diff --git a/src/test/compile-fail/unique-vec-res.rs b/src/test/compile-fail/unique-vec-res.rs index 4bc181cbdfa9..dd9d2e067c6d 100644 --- a/src/test/compile-fail/unique-vec-res.rs +++ b/src/test/compile-fail/unique-vec-res.rs @@ -31,6 +31,6 @@ fn main() { let r2 = ~[~r { i: i2 }]; f(r1.clone(), r2.clone()); //~^ ERROR failed to find an implementation of - info2!("{:?}", (r2, *i1)); - info2!("{:?}", (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 d9a5302aedcb..dc3895d0190c 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() { - info2!("{:?}", 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 38bba1efea57..d97c32a64a47 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]; - info2!("{}", 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 48db83bd92f3..3545392d5d9f 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; - info2!("{}", j); + info!("{}", j); } diff --git a/src/test/pretty/issue-929.rs b/src/test/pretty/issue-929.rs index a82a8ec41c75..636fac82b6b0 100644 --- a/src/test/pretty/issue-929.rs +++ b/src/test/pretty/issue-929.rs @@ -8,6 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -fn f() { if (1 == fail2!()) { } else { } } +fn f() { if (1 == fail!()) { } else { } } fn main() { } diff --git a/src/test/run-fail/args-fail.rs b/src/test/run-fail/args-fail.rs index d936368cc33d..b803d7488b07 100644 --- a/src/test/run-fail/args-fail.rs +++ b/src/test/run-fail/args-fail.rs @@ -9,6 +9,6 @@ // except according to those terms. // error-pattern:meep -fn f(_a: int, _b: int, _c: @int) { fail2!("moop"); } +fn f(_a: int, _b: int, _c: @int) { fail!("moop"); } -fn main() { f(1, fail2!("meep"), @42); } +fn main() { f(1, fail!("meep"), @42); } diff --git a/src/test/run-fail/binop-fail-2.rs b/src/test/run-fail/binop-fail-2.rs index 1038d2025c78..ef2a4e5335f4 100644 --- a/src/test/run-fail/binop-fail-2.rs +++ b/src/test/run-fail/binop-fail-2.rs @@ -9,5 +9,5 @@ // except according to those terms. // error-pattern:quux -fn my_err(s: ~str) -> ! { error2!("{}", s); fail2!("quux"); } +fn my_err(s: ~str) -> ! { error!("{}", s); fail!("quux"); } fn main() { 3u == my_err(~"bye"); } diff --git a/src/test/run-fail/binop-fail-3.rs b/src/test/run-fail/binop-fail-3.rs index b46d5251e223..150544f16af0 100644 --- a/src/test/run-fail/binop-fail-3.rs +++ b/src/test/run-fail/binop-fail-3.rs @@ -9,5 +9,5 @@ // except according to those terms. // error-pattern:quux -fn foo() -> ! { fail2!("quux"); } +fn foo() -> ! { fail!("quux"); } fn main() { foo() == foo(); } diff --git a/src/test/run-fail/binop-fail.rs b/src/test/run-fail/binop-fail.rs index 1038d2025c78..ef2a4e5335f4 100644 --- a/src/test/run-fail/binop-fail.rs +++ b/src/test/run-fail/binop-fail.rs @@ -9,5 +9,5 @@ // except according to those terms. // error-pattern:quux -fn my_err(s: ~str) -> ! { error2!("{}", s); fail2!("quux"); } +fn my_err(s: ~str) -> ! { error!("{}", s); fail!("quux"); } fn main() { 3u == my_err(~"bye"); } diff --git a/src/test/run-fail/bug-2470-bounds-check-overflow.rs b/src/test/run-fail/bug-2470-bounds-check-overflow.rs index 17b4c83788ca..36f05a0a73cd 100644 --- a/src/test/run-fail/bug-2470-bounds-check-overflow.rs +++ b/src/test/run-fail/bug-2470-bounds-check-overflow.rs @@ -24,13 +24,13 @@ fn main() { do x.as_imm_buf |p, _len| { let base = p as uint; let idx = base / mem::size_of::(); - error2!("ov1 base = 0x{:x}", base); - error2!("ov1 idx = 0x{:x}", idx); - error2!("ov1 sizeof::() = 0x{:x}", mem::size_of::()); - error2!("ov1 idx * sizeof::() = 0x{:x}", + error!("ov1 base = 0x{:x}", base); + error!("ov1 idx = 0x{:x}", idx); + error!("ov1 sizeof::() = 0x{:x}", mem::size_of::()); + error!("ov1 idx * sizeof::() = 0x{:x}", idx * mem::size_of::()); // This should fail. - error2!("ov1 0x{:x}", x[idx]); + error!("ov1 0x{:x}", x[idx]); } } diff --git a/src/test/run-fail/bug-811.rs b/src/test/run-fail/bug-811.rs index b41062043cfd..2a256b9a4e38 100644 --- a/src/test/run-fail/bug-811.rs +++ b/src/test/run-fail/bug-811.rs @@ -19,6 +19,6 @@ struct chan_t { port: port_id, } -fn send(_ch: chan_t, _data: T) { fail2!(); } +fn send(_ch: chan_t, _data: T) { fail!(); } -fn main() { fail2!("quux"); } +fn main() { fail!("quux"); } diff --git a/src/test/run-fail/die-macro-expr.rs b/src/test/run-fail/die-macro-expr.rs index 3310ffe909a7..8ff62d5a43d1 100644 --- a/src/test/run-fail/die-macro-expr.rs +++ b/src/test/run-fail/die-macro-expr.rs @@ -1,5 +1,5 @@ // error-pattern:test fn main() { - let _i: int = fail2!("test"); + let _i: int = fail!("test"); } diff --git a/src/test/run-fail/die-macro-pure.rs b/src/test/run-fail/die-macro-pure.rs index 6d0f5909c4de..bb62a7e8beff 100644 --- a/src/test/run-fail/die-macro-pure.rs +++ b/src/test/run-fail/die-macro-pure.rs @@ -1,7 +1,7 @@ // error-pattern:test fn f() { - fail2!("test"); + fail!("test"); } fn main() { diff --git a/src/test/run-fail/die-macro.rs b/src/test/run-fail/die-macro.rs index 678ac6555804..71cc7317e6ef 100644 --- a/src/test/run-fail/die-macro.rs +++ b/src/test/run-fail/die-macro.rs @@ -1,5 +1,5 @@ // error-pattern:test fn main() { - fail2!("test"); + fail!("test"); } diff --git a/src/test/run-fail/doublefail.rs b/src/test/run-fail/doublefail.rs index ee59823e8ad2..1ceeee1b6ed1 100644 --- a/src/test/run-fail/doublefail.rs +++ b/src/test/run-fail/doublefail.rs @@ -12,6 +12,6 @@ //error-pattern:One fn main() { - fail2!("One"); - fail2!("Two"); + fail!("One"); + fail!("Two"); } diff --git a/src/test/run-fail/explicit-fail-msg.rs b/src/test/run-fail/explicit-fail-msg.rs index c1d2e986f124..ab8cea0a3051 100644 --- a/src/test/run-fail/explicit-fail-msg.rs +++ b/src/test/run-fail/explicit-fail-msg.rs @@ -15,5 +15,5 @@ fn main() { let mut a = 1; if 1 == 1 { a = 2; } - fail2!(~"woooo" + "o"); + fail!(~"woooo" + "o"); } diff --git a/src/test/run-fail/explicit-fail.rs b/src/test/run-fail/explicit-fail.rs index 78a407bbbd5f..8c204b66e365 100644 --- a/src/test/run-fail/explicit-fail.rs +++ b/src/test/run-fail/explicit-fail.rs @@ -12,4 +12,4 @@ // error-pattern:explicit -fn main() { fail2!(); } +fn main() { fail!(); } diff --git a/src/test/run-fail/expr-fn-fail.rs b/src/test/run-fail/expr-fn-fail.rs index a8714fdbdc83..e645ea34df56 100644 --- a/src/test/run-fail/expr-fn-fail.rs +++ b/src/test/run-fail/expr-fn-fail.rs @@ -12,6 +12,6 @@ // error-pattern:explicit failure -fn f() -> ! { fail2!() } +fn f() -> ! { fail!() } fn main() { f(); } diff --git a/src/test/run-fail/expr-if-fail-fn.rs b/src/test/run-fail/expr-if-fail-fn.rs index 8ecc2cdf0f4f..99f798147f28 100644 --- a/src/test/run-fail/expr-if-fail-fn.rs +++ b/src/test/run-fail/expr-if-fail-fn.rs @@ -12,7 +12,7 @@ // error-pattern:explicit failure -fn f() -> ! { fail2!() } +fn f() -> ! { fail!() } fn g() -> int { let x = if true { f() } else { 10 }; return x; } diff --git a/src/test/run-fail/expr-if-fail.rs b/src/test/run-fail/expr-if-fail.rs index 50778f655604..73259e6e140f 100644 --- a/src/test/run-fail/expr-if-fail.rs +++ b/src/test/run-fail/expr-if-fail.rs @@ -12,4 +12,4 @@ // error-pattern:explicit failure -fn main() { let _x = if false { 0 } else if true { fail2!() } else { 10 }; } +fn main() { let _x = if false { 0 } else if true { fail!() } else { 10 }; } diff --git a/src/test/run-fail/expr-match-fail-fn.rs b/src/test/run-fail/expr-match-fail-fn.rs index 98cc3c230a04..6476e57a35b8 100644 --- a/src/test/run-fail/expr-match-fail-fn.rs +++ b/src/test/run-fail/expr-match-fail-fn.rs @@ -12,7 +12,7 @@ // error-pattern:explicit failure -fn f() -> ! { fail2!() } +fn f() -> ! { fail!() } fn g() -> int { let x = match true { true => { f() } false => { 10 } }; return x; } diff --git a/src/test/run-fail/expr-match-fail.rs b/src/test/run-fail/expr-match-fail.rs index c8cab907d7d1..075f6f5b4b19 100644 --- a/src/test/run-fail/expr-match-fail.rs +++ b/src/test/run-fail/expr-match-fail.rs @@ -12,4 +12,4 @@ // error-pattern:explicit failure -fn main() { let _x = match true { false => { 0 } true => { fail2!() } }; } +fn main() { let _x = match true { false => { 0 } true => { fail!() } }; } diff --git a/src/test/run-fail/extern-fail.rs b/src/test/run-fail/extern-fail.rs index 17059107c011..ce5ea56502cc 100644 --- a/src/test/run-fail/extern-fail.rs +++ b/src/test/run-fail/extern-fail.rs @@ -45,7 +45,7 @@ fn main() { do task::spawn { let result = count(5u); info!("result = %?", result); - fail2!(); + fail!(); }; } } diff --git a/src/test/run-fail/fail-arg.rs b/src/test/run-fail/fail-arg.rs index 29baa4b31704..705b7f4028c2 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) { info2!("{}", a); } +fn f(a: int) { info!("{}", a); } -fn main() { f(fail2!("woe")); } +fn main() { f(fail!("woe")); } diff --git a/src/test/run-fail/fail-macro-explicit.rs b/src/test/run-fail/fail-macro-explicit.rs index ca6abee03bfa..13e3a6a31a8f 100644 --- a/src/test/run-fail/fail-macro-explicit.rs +++ b/src/test/run-fail/fail-macro-explicit.rs @@ -11,5 +11,5 @@ // error-pattern:failed at 'explicit failure' fn main() { - fail2!(); + fail!(); } diff --git a/src/test/run-fail/fail-macro-fmt.rs b/src/test/run-fail/fail-macro-fmt.rs index 90d9ff9b0ec8..e97d2dbe985a 100644 --- a/src/test/run-fail/fail-macro-fmt.rs +++ b/src/test/run-fail/fail-macro-fmt.rs @@ -11,5 +11,5 @@ // error-pattern:failed at 'test-fail-fmt 42 rust' fn main() { - fail2!("test-fail-fmt {} {}", 42, "rust"); + fail!("test-fail-fmt {} {}", 42, "rust"); } diff --git a/src/test/run-fail/fail-macro-owned.rs b/src/test/run-fail/fail-macro-owned.rs index fa461fefb88c..e59f5bdcaa17 100644 --- a/src/test/run-fail/fail-macro-owned.rs +++ b/src/test/run-fail/fail-macro-owned.rs @@ -11,5 +11,5 @@ // error-pattern:failed at 'test-fail-owned' fn main() { - fail2!("test-fail-owned"); + fail!("test-fail-owned"); } diff --git a/src/test/run-fail/fail-macro-static.rs b/src/test/run-fail/fail-macro-static.rs index f05a68a5fcb2..688ca4ce7e57 100644 --- a/src/test/run-fail/fail-macro-static.rs +++ b/src/test/run-fail/fail-macro-static.rs @@ -11,5 +11,5 @@ // error-pattern:failed at 'test-fail-static' fn main() { - fail2!("test-fail-static"); + fail!("test-fail-static"); } diff --git a/src/test/run-fail/fail-main.rs b/src/test/run-fail/fail-main.rs index 2691beed2725..f007e03041c1 100644 --- a/src/test/run-fail/fail-main.rs +++ b/src/test/run-fail/fail-main.rs @@ -10,4 +10,4 @@ // error-pattern:moop extern mod extra; -fn main() { fail2!("moop"); } +fn main() { fail!("moop"); } diff --git a/src/test/run-fail/fail-parens.rs b/src/test/run-fail/fail-parens.rs index 79f46f47fb30..90a44e427593 100644 --- a/src/test/run-fail/fail-parens.rs +++ b/src/test/run-fail/fail-parens.rs @@ -13,8 +13,8 @@ // error-pattern:oops fn bigfail() { - while (fail2!("oops")) { if (fail2!()) { - match (fail2!()) { () => { + while (fail!("oops")) { if (fail!()) { + match (fail!()) { () => { } } }}; diff --git a/src/test/run-fail/fail-task-name-none.rs b/src/test/run-fail/fail-task-name-none.rs index 5d4de9ea43c1..542ccfb0aeac 100644 --- a/src/test/run-fail/fail-task-name-none.rs +++ b/src/test/run-fail/fail-task-name-none.rs @@ -12,6 +12,6 @@ fn main() { do spawn { - fail2!("test"); + fail!("test"); } } diff --git a/src/test/run-fail/fail-task-name-owned.rs b/src/test/run-fail/fail-task-name-owned.rs index f00f18cf5c2a..ff3596df1426 100644 --- a/src/test/run-fail/fail-task-name-owned.rs +++ b/src/test/run-fail/fail-task-name-owned.rs @@ -14,6 +14,6 @@ fn main() { let mut t = ::std::task::task(); t.name(~"owned name"); do t.spawn { - fail2!("test"); + fail!("test"); } } diff --git a/src/test/run-fail/fail-task-name-send-str.rs b/src/test/run-fail/fail-task-name-send-str.rs index e44f78094ff4..96fe82fa5ca1 100644 --- a/src/test/run-fail/fail-task-name-send-str.rs +++ b/src/test/run-fail/fail-task-name-send-str.rs @@ -14,6 +14,6 @@ fn main() { let mut t = ::std::task::task(); t.name("send name".to_send_str()); do t.spawn { - fail2!("test"); + fail!("test"); } } diff --git a/src/test/run-fail/fail-task-name-static.rs b/src/test/run-fail/fail-task-name-static.rs index 0b502d8a35ee..a20dbe42c6d2 100644 --- a/src/test/run-fail/fail-task-name-static.rs +++ b/src/test/run-fail/fail-task-name-static.rs @@ -14,6 +14,6 @@ fn main() { let mut t = ::std::task::task(); t.name("static name"); do t.spawn { - fail2!("test"); + fail!("test"); } } diff --git a/src/test/run-fail/fmt-fail.rs b/src/test/run-fail/fmt-fail.rs index 1c6298a6c8d2..3bc9014a74c0 100644 --- a/src/test/run-fail/fmt-fail.rs +++ b/src/test/run-fail/fmt-fail.rs @@ -11,4 +11,4 @@ // error-pattern:meh extern mod extra; -fn main() { let str_var: ~str = ~"meh"; fail2!("{}", str_var); } +fn main() { let str_var: ~str = ~"meh"; fail!("{}", str_var); } diff --git a/src/test/run-fail/for-each-loop-fail.rs b/src/test/run-fail/for-each-loop-fail.rs index 032460d20796..3c9397fc07ff 100644 --- a/src/test/run-fail/for-each-loop-fail.rs +++ b/src/test/run-fail/for-each-loop-fail.rs @@ -11,4 +11,4 @@ // error-pattern:moop extern mod extra; -fn main() { for _ in range(0u, 10u) { fail2!("moop"); } } +fn main() { for _ in range(0u, 10u) { fail!("moop"); } } diff --git a/src/test/run-fail/if-check-fail.rs b/src/test/run-fail/if-check-fail.rs index e8a1cad53ad1..d9e64fecfd49 100644 --- a/src/test/run-fail/if-check-fail.rs +++ b/src/test/run-fail/if-check-fail.rs @@ -17,9 +17,9 @@ fn even(x: uint) -> bool { fn foo(x: uint) { if even(x) { - info2!("{}", x); + info!("{}", x); } else { - fail2!("Number is odd"); + fail!("Number is odd"); } } diff --git a/src/test/run-fail/if-cond-bot.rs b/src/test/run-fail/if-cond-bot.rs index d596a11f1cbd..97c4279b1883 100644 --- a/src/test/run-fail/if-cond-bot.rs +++ b/src/test/run-fail/if-cond-bot.rs @@ -9,5 +9,5 @@ // except according to those terms. // error-pattern:quux -fn my_err(s: ~str) -> ! { error2!("{}", s); fail2!("quux"); } +fn my_err(s: ~str) -> ! { error!("{}", s); fail!("quux"); } fn main() { if my_err(~"bye") { } } diff --git a/src/test/run-fail/issue-2156.rs b/src/test/run-fail/issue-2156.rs index 78422347f784..863663334f8e 100644 --- a/src/test/run-fail/issue-2156.rs +++ b/src/test/run-fail/issue-2156.rs @@ -19,6 +19,6 @@ use std::io; fn main() { do io::with_str_reader(~"") |rdr| { - match rdr.read_char() { '=' => { } _ => { fail2!() } } + match rdr.read_char() { '=' => { } _ => { fail!() } } } } diff --git a/src/test/run-fail/issue-2272.rs b/src/test/run-fail/issue-2272.rs index 9b8ecca96a6f..5ce89bc18149 100644 --- a/src/test/run-fail/issue-2272.rs +++ b/src/test/run-fail/issue-2272.rs @@ -22,5 +22,5 @@ fn main() { }, a: ~0 }; - fail2!(); + fail!(); } diff --git a/src/test/run-fail/issue-2444.rs b/src/test/run-fail/issue-2444.rs index b15c54c7b6eb..c1357988f7db 100644 --- a/src/test/run-fail/issue-2444.rs +++ b/src/test/run-fail/issue-2444.rs @@ -15,7 +15,7 @@ use extra::arc; enum e { e(arc::Arc) } -fn foo() -> e {fail2!();} +fn foo() -> e {fail!();} fn main() { let _f = foo(); diff --git a/src/test/run-fail/issue-3029.rs b/src/test/run-fail/issue-3029.rs index 5d20c49945e0..44364007c067 100644 --- a/src/test/run-fail/issue-3029.rs +++ b/src/test/run-fail/issue-3029.rs @@ -16,7 +16,7 @@ fn main() { let mut x = ~[]; let y = ~[3]; - fail2!("so long"); + fail!("so long"); x.push_all_move(y); ~"good" + ~"bye"; } diff --git a/src/test/run-fail/issue-948.rs b/src/test/run-fail/issue-948.rs index 39d741e5169e..db954bc59466 100644 --- a/src/test/run-fail/issue-948.rs +++ b/src/test/run-fail/issue-948.rs @@ -16,5 +16,5 @@ struct Point { x: int, y: int } fn main() { let origin = Point {x: 0, y: 0}; - let f: Point = Point {x: (fail2!("beep boop")),.. origin}; + let f: Point = Point {x: (fail!("beep boop")),.. origin}; } diff --git a/src/test/run-fail/linked-failure2.rs b/src/test/run-fail/linked-failure2.rs index d99cfe40da43..52a67872d4cf 100644 --- a/src/test/run-fail/linked-failure2.rs +++ b/src/test/run-fail/linked-failure2.rs @@ -16,7 +16,7 @@ use std::comm; use std::task; -fn child() { fail2!(); } +fn child() { fail!(); } fn main() { let (p, _c) = comm::stream::<()>(); diff --git a/src/test/run-fail/linked-failure3.rs b/src/test/run-fail/linked-failure3.rs index fd330bba1c57..f40eae20bc0b 100644 --- a/src/test/run-fail/linked-failure3.rs +++ b/src/test/run-fail/linked-failure3.rs @@ -16,7 +16,7 @@ use std::comm; use std::task; -fn grandchild() { fail2!("grandchild dies"); } +fn grandchild() { fail!("grandchild dies"); } fn child() { let (p, _c) = comm::stream::(); diff --git a/src/test/run-fail/match-bot-fail.rs b/src/test/run-fail/match-bot-fail.rs index 7b1d6bea499d..a54422ef8f53 100644 --- a/src/test/run-fail/match-bot-fail.rs +++ b/src/test/run-fail/match-bot-fail.rs @@ -17,6 +17,6 @@ fn foo(s: ~str) { } fn main() { let i = - match Some::(3) { None:: => { fail2!() } Some::(_) => { fail2!() } }; + match Some::(3) { None:: => { fail!() } Some::(_) => { fail!() } }; foo(i); } diff --git a/src/test/run-fail/match-disc-bot.rs b/src/test/run-fail/match-disc-bot.rs index 9b38a381a58e..13ccd118c618 100644 --- a/src/test/run-fail/match-disc-bot.rs +++ b/src/test/run-fail/match-disc-bot.rs @@ -9,6 +9,6 @@ // except according to those terms. // error-pattern:quux -fn f() -> ! { fail2!("quux") } +fn f() -> ! { fail!("quux") } fn g() -> int { match f() { true => { 1 } false => { 0 } } } fn main() { g(); } diff --git a/src/test/run-fail/match-wildcards.rs b/src/test/run-fail/match-wildcards.rs index 535b3340a4d0..0d1aebc82e90 100644 --- a/src/test/run-fail/match-wildcards.rs +++ b/src/test/run-fail/match-wildcards.rs @@ -11,10 +11,10 @@ // error-pattern:squirrelcupcake fn cmp() -> int { match (Some('a'), None::) { - (Some(_), _) => { fail2!("squirrelcupcake"); } - (_, Some(_)) => { fail2!(); } - _ => { fail2!("wat"); } + (Some(_), _) => { fail!("squirrelcupcake"); } + (_, Some(_)) => { fail!(); } + _ => { fail!("wat"); } } } -fn main() { error2!("{}", cmp()); } +fn main() { error!("{}", cmp()); } diff --git a/src/test/run-fail/morestack1.rs b/src/test/run-fail/morestack1.rs index 35c19c47f528..d3e3be6c2caa 100644 --- a/src/test/run-fail/morestack1.rs +++ b/src/test/run-fail/morestack1.rs @@ -14,7 +14,7 @@ fn getbig(i: int) { if i != 0 { getbig(i - 1); } else { - fail2!(); + fail!(); } } diff --git a/src/test/run-fail/morestack2.rs b/src/test/run-fail/morestack2.rs index 9af45cebe687..5ac309264003 100644 --- a/src/test/run-fail/morestack2.rs +++ b/src/test/run-fail/morestack2.rs @@ -35,7 +35,7 @@ fn getbig_call_c_and_fail(i: int) { } else { unsafe { rustrt::rust_get_argc(); - fail2!(); + fail!(); } } } diff --git a/src/test/run-fail/morestack3.rs b/src/test/run-fail/morestack3.rs index fea915511613..e6f219710b37 100644 --- a/src/test/run-fail/morestack3.rs +++ b/src/test/run-fail/morestack3.rs @@ -22,7 +22,7 @@ fn getbig_and_fail(i: int) { if i != 0 { getbig_and_fail(i - 1); } else { - fail2!(); + fail!(); } } diff --git a/src/test/run-fail/morestack4.rs b/src/test/run-fail/morestack4.rs index a4df5e57923f..02a65e91d044 100644 --- a/src/test/run-fail/morestack4.rs +++ b/src/test/run-fail/morestack4.rs @@ -22,7 +22,7 @@ fn getbig_and_fail(i: int) { if i != 0 { getbig_and_fail(i - 1); } else { - fail2!(); + fail!(); } } diff --git a/src/test/run-fail/result-get-fail.rs b/src/test/run-fail/result-get-fail.rs index c3f4250b0538..81eed9267ab5 100644 --- a/src/test/run-fail/result-get-fail.rs +++ b/src/test/run-fail/result-get-fail.rs @@ -13,5 +13,5 @@ use std::result; fn main() { - error2!("{:?}", result::Err::(~"kitty").unwrap()); + error!("{:?}", result::Err::(~"kitty").unwrap()); } diff --git a/src/test/run-fail/rhs-type.rs b/src/test/run-fail/rhs-type.rs index 5e09536fb4d3..ca267608025c 100644 --- a/src/test/run-fail/rhs-type.rs +++ b/src/test/run-fail/rhs-type.rs @@ -18,6 +18,6 @@ struct T { t: ~str } fn main() { - let pth = fail2!("bye"); + let pth = fail!("bye"); let _rs: T = T {t: pth}; } diff --git a/src/test/run-fail/rt-set-exit-status-fail.rs b/src/test/run-fail/rt-set-exit-status-fail.rs index 5c854825c28a..52399c09188d 100644 --- a/src/test/run-fail/rt-set-exit-status-fail.rs +++ b/src/test/run-fail/rt-set-exit-status-fail.rs @@ -13,10 +13,10 @@ use std::os; fn main() { - error2!("whatever"); + error!("whatever"); // Setting the exit status only works when the scheduler terminates // normally. In this case we're going to fail, so instead of of // returning 50 the process will return the typical rt failure code. os::set_exit_status(50); - fail2!(); + fail!(); } diff --git a/src/test/run-fail/rt-set-exit-status-fail2.rs b/src/test/run-fail/rt-set-exit-status-fail2.rs index 493420e3ee62..ea70bb0eab9a 100644 --- a/src/test/run-fail/rt-set-exit-status-fail2.rs +++ b/src/test/run-fail/rt-set-exit-status-fail2.rs @@ -33,9 +33,9 @@ fn r(x:int) -> r { } fn main() { - error2!("whatever"); + error!("whatever"); do task::spawn { let _i = r(5); }; - fail2!(); + fail!(); } diff --git a/src/test/run-fail/rt-set-exit-status.rs b/src/test/run-fail/rt-set-exit-status.rs index 4dc1386d850d..915e9010b3e0 100644 --- a/src/test/run-fail/rt-set-exit-status.rs +++ b/src/test/run-fail/rt-set-exit-status.rs @@ -13,7 +13,7 @@ use std::os; fn main() { - error2!("whatever"); + error!("whatever"); // 101 is the code the runtime uses on task failure and the value // compiletest expects run-fail tests to return. os::set_exit_status(101); diff --git a/src/test/run-fail/run-unexported-tests.rs b/src/test/run-fail/run-unexported-tests.rs index 622e2e326e56..e9d3c41faa6c 100644 --- a/src/test/run-fail/run-unexported-tests.rs +++ b/src/test/run-fail/run-unexported-tests.rs @@ -17,5 +17,5 @@ mod m { pub fn exported() { } #[test] - fn unexported() { fail2!("runned an unexported test"); } + fn unexported() { fail!("runned an unexported test"); } } diff --git a/src/test/run-fail/spawnfail.rs b/src/test/run-fail/spawnfail.rs index dad8ead8d65a..122ea901805b 100644 --- a/src/test/run-fail/spawnfail.rs +++ b/src/test/run-fail/spawnfail.rs @@ -17,7 +17,7 @@ use std::task; // We don't want to see any invalid reads fn main() { fn f() { - fail2!(); + fail!(); } task::spawn(|| f() ); } diff --git a/src/test/run-fail/task-comm-recv-block.rs b/src/test/run-fail/task-comm-recv-block.rs index 840db545dec7..fb2d90e99cf1 100644 --- a/src/test/run-fail/task-comm-recv-block.rs +++ b/src/test/run-fail/task-comm-recv-block.rs @@ -16,7 +16,7 @@ use std::task; fn goodfail() { task::deschedule(); - fail2!("goodfail"); + fail!("goodfail"); } fn main() { @@ -25,5 +25,5 @@ fn main() { // We shouldn't be able to get past this recv since there's no // message available let i: int = po.recv(); - fail2!("badfail"); + fail!("badfail"); } diff --git a/src/test/run-fail/tls-exit-status.rs b/src/test/run-fail/tls-exit-status.rs index 419d8c1320f9..1858ceb28364 100644 --- a/src/test/run-fail/tls-exit-status.rs +++ b/src/test/run-fail/tls-exit-status.rs @@ -15,5 +15,5 @@ use std::os; fn main() { os::args(); - fail2!("please have a nonzero exit status"); + fail!("please have a nonzero exit status"); } diff --git a/src/test/run-fail/unique-fail.rs b/src/test/run-fail/unique-fail.rs index d1d816f7f793..86fde5b7f978 100644 --- a/src/test/run-fail/unique-fail.rs +++ b/src/test/run-fail/unique-fail.rs @@ -9,4 +9,4 @@ // except according to those terms. // error-pattern: fail -fn main() { ~fail2!(); } +fn main() { ~fail!(); } diff --git a/src/test/run-fail/unwind-box-fn-unique.rs b/src/test/run-fail/unwind-box-fn-unique.rs index 0050002a22e8..30b54b3dfcc1 100644 --- a/src/test/run-fail/unwind-box-fn-unique.rs +++ b/src/test/run-fail/unwind-box-fn-unique.rs @@ -11,14 +11,14 @@ // error-pattern:fail fn failfn() { - fail2!(); + fail!(); } fn main() { let y = ~0; let x: @~fn() = @(|| { - error2!("{:?}", y.clone()); + error!("{:?}", y.clone()); }); failfn(); - error2!("{:?}", x); + error!("{:?}", x); } diff --git a/src/test/run-fail/unwind-box-res.rs b/src/test/run-fail/unwind-box-res.rs index 02d2218f536d..f0d6e1c18826 100644 --- a/src/test/run-fail/unwind-box-res.rs +++ b/src/test/run-fail/unwind-box-res.rs @@ -13,7 +13,7 @@ use std::cast; fn failfn() { - fail2!(); + fail!(); } struct r { @@ -41,6 +41,6 @@ fn main() { cast::forget(i1); let x = @r(i1p); failfn(); - error2!("{:?}", x); + error!("{:?}", x); } } diff --git a/src/test/run-fail/unwind-box-str.rs b/src/test/run-fail/unwind-box-str.rs index 2086a23c6af7..a30f2bfab0a4 100644 --- a/src/test/run-fail/unwind-box-str.rs +++ b/src/test/run-fail/unwind-box-str.rs @@ -11,11 +11,11 @@ // error-pattern:fail fn failfn() { - fail2!(); + fail!(); } fn main() { let x = @~"hi"; failfn(); - error2!("{:?}", x); + error!("{:?}", x); } diff --git a/src/test/run-fail/unwind-box-trait.rs b/src/test/run-fail/unwind-box-trait.rs index b8534483fb52..66dac6a98a98 100644 --- a/src/test/run-fail/unwind-box-trait.rs +++ b/src/test/run-fail/unwind-box-trait.rs @@ -11,7 +11,7 @@ // error-pattern:fail fn failfn() { - fail2!(); + fail!(); } trait i { @@ -25,5 +25,5 @@ impl i for ~int { fn main() { let x = @~0 as @i; failfn(); - error2!("{:?}", x); + error!("{:?}", x); } diff --git a/src/test/run-fail/unwind-box-unique-unique.rs b/src/test/run-fail/unwind-box-unique-unique.rs index 3abf5330e408..fc8e3a793d2c 100644 --- a/src/test/run-fail/unwind-box-unique-unique.rs +++ b/src/test/run-fail/unwind-box-unique-unique.rs @@ -11,11 +11,11 @@ // error-pattern:fail fn failfn() { - fail2!(); + fail!(); } fn main() { let x = @~~0; failfn(); - error2!("{:?}", x); + error!("{:?}", x); } diff --git a/src/test/run-fail/unwind-box-unique.rs b/src/test/run-fail/unwind-box-unique.rs index 5b3bf74f89e2..15925dc475e8 100644 --- a/src/test/run-fail/unwind-box-unique.rs +++ b/src/test/run-fail/unwind-box-unique.rs @@ -11,11 +11,11 @@ // error-pattern:fail fn failfn() { - fail2!(); + fail!(); } fn main() { let x = @~0; failfn(); - error2!("{:?}", x); + error!("{:?}", x); } diff --git a/src/test/run-fail/unwind-box-vec.rs b/src/test/run-fail/unwind-box-vec.rs index 3b767839a0dd..18b4cebaa339 100644 --- a/src/test/run-fail/unwind-box-vec.rs +++ b/src/test/run-fail/unwind-box-vec.rs @@ -11,11 +11,11 @@ // error-pattern:fail fn failfn() { - fail2!(); + fail!(); } fn main() { let x = @~[0, 1, 2, 3, 4, 5]; failfn(); - error2!("{:?}", x); + error!("{:?}", x); } diff --git a/src/test/run-fail/unwind-box.rs b/src/test/run-fail/unwind-box.rs index 0b144b6c1edd..21308945253b 100644 --- a/src/test/run-fail/unwind-box.rs +++ b/src/test/run-fail/unwind-box.rs @@ -11,7 +11,7 @@ // error-pattern:fail fn failfn() { - fail2!(); + fail!(); } fn main() { diff --git a/src/test/run-fail/unwind-fail.rs b/src/test/run-fail/unwind-fail.rs index df6c2be860f7..4d4bc0d53eba 100644 --- a/src/test/run-fail/unwind-fail.rs +++ b/src/test/run-fail/unwind-fail.rs @@ -12,5 +12,5 @@ fn main() { @0; - fail2!(); + fail!(); } diff --git a/src/test/run-fail/unwind-initializer-indirect.rs b/src/test/run-fail/unwind-initializer-indirect.rs index 8a71d1d34560..fd1ab88ff964 100644 --- a/src/test/run-fail/unwind-initializer-indirect.rs +++ b/src/test/run-fail/unwind-initializer-indirect.rs @@ -10,7 +10,7 @@ // error-pattern:fail -fn f() -> @int { fail2!(); } +fn f() -> @int { fail!(); } fn main() { let _a: @int = f(); diff --git a/src/test/run-fail/unwind-initializer.rs b/src/test/run-fail/unwind-initializer.rs index a4161ad424b1..0d1584f3dc8d 100644 --- a/src/test/run-fail/unwind-initializer.rs +++ b/src/test/run-fail/unwind-initializer.rs @@ -12,6 +12,6 @@ fn main() { let _a: @int = { - fail2!(); + fail!(); }; } diff --git a/src/test/run-fail/unwind-interleaved.rs b/src/test/run-fail/unwind-interleaved.rs index cfd8d555c2e8..365204d5c9e4 100644 --- a/src/test/run-fail/unwind-interleaved.rs +++ b/src/test/run-fail/unwind-interleaved.rs @@ -12,7 +12,7 @@ fn a() { } -fn b() { fail2!(); } +fn b() { fail!(); } fn main() { let _x = ~[0]; diff --git a/src/test/run-fail/unwind-iter.rs b/src/test/run-fail/unwind-iter.rs index 4c9125bde99c..51c6cb3adf31 100644 --- a/src/test/run-fail/unwind-iter.rs +++ b/src/test/run-fail/unwind-iter.rs @@ -14,7 +14,7 @@ #[allow(unused_variable)]; fn x(it: &fn(int)) { - fail2!(); + fail!(); it(0); } diff --git a/src/test/run-fail/unwind-iter2.rs b/src/test/run-fail/unwind-iter2.rs index 11fbcfaff78c..17936df6959f 100644 --- a/src/test/run-fail/unwind-iter2.rs +++ b/src/test/run-fail/unwind-iter2.rs @@ -16,5 +16,5 @@ fn x(it: &fn(int)) { } fn main() { - x(|_x| fail2!() ); + x(|_x| fail!() ); } diff --git a/src/test/run-fail/unwind-lambda.rs b/src/test/run-fail/unwind-lambda.rs index 4857a38519c1..65d9fce5ff5d 100644 --- a/src/test/run-fail/unwind-lambda.rs +++ b/src/test/run-fail/unwind-lambda.rs @@ -22,7 +22,7 @@ fn main() { let cheese = cheese.clone(); let f: &fn() = || { let _chew = mush + cheese; - fail2!("so yummy") + fail!("so yummy") }; f(); }); diff --git a/src/test/run-fail/unwind-match.rs b/src/test/run-fail/unwind-match.rs index c017ddc49f0f..a9761017c73f 100644 --- a/src/test/run-fail/unwind-match.rs +++ b/src/test/run-fail/unwind-match.rs @@ -15,7 +15,7 @@ fn test_box() { } fn test_str() { let res = match false { true => { ~"happy" }, - _ => fail2!("non-exhaustive match failure") }; + _ => fail!("non-exhaustive match failure") }; assert_eq!(res, ~"happy"); } fn main() { diff --git a/src/test/run-fail/unwind-misc-1.rs b/src/test/run-fail/unwind-misc-1.rs index dc5e5a3b9956..d215927c7d03 100644 --- a/src/test/run-fail/unwind-misc-1.rs +++ b/src/test/run-fail/unwind-misc-1.rs @@ -19,7 +19,7 @@ fn main() { arr.push(@~"key stuff"); map.insert(arr.clone(), arr + &[@~"value stuff"]); if arr.len() == 5 { - fail2!(); + fail!(); } } } diff --git a/src/test/run-fail/unwind-move.rs b/src/test/run-fail/unwind-move.rs index 626228cd2259..8f1b34d17cd9 100644 --- a/src/test/run-fail/unwind-move.rs +++ b/src/test/run-fail/unwind-move.rs @@ -10,7 +10,7 @@ // error-pattern:fail fn f(_a: @int) { - fail2!(); + fail!(); } fn main() { diff --git a/src/test/run-fail/unwind-nested.rs b/src/test/run-fail/unwind-nested.rs index ae543c9a88c4..f8a63be2e9ad 100644 --- a/src/test/run-fail/unwind-nested.rs +++ b/src/test/run-fail/unwind-nested.rs @@ -15,7 +15,7 @@ fn main() { { let _b = @0; { - fail2!(); + fail!(); } } } diff --git a/src/test/run-fail/unwind-partial-box.rs b/src/test/run-fail/unwind-partial-box.rs index 933bd62bc0ca..88f71a5ed7ce 100644 --- a/src/test/run-fail/unwind-partial-box.rs +++ b/src/test/run-fail/unwind-partial-box.rs @@ -10,7 +10,7 @@ // error-pattern:fail -fn f() -> ~[int] { fail2!(); } +fn f() -> ~[int] { fail!(); } // Voodoo. In unwind-alt we had to do this to trigger the bug. Might // have been to do with memory allocation patterns. diff --git a/src/test/run-fail/unwind-partial-unique.rs b/src/test/run-fail/unwind-partial-unique.rs index b627103485ca..e9bbbd46c03f 100644 --- a/src/test/run-fail/unwind-partial-unique.rs +++ b/src/test/run-fail/unwind-partial-unique.rs @@ -10,7 +10,7 @@ // error-pattern:fail -fn f() -> ~[int] { fail2!(); } +fn f() -> ~[int] { fail!(); } // Voodoo. In unwind-alt we had to do this to trigger the bug. Might // have been to do with memory allocation patterns. diff --git a/src/test/run-fail/unwind-partial-vec.rs b/src/test/run-fail/unwind-partial-vec.rs index 348989659067..3d6d26937dba 100644 --- a/src/test/run-fail/unwind-partial-vec.rs +++ b/src/test/run-fail/unwind-partial-vec.rs @@ -10,7 +10,7 @@ // error-pattern:fail -fn f() -> ~[int] { fail2!(); } +fn f() -> ~[int] { fail!(); } // Voodoo. In unwind-alt we had to do this to trigger the bug. Might // have been to do with memory allocation patterns. diff --git a/src/test/run-fail/unwind-rec.rs b/src/test/run-fail/unwind-rec.rs index 3858fe3923f1..016654500b4a 100644 --- a/src/test/run-fail/unwind-rec.rs +++ b/src/test/run-fail/unwind-rec.rs @@ -11,7 +11,7 @@ // error-pattern:fail fn build() -> ~[int] { - fail2!(); + fail!(); } struct Blk { node: ~[int] } diff --git a/src/test/run-fail/unwind-rec2.rs b/src/test/run-fail/unwind-rec2.rs index a5aaf46b4b2e..49a35181a8b2 100644 --- a/src/test/run-fail/unwind-rec2.rs +++ b/src/test/run-fail/unwind-rec2.rs @@ -15,7 +15,7 @@ fn build1() -> ~[int] { } fn build2() -> ~[int] { - fail2!(); + fail!(); } struct Blk { node: ~[int], span: ~[int] } diff --git a/src/test/run-fail/unwind-resource-fail.rs b/src/test/run-fail/unwind-resource-fail.rs index 5b9917979694..6526455b8e2e 100644 --- a/src/test/run-fail/unwind-resource-fail.rs +++ b/src/test/run-fail/unwind-resource-fail.rs @@ -15,7 +15,7 @@ struct r { } impl Drop for r { - fn drop(&mut self) { fail2!("squirrel") } + fn drop(&mut self) { fail!("squirrel") } } fn r(i: int) -> r { r { i: i } } diff --git a/src/test/run-fail/unwind-resource-fail2.rs b/src/test/run-fail/unwind-resource-fail2.rs index 652bf31dee40..67e1d0e8f92a 100644 --- a/src/test/run-fail/unwind-resource-fail2.rs +++ b/src/test/run-fail/unwind-resource-fail2.rs @@ -16,7 +16,7 @@ struct r { } impl Drop for r { - fn drop(&mut self) { fail2!("wombat") } + fn drop(&mut self) { fail!("wombat") } } fn r(i: int) -> r { r { i: i } } @@ -24,5 +24,5 @@ fn r(i: int) -> r { r { i: i } } fn main() { @0; let r = r(0); - fail2!(); + fail!(); } diff --git a/src/test/run-fail/unwind-resource-fail3.rs b/src/test/run-fail/unwind-resource-fail3.rs index 92b10cef3199..231f6e7b7d57 100644 --- a/src/test/run-fail/unwind-resource-fail3.rs +++ b/src/test/run-fail/unwind-resource-fail3.rs @@ -20,7 +20,7 @@ fn faily_box(i: @int) -> faily_box { faily_box { i: i } } #[unsafe_destructor] impl Drop for faily_box { fn drop(&mut self) { - fail2!("quux"); + fail!("quux"); } } diff --git a/src/test/run-fail/unwind-stacked.rs b/src/test/run-fail/unwind-stacked.rs index ab28cb8a9ee4..8249807af74a 100644 --- a/src/test/run-fail/unwind-stacked.rs +++ b/src/test/run-fail/unwind-stacked.rs @@ -12,7 +12,7 @@ fn f() { let _a = @0; - fail2!(); + fail!(); } fn g() { diff --git a/src/test/run-fail/unwind-tup.rs b/src/test/run-fail/unwind-tup.rs index efb69b9f9576..15fa3ceed535 100644 --- a/src/test/run-fail/unwind-tup.rs +++ b/src/test/run-fail/unwind-tup.rs @@ -11,7 +11,7 @@ // error-pattern:fail fn fold_local() -> @~[int]{ - fail2!(); + fail!(); } fn main() { diff --git a/src/test/run-fail/unwind-tup2.rs b/src/test/run-fail/unwind-tup2.rs index 20d394bafac8..236ff8172207 100644 --- a/src/test/run-fail/unwind-tup2.rs +++ b/src/test/run-fail/unwind-tup2.rs @@ -15,7 +15,7 @@ fn fold_local() -> @~[int]{ } fn fold_remote() -> @~[int]{ - fail2!(); + fail!(); } fn main() { diff --git a/src/test/run-fail/unwind-uninitialized.rs b/src/test/run-fail/unwind-uninitialized.rs index d61a4927db8b..d5a06ffb9036 100644 --- a/src/test/run-fail/unwind-uninitialized.rs +++ b/src/test/run-fail/unwind-uninitialized.rs @@ -11,7 +11,7 @@ // error-pattern:fail fn f() { - fail2!(); + fail!(); } fn main() { diff --git a/src/test/run-fail/unwind-unique.rs b/src/test/run-fail/unwind-unique.rs index 9ede24d28c48..53b2a55602c2 100644 --- a/src/test/run-fail/unwind-unique.rs +++ b/src/test/run-fail/unwind-unique.rs @@ -11,7 +11,7 @@ // error-pattern:fail fn failfn() { - fail2!(); + fail!(); } fn main() { diff --git a/src/test/run-fail/while-body-fails.rs b/src/test/run-fail/while-body-fails.rs index c0a1033efe04..32e1425b28c8 100644 --- a/src/test/run-fail/while-body-fails.rs +++ b/src/test/run-fail/while-body-fails.rs @@ -11,4 +11,4 @@ #[allow(while_true)]; // error-pattern:quux -fn main() { let _x: int = { while true { fail2!("quux"); } ; 8 } ; } +fn main() { let _x: int = { while true { fail!("quux"); } ; 8 } ; } diff --git a/src/test/run-fail/while-fail.rs b/src/test/run-fail/while-fail.rs index e42cb5e778cf..a0b437814fd8 100644 --- a/src/test/run-fail/while-fail.rs +++ b/src/test/run-fail/while-fail.rs @@ -12,5 +12,5 @@ // error-pattern:giraffe fn main() { - fail2!({ while true { fail2!("giraffe") }; "clandestine" }); + fail!({ while true { fail!("giraffe") }; "clandestine" }); } 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 873eb66e52e6..f1bc4e9a87f4 100644 --- a/src/test/run-pass/alignment-gep-tup-like-1.rs +++ b/src/test/run-pass/alignment-gep-tup-like-1.rs @@ -36,7 +36,7 @@ fn f(a: A, b: u16) -> @Invokable { pub fn main() { let (a, b) = f(22_u64, 44u16).f(); - info2!("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 7c43385ed616..5491baf35267 100644 --- a/src/test/run-pass/alignment-gep-tup-like-2.rs +++ b/src/test/run-pass/alignment-gep-tup-like-2.rs @@ -55,7 +55,7 @@ pub fn main() { let z = f(~x, y); make_cycle(z); let (a, b) = z.f(); - info2!("a={} b={}", *a as uint, b as uint); + info!("a={} b={}", *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 9944241836b5..5cbd0da23cf7 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; - info2!("{}", 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 db8f0eac4f6b..0b3492784c87 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); - info2!("{}", 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/attr-main-2.rs b/src/test/run-pass/attr-main-2.rs index 6078698ebd6b..741f70066333 100644 --- a/src/test/run-pass/attr-main-2.rs +++ b/src/test/run-pass/attr-main-2.rs @@ -11,7 +11,7 @@ // xfail-fast pub fn main() { - fail2!() + fail!() } #[main] diff --git a/src/test/run-pass/auto-instantiate.rs b/src/test/run-pass/auto-instantiate.rs index d8399848e09e..b7e3de478a4e 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() { - info2!("{:?}", f(Triple {x: 3, y: 4, z: 5}, 4).a.x); - info2!("{:?}", 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/binary-minus-without-space.rs b/src/test/run-pass/binary-minus-without-space.rs index f312cdae8bde..78edf3e112e9 100644 --- a/src/test/run-pass/binary-minus-without-space.rs +++ b/src/test/run-pass/binary-minus-without-space.rs @@ -11,6 +11,6 @@ // Check that issue #954 stays fixed pub fn main() { - match -1 { -1 => {}, _ => fail2!("wat") } + match -1 { -1 => {}, _ => fail!("wat") } assert_eq!(1-1, 0); } diff --git a/src/test/run-pass/bind-by-move.rs b/src/test/run-pass/bind-by-move.rs index ad5573889dd3..a7a4aa9885e6 100644 --- a/src/test/run-pass/bind-by-move.rs +++ b/src/test/run-pass/bind-by-move.rs @@ -18,6 +18,6 @@ pub fn main() { let x = Some(p); match x { Some(z) => { dispose(z); }, - None => fail2!() + None => fail!() } } diff --git a/src/test/run-pass/binops.rs b/src/test/run-pass/binops.rs index 10a7355c91d0..2fe39dc624c9 100644 --- a/src/test/run-pass/binops.rs +++ b/src/test/run-pass/binops.rs @@ -81,7 +81,7 @@ fn test_class() { let mut r = p(1, 2); unsafe { - error2!("q = {:x}, r = {:x}", + error!("q = {:x}, r = {:x}", (::std::cast::transmute::<*p, uint>(&q)), (::std::cast::transmute::<*p, uint>(&r))); } diff --git a/src/test/run-pass/bitwise.rs b/src/test/run-pass/bitwise.rs index b99067419b06..169b3848c634 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; - info2!("{}", a); - info2!("{}", 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/block-arg.rs b/src/test/run-pass/block-arg.rs index c296a37a17ce..0608285db1e8 100644 --- a/src/test/run-pass/block-arg.rs +++ b/src/test/run-pass/block-arg.rs @@ -14,7 +14,7 @@ pub fn main() { // Statement form does not require parentheses: for i in v.iter() { - info2!("{:?}", *i); + info!("{:?}", *i); } // Usable at all: @@ -35,14 +35,14 @@ pub fn main() { assert!(false); } match do v.iter().all |e| { e.is_negative() } { - true => { fail2!("incorrect answer."); } + true => { fail!("incorrect answer."); } false => { } } match 3 { _ if do v.iter().any |e| { e.is_negative() } => { } _ => { - fail2!("wrong answer."); + fail!("wrong answer."); } } diff --git a/src/test/run-pass/block-explicit-types.rs b/src/test/run-pass/block-explicit-types.rs index 1931ec589ac1..379fced1d334 100644 --- a/src/test/run-pass/block-explicit-types.rs +++ b/src/test/run-pass/block-explicit-types.rs @@ -10,5 +10,5 @@ pub fn main() { fn as_buf(s: ~str, f: &fn(~str) -> T) -> T { f(s) } - as_buf(~"foo", |foo: ~str| -> () error2!("{}", foo) ); + as_buf(~"foo", |foo: ~str| -> () error!("{}", foo) ); } diff --git a/src/test/run-pass/block-iter-1.rs b/src/test/run-pass/block-iter-1.rs index 806ed035d5a0..a977eb40992b 100644 --- a/src/test/run-pass/block-iter-1.rs +++ b/src/test/run-pass/block-iter-1.rs @@ -20,6 +20,6 @@ pub fn main() { odds += 1; } }); - error2!("{:?}", odds); + error!("{:?}", odds); assert_eq!(odds, 4); } diff --git a/src/test/run-pass/block-iter-2.rs b/src/test/run-pass/block-iter-2.rs index c84033e5bde0..e5ea54c2a3eb 100644 --- a/src/test/run-pass/block-iter-2.rs +++ b/src/test/run-pass/block-iter-2.rs @@ -20,6 +20,6 @@ pub fn main() { sum += *i * *j; }); }); - error2!("{:?}", sum); + error!("{:?}", sum); assert_eq!(sum, 225); } diff --git a/src/test/run-pass/borrowck-macro-interaction-issue-6304.rs b/src/test/run-pass/borrowck-macro-interaction-issue-6304.rs index 2c4d007cb1a2..1490d6790496 100644 --- a/src/test/run-pass/borrowck-macro-interaction-issue-6304.rs +++ b/src/test/run-pass/borrowck-macro-interaction-issue-6304.rs @@ -21,11 +21,11 @@ impl Foo { ); match s { ~Bar2(id, rest) => declare!(id, self.elaborate_stm(rest)), - _ => fail2!() + _ => fail!() } } - fn check_id(&mut self, s: int) { fail2!() } + fn check_id(&mut self, s: int) { fail!() } } pub fn main() { } diff --git a/src/test/run-pass/borrowck-mut-uniq.rs b/src/test/run-pass/borrowck-mut-uniq.rs index 8ff326ed8706..9057ebf7983f 100644 --- a/src/test/run-pass/borrowck-mut-uniq.rs +++ b/src/test/run-pass/borrowck-mut-uniq.rs @@ -31,9 +31,9 @@ pub fn main() { add_int(ints, 44); do iter_ints(ints) |i| { - error2!("int = {}", *i); + error!("int = {}", *i); true }; - error2!("ints={:?}", ints); + error!("ints={:?}", ints); } 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 4be38df939b7..c155563d8d06 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}; - info2!("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 ddc1d6186974..214753c009cd 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}; - info2!("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 dc389ed1bc8c..fd5f8c0868c6 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}; - info2!("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 139466bf40aa..239dd4c6dc43 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}; - info2!("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 f852f36d6337..8a97e8f1b5ca 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; - info2!("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 b9428daf152b..055a924cf04e 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; } - info2!("*r = {}, exp = {}", *r, exp); + info!("*r = {}, exp = {}", *r, exp); assert_eq!(*r, exp); x = @5; y = @6; - info2!("*r = {}, exp = {}", *r, exp); + info!("*r = {}, exp = {}", *r, exp); assert_eq!(*r, exp); assert_eq!(x, @5); assert_eq!(y, @6); diff --git a/src/test/run-pass/borrowck-preserve-expl-deref.rs b/src/test/run-pass/borrowck-preserve-expl-deref.rs index fec857574931..a0010d361909 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}; - info2!("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-unary-move-2.rs b/src/test/run-pass/borrowck-unary-move-2.rs index 6d16fd838f85..87d42943fac9 100644 --- a/src/test/run-pass/borrowck-unary-move-2.rs +++ b/src/test/run-pass/borrowck-unary-move-2.rs @@ -14,7 +14,7 @@ struct noncopyable { impl Drop for noncopyable { fn drop(&mut self) { - error2!("dropped"); + error!("dropped"); } } diff --git a/src/test/run-pass/box-inside-if.rs b/src/test/run-pass/box-inside-if.rs index 249e9a47164c..ea2b7d58a111 100644 --- a/src/test/run-pass/box-inside-if.rs +++ b/src/test/run-pass/box-inside-if.rs @@ -19,7 +19,7 @@ fn is_odd(_n: int) -> bool { return true; } fn length_is_even(_vs: @int) -> bool { return true; } fn foo(_acc: int, n: int) { - if is_odd(n) && length_is_even(some_box(1)) { error2!("bloop"); } + if is_odd(n) && length_is_even(some_box(1)) { error!("bloop"); } } pub fn main() { foo(67, 5); } diff --git a/src/test/run-pass/box-inside-if2.rs b/src/test/run-pass/box-inside-if2.rs index a4563c33331b..53b468470609 100644 --- a/src/test/run-pass/box-inside-if2.rs +++ b/src/test/run-pass/box-inside-if2.rs @@ -19,7 +19,7 @@ fn is_odd(_n: int) -> bool { return true; } fn length_is_even(_vs: @int) -> bool { return true; } fn foo(_acc: int, n: int) { - if is_odd(n) || length_is_even(some_box(1)) { error2!("bloop"); } + if is_odd(n) || length_is_even(some_box(1)) { error!("bloop"); } } pub fn main() { foo(67, 5); } diff --git a/src/test/run-pass/box-unbox.rs b/src/test/run-pass/box-unbox.rs index f5d522470d36..2e92395d5490 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 (*b.c).clone(); } pub fn main() { let foo: int = 17; let bfoo: Box = Box {c: @foo}; - info2!("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/boxed-class-type-substitution.rs b/src/test/run-pass/boxed-class-type-substitution.rs index e9be0904d4e9..81bd3b6c139e 100644 --- a/src/test/run-pass/boxed-class-type-substitution.rs +++ b/src/test/run-pass/boxed-class-type-substitution.rs @@ -15,7 +15,7 @@ struct Tree { parent: Option } -fn empty() -> Tree { fail2!() } +fn empty() -> Tree { fail!() } struct Box { tree: Tree<@Box> diff --git a/src/test/run-pass/cast-region-to-uint.rs b/src/test/run-pass/cast-region-to-uint.rs index 69ca1584c12f..2a3f79e82459 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; - info2!("&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 3db000accec7..fe57d6b3fecf 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); - info2!("r={}", r); + info!("r={}", r); assert_eq!(r, 22u); } diff --git a/src/test/run-pass/class-attributes-1.rs b/src/test/run-pass/class-attributes-1.rs index 3e7cae395d48..97b3eda5eff6 100644 --- a/src/test/run-pass/class-attributes-1.rs +++ b/src/test/run-pass/class-attributes-1.rs @@ -16,7 +16,7 @@ struct cat { impl Drop for cat { #[cat_dropper] - fn drop(&mut self) { error2!("{} landed on hir feet" , self . name); } + fn drop(&mut self) { error!("{} landed on hir feet" , self . name); } } diff --git a/src/test/run-pass/class-attributes-2.rs b/src/test/run-pass/class-attributes-2.rs index 0a3f1539333c..fa498e90503e 100644 --- a/src/test/run-pass/class-attributes-2.rs +++ b/src/test/run-pass/class-attributes-2.rs @@ -18,7 +18,7 @@ impl Drop for cat { Actually, cats don't always land on their feet when you drop them. */ fn drop(&mut self) { - error2!("{} landed on hir feet", self.name); + error!("{} landed on hir feet", self.name); } } 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 bdba6a4c6c67..52ba13595416 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::cat; fn print_out(thing: @ToStr, expected: ~str) { let actual = thing.to_str(); - info2!("{}", actual); + info!("{}", 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 3828fbd43950..a259ee8ffde4 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 @@ -20,7 +20,7 @@ struct dog { impl dog { fn bark(&self) -> int { - info2!("Woof {} {}", *self.barks, *self.volume); + info!("Woof {} {}", *self.barks, *self.volume); *self.barks += 1u; if *self.barks % 3u == 0u { *self.volume += 1; @@ -28,7 +28,7 @@ impl dog { if *self.barks % 10u == 0u { *self.volume -= 2; } - info2!("Grrr {} {}", *self.barks, *self.volume); + info!("Grrr {} {}", *self.barks, *self.volume); *self.volume } } @@ -62,7 +62,7 @@ impl cat { impl cat { fn meow(&self) -> uint { - info2!("Meow"); + info!("Meow"); *self.meows += 1u; if *self.meows % 5u == 0u { *self.how_hungry += 1; diff --git a/src/test/run-pass/class-cast-to-trait.rs b/src/test/run-pass/class-cast-to-trait.rs index 69a94e09d5f3..737253a956fc 100644 --- a/src/test/run-pass/class-cast-to-trait.rs +++ b/src/test/run-pass/class-cast-to-trait.rs @@ -25,12 +25,12 @@ impl noisy for cat { impl cat { pub fn eat(&mut self) -> bool { if self.how_hungry > 0 { - error2!("OM NOM NOM"); + error!("OM NOM NOM"); self.how_hungry -= 2; return true; } else { - error2!("Not hungry!"); + error!("Not hungry!"); return false; } } @@ -38,7 +38,7 @@ impl cat { impl cat { fn meow(&mut self) { - error2!("Meow"); + error!("Meow"); self.meows += 1u; if self.meows % 5u == 0u { self.how_hungry += 1; diff --git a/src/test/run-pass/class-impl-very-parameterized-trait.rs b/src/test/run-pass/class-impl-very-parameterized-trait.rs index baa82dbb2deb..918547a3a2ba 100644 --- a/src/test/run-pass/class-impl-very-parameterized-trait.rs +++ b/src/test/run-pass/class-impl-very-parameterized-trait.rs @@ -38,11 +38,11 @@ impl cat { pub fn eat(&mut self) -> bool { if self.how_hungry > 0 { - error2!("OM NOM NOM"); + error!("OM NOM NOM"); self.how_hungry -= 2; return true; } else { - error2!("Not hungry!"); + error!("Not hungry!"); return false; } } @@ -75,7 +75,7 @@ impl MutableMap for cat { true } - fn find_mut<'a>(&'a mut self, _k: &int) -> Option<&'a mut T> { fail2!() } + fn find_mut<'a>(&'a mut self, _k: &int) -> Option<&'a mut T> { fail!() } fn remove(&mut self, k: &int) -> bool { if self.find(k).is_some() { @@ -85,16 +85,16 @@ impl MutableMap for cat { } } - fn pop(&mut self, _k: &int) -> Option { fail2!() } + fn pop(&mut self, _k: &int) -> Option { fail!() } - fn swap(&mut self, _k: int, _v: T) -> Option { fail2!() } + fn swap(&mut self, _k: int, _v: T) -> Option { fail!() } } impl cat { pub fn get<'a>(&'a self, k: &int) -> &'a T { match self.find(k) { Some(v) => { v } - None => { fail2!("epic fail"); } + None => { fail!("epic fail"); } } } @@ -106,7 +106,7 @@ impl cat { impl cat { fn meow(&mut self) { self.meows += 1; - error2!("Meow {}", self.meows); + error!("Meow {}", self.meows); if self.meows % 5 == 0 { self.how_hungry += 1; } diff --git a/src/test/run-pass/class-implement-trait-cross-crate.rs b/src/test/run-pass/class-implement-trait-cross-crate.rs index d6477d2d5a5c..88051e18c30f 100644 --- a/src/test/run-pass/class-implement-trait-cross-crate.rs +++ b/src/test/run-pass/class-implement-trait-cross-crate.rs @@ -23,12 +23,12 @@ struct cat { impl cat { pub fn eat(&mut self) -> bool { if self.how_hungry > 0 { - error2!("OM NOM NOM"); + error!("OM NOM NOM"); self.how_hungry -= 2; return true; } else { - error2!("Not hungry!"); + error!("Not hungry!"); return false; } } @@ -40,7 +40,7 @@ impl noisy for cat { impl cat { fn meow(&mut self) { - error2!("Meow"); + error!("Meow"); self.meows += 1u; if self.meows % 5u == 0u { self.how_hungry += 1; diff --git a/src/test/run-pass/class-implement-traits.rs b/src/test/run-pass/class-implement-traits.rs index 1433b5a8024c..433d7f7a22ff 100644 --- a/src/test/run-pass/class-implement-traits.rs +++ b/src/test/run-pass/class-implement-traits.rs @@ -24,7 +24,7 @@ struct cat { impl cat { fn meow(&mut self) { - error2!("Meow"); + error!("Meow"); self.meows += 1u; if self.meows % 5u == 0u { self.how_hungry += 1; @@ -35,11 +35,11 @@ impl cat { impl cat { pub fn eat(&mut self) -> bool { if self.how_hungry > 0 { - error2!("OM NOM NOM"); + error!("OM NOM NOM"); self.how_hungry -= 2; return true; } else { - error2!("Not hungry!"); + error!("Not hungry!"); return false; } } diff --git a/src/test/run-pass/class-separate-impl.rs b/src/test/run-pass/class-separate-impl.rs index 5ef0569cf10e..e16aa7060495 100644 --- a/src/test/run-pass/class-separate-impl.rs +++ b/src/test/run-pass/class-separate-impl.rs @@ -21,12 +21,12 @@ impl cat { pub fn eat(&mut self) -> bool { if self.how_hungry > 0 { - error2!("OM NOM NOM"); + error!("OM NOM NOM"); self.how_hungry -= 2; return true; } else { - error2!("Not hungry!"); + error!("Not hungry!"); return false; } } @@ -34,7 +34,7 @@ impl cat { impl cat { fn meow(&mut self) { - error2!("Meow"); + error!("Meow"); self.meows += 1u; if self.meows % 5u == 0u { self.how_hungry += 1; @@ -58,7 +58,7 @@ impl ToStr for cat { fn print_out(thing: @ToStr, expected: ~str) { let actual = thing.to_str(); - info2!("{}", actual); + info!("{}", actual); assert_eq!(actual, expected); } diff --git a/src/test/run-pass/classes.rs b/src/test/run-pass/classes.rs index 14acd1c91150..e5220b15520a 100644 --- a/src/test/run-pass/classes.rs +++ b/src/test/run-pass/classes.rs @@ -20,11 +20,11 @@ impl cat { pub fn eat(&mut self) -> bool { if self.how_hungry > 0 { - error2!("OM NOM NOM"); + error!("OM NOM NOM"); self.how_hungry -= 2; return true; } else { - error2!("Not hungry!"); + error!("Not hungry!"); return false; } } @@ -32,7 +32,7 @@ impl cat { impl cat { fn meow(&mut self) { - error2!("Meow"); + error!("Meow"); self.meows += 1u; if self.meows % 5u == 0u { self.how_hungry += 1; diff --git a/src/test/run-pass/cleanup-copy-mode.rs b/src/test/run-pass/cleanup-copy-mode.rs index 6381a402cfd9..70f70430bb9e 100644 --- a/src/test/run-pass/cleanup-copy-mode.rs +++ b/src/test/run-pass/cleanup-copy-mode.rs @@ -11,7 +11,7 @@ use std::task; fn adder(x: @int, y: @int) -> int { return *x + *y; } -fn failer() -> @int { fail2!(); } +fn failer() -> @int { fail!(); } pub fn main() { assert!(task::try(|| { adder(@2, failer()); () 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 4b6b3cca3340..40d8cda9c416 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 @@ -40,7 +40,7 @@ fn f(a: A, b: u16) -> @Invokable { pub fn main() { let (a, b) = f(22_u64, 44u16).f(); - info2!("a={:?} b={:?}", a, b); + info!("a={:?} b={:?}", a, b); assert_eq!(a, 22u64); assert_eq!(b, 44u16); } diff --git a/src/test/run-pass/comm.rs b/src/test/run-pass/comm.rs index 63c1f4ed3d69..a41f1fa42cd4 100644 --- a/src/test/run-pass/comm.rs +++ b/src/test/run-pass/comm.rs @@ -15,13 +15,13 @@ pub fn main() { let (p, ch) = stream(); let _t = task::spawn(|| child(&ch) ); let y = p.recv(); - error2!("received"); - error2!("{:?}", y); + error!("received"); + error!("{:?}", y); assert_eq!(y, 10); } fn child(c: &Chan) { - error2!("sending"); + error!("sending"); c.send(10); - error2!("value sent"); + error!("value sent"); } diff --git a/src/test/run-pass/complex.rs b/src/test/run-pass/complex.rs index f395c6b7151c..11599f6b1e35 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; - info2!("{}", x); - info2!("hello, world"); - info2!("{}", 10); + info!("{}", x); + info!("hello, world"); + info!("{}", 10); } diff --git a/src/test/run-pass/conditional-debug-macro-off.rs b/src/test/run-pass/conditional-debug-macro-off.rs index 17062757286e..1648b1989990 100644 --- a/src/test/run-pass/conditional-debug-macro-off.rs +++ b/src/test/run-pass/conditional-debug-macro-off.rs @@ -14,5 +14,5 @@ fn main() { // only fails if debug! evaluates its argument. - debug2!("{:?}", { if true { fail2!() } }); + debug!("{:?}", { if true { fail!() } }); } diff --git a/src/test/run-pass/conditional-debug-macro-on.rs b/src/test/run-pass/conditional-debug-macro-on.rs index dec79f0cb5b7..3842d4803273 100644 --- a/src/test/run-pass/conditional-debug-macro-on.rs +++ b/src/test/run-pass/conditional-debug-macro-on.rs @@ -14,7 +14,7 @@ fn main() { // exits early if debug! evaluates its arguments, otherwise it // will hit the fail. - debug2!("{:?}", { if true { return; } }); + debug!("{:?}", { if true { return; } }); - fail2!(); + fail!(); } diff --git a/src/test/run-pass/const-big-enum.rs b/src/test/run-pass/const-big-enum.rs index 0a5a42116b98..ac2e879ceacc 100644 --- a/src/test/run-pass/const-big-enum.rs +++ b/src/test/run-pass/const-big-enum.rs @@ -19,18 +19,18 @@ static X: Foo = Baz; pub fn main() { match X { Baz => {} - _ => fail2!() + _ => fail!() } match Y { Bar(s) => assert!(s == 2654435769), - _ => fail2!() + _ => fail!() } match Z { Quux(d,h) => { assert_eq!(d, 0x123456789abcdef0); assert_eq!(h, 0x1234); } - _ => fail2!() + _ => fail!() } } diff --git a/src/test/run-pass/const-enum-byref-self.rs b/src/test/run-pass/const-enum-byref-self.rs index 25e4b7189f27..098a001cfcde 100644 --- a/src/test/run-pass/const-enum-byref-self.rs +++ b/src/test/run-pass/const-enum-byref-self.rs @@ -15,7 +15,7 @@ impl E { pub fn method(&self) { match *self { V => {} - VV(*) => fail2!() + VV(*) => fail!() } } } diff --git a/src/test/run-pass/const-enum-byref.rs b/src/test/run-pass/const-enum-byref.rs index 22ec61f85447..83fafad4f99b 100644 --- a/src/test/run-pass/const-enum-byref.rs +++ b/src/test/run-pass/const-enum-byref.rs @@ -14,7 +14,7 @@ static C: E = V; fn f(a: &E) { match *a { V => {} - VV(*) => fail2!() + VV(*) => fail!() } } diff --git a/src/test/run-pass/const-enum-ptr.rs b/src/test/run-pass/const-enum-ptr.rs index c75d1728ca94..c1e3889d613d 100644 --- a/src/test/run-pass/const-enum-ptr.rs +++ b/src/test/run-pass/const-enum-ptr.rs @@ -14,6 +14,6 @@ static C: &'static E = &V0; pub fn main() { match *C { V0 => (), - _ => fail2!() + _ => fail!() } } diff --git a/src/test/run-pass/const-enum-structlike.rs b/src/test/run-pass/const-enum-structlike.rs index 95ba635011f8..943597fa28fa 100644 --- a/src/test/run-pass/const-enum-structlike.rs +++ b/src/test/run-pass/const-enum-structlike.rs @@ -19,7 +19,7 @@ static C: E = S1 { u: 23 }; pub fn main() { match C { - S0 { _ } => fail2!(), + S0 { _ } => fail!(), S1 { u } => assert!(u == 23) } } diff --git a/src/test/run-pass/const-enum-vec-index.rs b/src/test/run-pass/const-enum-vec-index.rs index 5b4ce1bc4efd..4c81eaae1d80 100644 --- a/src/test/run-pass/const-enum-vec-index.rs +++ b/src/test/run-pass/const-enum-vec-index.rs @@ -16,10 +16,10 @@ static C1: E = C[1]; pub fn main() { match C0 { V0 => (), - _ => fail2!() + _ => fail!() } match C1 { V1(n) => assert!(n == 0xDEADBEE), - _ => fail2!() + _ => fail!() } } diff --git a/src/test/run-pass/const-enum-vec-ptr.rs b/src/test/run-pass/const-enum-vec-ptr.rs index 8b905042f7ff..95c4ed836c76 100644 --- a/src/test/run-pass/const-enum-vec-ptr.rs +++ b/src/test/run-pass/const-enum-vec-ptr.rs @@ -14,10 +14,10 @@ static C: &'static [E] = &[V0, V1(0xDEADBEE), V0]; pub fn main() { match C[1] { V1(n) => assert!(n == 0xDEADBEE), - _ => fail2!() + _ => fail!() } match C[2] { V0 => (), - _ => fail2!() + _ => fail!() } } diff --git a/src/test/run-pass/const-enum-vector.rs b/src/test/run-pass/const-enum-vector.rs index cff5d4689e4d..3dc5b918f7f5 100644 --- a/src/test/run-pass/const-enum-vector.rs +++ b/src/test/run-pass/const-enum-vector.rs @@ -14,10 +14,10 @@ static C: [E, ..3] = [V0, V1(0xDEADBEE), V0]; pub fn main() { match C[1] { V1(n) => assert!(n == 0xDEADBEE), - _ => fail2!() + _ => fail!() } match C[2] { V0 => (), - _ => fail2!() + _ => fail!() } } diff --git a/src/test/run-pass/const-nullary-enum.rs b/src/test/run-pass/const-nullary-enum.rs index ac9a7fa6552c..bc61c8e9aecf 100644 --- a/src/test/run-pass/const-nullary-enum.rs +++ b/src/test/run-pass/const-nullary-enum.rs @@ -19,11 +19,11 @@ static X: Foo = Bar; pub fn main() { match X { Bar => {} - Baz | Boo => fail2!() + Baz | Boo => fail!() } match Y { Baz => {} - Bar | Boo => fail2!() + Bar | Boo => fail!() } } diff --git a/src/test/run-pass/const.rs b/src/test/run-pass/const.rs index 5696c163fc57..fe060ff482e7 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() { info2!("{}", i); } +pub fn main() { info!("{}", i); } diff --git a/src/test/run-pass/core-rt-smoke.rs b/src/test/run-pass/core-rt-smoke.rs index 0260edf1182c..6e3d9629da04 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) -> int { do std::rt::start(argc, argv) { - info2!("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 9a2819c22937..2749fc31ceab 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; } info2!("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 bc0b51c6b5d5..e7a307c4a22a 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; info2!("{:?}", *x); } +pub fn main() { let x = @mut 5; *x = 1000; info!("{:?}", *x); } diff --git a/src/test/run-pass/deriving-cmp-shortcircuit.rs b/src/test/run-pass/deriving-cmp-shortcircuit.rs index 940ddc31f46a..431c856ee88a 100644 --- a/src/test/run-pass/deriving-cmp-shortcircuit.rs +++ b/src/test/run-pass/deriving-cmp-shortcircuit.rs @@ -14,19 +14,19 @@ pub struct FailCmp; impl Eq for FailCmp { - fn eq(&self, _: &FailCmp) -> bool { fail2!("eq") } + fn eq(&self, _: &FailCmp) -> bool { fail!("eq") } } impl Ord for FailCmp { - fn lt(&self, _: &FailCmp) -> bool { fail2!("lt") } + fn lt(&self, _: &FailCmp) -> bool { fail!("lt") } } impl TotalEq for FailCmp { - fn equals(&self, _: &FailCmp) -> bool { fail2!("equals") } + fn equals(&self, _: &FailCmp) -> bool { fail!("equals") } } impl TotalOrd for FailCmp { - fn cmp(&self, _: &FailCmp) -> Ordering { fail2!("cmp") } + fn cmp(&self, _: &FailCmp) -> Ordering { fail!("cmp") } } #[deriving(Eq,Ord,TotalEq,TotalOrd)] diff --git a/src/test/run-pass/die-macro.rs b/src/test/run-pass/die-macro.rs index ade01142c35b..f08e5f054a9d 100644 --- a/src/test/run-pass/die-macro.rs +++ b/src/test/run-pass/die-macro.rs @@ -3,9 +3,9 @@ #[allow(unreachable_code)]; fn f() { - fail2!(); + fail!(); - let _x: int = fail2!(); + let _x: int = fail!(); } pub fn main() { diff --git a/src/test/run-pass/enum-alignment.rs b/src/test/run-pass/enum-alignment.rs index 4c60cfb73281..3c8dd33ae9c3 100644 --- a/src/test/run-pass/enum-alignment.rs +++ b/src/test/run-pass/enum-alignment.rs @@ -27,7 +27,7 @@ fn is_aligned(ptr: &T) -> bool { pub fn main() { let x = Some(0u64); match x { - None => fail2!(), + None => fail!(), Some(ref y) => assert!(is_aligned(y)) } } diff --git a/src/test/run-pass/enum-nullable-simplifycfg-misopt.rs b/src/test/run-pass/enum-nullable-simplifycfg-misopt.rs index 334047d6ca69..4764dbb9417f 100644 --- a/src/test/run-pass/enum-nullable-simplifycfg-misopt.rs +++ b/src/test/run-pass/enum-nullable-simplifycfg-misopt.rs @@ -19,6 +19,6 @@ pub fn main() { match Cons(10, @Nil) { Cons(10, _) => {} Nil => {} - _ => fail2!() + _ => fail!() } } diff --git a/src/test/run-pass/estr-slice.rs b/src/test/run-pass/estr-slice.rs index 145f04009d16..f579e7a3d20a 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 y : &str = &"there"; - info2!("{}", x); - info2!("{}", 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"; - info2!("{}", a); + info!("{}", a); assert!(a < b); assert!(a <= b); @@ -38,7 +38,7 @@ pub fn main() { assert!(b >= a); assert!(b > a); - info2!("{}", b); + info!("{}", b); assert!(a < c); assert!(a <= c); @@ -46,7 +46,7 @@ pub fn main() { assert!(c >= a); assert!(c > a); - info2!("{}", c); + info!("{}", c); assert!(c < cc); assert!(c <= cc); @@ -54,5 +54,5 @@ pub fn main() { assert!(cc >= c); assert!(cc > c); - info2!("{}", cc); + info!("{}", cc); } diff --git a/src/test/run-pass/evec-slice.rs b/src/test/run-pass/evec-slice.rs index 32de1ad79b26..a0af5e5a9e00 100644 --- a/src/test/run-pass/evec-slice.rs +++ b/src/test/run-pass/evec-slice.rs @@ -22,7 +22,7 @@ pub fn main() { let c : &[int] = &[2,2,2,2,3]; let cc : &[int] = &[2,2,2,2,2,2]; - info2!("{:?}", a); + info!("{:?}", a); assert!(a < b); assert!(a <= b); @@ -30,7 +30,7 @@ pub fn main() { assert!(b >= a); assert!(b > a); - info2!("{:?}", b); + info!("{:?}", b); assert!(b < c); assert!(b <= c); @@ -44,7 +44,7 @@ pub fn main() { assert!(c >= a); assert!(c > a); - info2!("{:?}", c); + info!("{:?}", c); assert!(a < cc); assert!(a <= cc); @@ -52,5 +52,5 @@ pub fn main() { assert!(cc >= a); assert!(cc > a); - info2!("{:?}", cc); + info!("{:?}", cc); } diff --git a/src/test/run-pass/export-non-interference2.rs b/src/test/run-pass/export-non-interference2.rs index 8fdc9c563156..13b21fbe1afe 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() { info2!("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 b06323741a5c..e2af3121f16e 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() { info2!("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 710cab50fba6..b4ca5e31e612 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 { - info2!("{}", *b1); - info2!("{}", *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 f22ef2138ff8..b225f1a8ddfa 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 { - info2!("{}", *b1); - info2!("{}", *b2); + info!("{}", *b1); + info!("{}", *b2); return *b1 == *b2; } test_generic::(~true, compare_box); diff --git a/src/test/run-pass/expr-if-fail-all.rs b/src/test/run-pass/expr-if-fail-all.rs index b19b9ceaa00b..a34620d2e1be 100644 --- a/src/test/run-pass/expr-if-fail-all.rs +++ b/src/test/run-pass/expr-if-fail-all.rs @@ -14,6 +14,6 @@ pub fn main() { let _x = if true { 10 } else { - if true { fail2!() } else { fail2!() } + if true { fail!() } else { fail!() } }; } diff --git a/src/test/run-pass/expr-if-fail.rs b/src/test/run-pass/expr-if-fail.rs index 966a1db1d0e6..f79b7198b50e 100644 --- a/src/test/run-pass/expr-if-fail.rs +++ b/src/test/run-pass/expr-if-fail.rs @@ -8,15 +8,15 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -fn test_if_fail() { let x = if false { fail2!() } else { 10 }; assert!((x == 10)); } +fn test_if_fail() { let x = if false { fail!() } else { 10 }; assert!((x == 10)); } fn test_else_fail() { - let x = if true { 10 } else { fail2!() }; + let x = if true { 10 } else { fail!() }; assert_eq!(x, 10); } fn test_elseif_fail() { - let x = if false { 0 } else if false { fail2!() } else { 10 }; + let x = if false { 0 } else if false { fail!() } else { 10 }; assert_eq!(x, 10); } diff --git a/src/test/run-pass/expr-match-box.rs b/src/test/run-pass/expr-match-box.rs index 6f638758ed88..84a78637187f 100644 --- a/src/test/run-pass/expr-match-box.rs +++ b/src/test/run-pass/expr-match-box.rs @@ -15,13 +15,13 @@ // Tests for match as expressions resulting in boxed types fn test_box() { - let res = match true { true => { @100 } _ => fail2!("wat") }; + let res = match true { true => { @100 } _ => fail!("wat") }; assert_eq!(*res, 100); } fn test_str() { let res = match true { true => { ~"happy" }, - _ => fail2!("not happy at all") }; + _ => fail!("not happy at all") }; assert_eq!(res, ~"happy"); } diff --git a/src/test/run-pass/expr-match-fail-all.rs b/src/test/run-pass/expr-match-fail-all.rs index 418031243ee5..aef11a78e0db 100644 --- a/src/test/run-pass/expr-match-fail-all.rs +++ b/src/test/run-pass/expr-match-fail-all.rs @@ -17,6 +17,6 @@ pub fn main() { let _x = match true { true => { 10 } - false => { match true { true => { fail2!() } false => { fail2!() } } } + false => { match true { true => { fail!() } false => { fail!() } } } }; } diff --git a/src/test/run-pass/expr-match-fail.rs b/src/test/run-pass/expr-match-fail.rs index c1081561b6f1..3e1b96763e19 100644 --- a/src/test/run-pass/expr-match-fail.rs +++ b/src/test/run-pass/expr-match-fail.rs @@ -9,12 +9,12 @@ // except according to those terms. fn test_simple() { - let r = match true { true => { true } false => { fail2!() } }; + let r = match true { true => { true } false => { fail!() } }; assert_eq!(r, true); } fn test_box() { - let r = match true { true => { ~[10] } false => { fail2!() } }; + let r = match true { true => { ~[10] } false => { fail!() } }; assert_eq!(r[0], 10); } diff --git a/src/test/run-pass/expr-match-generic-box1.rs b/src/test/run-pass/expr-match-generic-box1.rs index e70a18a7f6d8..064e33436205 100644 --- a/src/test/run-pass/expr-match-generic-box1.rs +++ b/src/test/run-pass/expr-match-generic-box1.rs @@ -15,7 +15,7 @@ type compare = &'static fn(@T, @T) -> bool; fn test_generic(expected: @T, eq: compare) { - let actual: @T = match true { true => { expected }, _ => fail2!() }; + let actual: @T = match true { true => { expected }, _ => fail!() }; assert!((eq(expected, actual))); } diff --git a/src/test/run-pass/expr-match-generic-box2.rs b/src/test/run-pass/expr-match-generic-box2.rs index 92e13e36d073..bca06ebdbb5f 100644 --- a/src/test/run-pass/expr-match-generic-box2.rs +++ b/src/test/run-pass/expr-match-generic-box2.rs @@ -14,7 +14,7 @@ type compare = &'static fn(T, T) -> bool; fn test_generic(expected: T, eq: compare) { - let actual: T = match true { true => { expected.clone() }, _ => fail2!("wat") }; + let actual: T = match true { true => { expected.clone() }, _ => fail!("wat") }; assert!((eq(expected, actual))); } diff --git a/src/test/run-pass/expr-match-generic-unique1.rs b/src/test/run-pass/expr-match-generic-unique1.rs index e4a6fa516c5b..7371f8fd89b9 100644 --- a/src/test/run-pass/expr-match-generic-unique1.rs +++ b/src/test/run-pass/expr-match-generic-unique1.rs @@ -16,7 +16,7 @@ type compare = &'static fn(~T, ~T) -> bool; fn test_generic(expected: ~T, eq: compare) { let actual: ~T = match true { true => { expected.clone() }, - _ => fail2!("wat") + _ => fail!("wat") }; assert!((eq(expected, actual))); } diff --git a/src/test/run-pass/expr-match-generic-unique2.rs b/src/test/run-pass/expr-match-generic-unique2.rs index 09278fad75ce..d07d40e67576 100644 --- a/src/test/run-pass/expr-match-generic-unique2.rs +++ b/src/test/run-pass/expr-match-generic-unique2.rs @@ -16,7 +16,7 @@ type compare<'self, T> = &'self fn(T, T) -> bool; fn test_generic(expected: T, eq: compare) { let actual: T = match true { true => expected.clone(), - _ => fail2!("wat") + _ => fail!("wat") }; assert!((eq(expected, actual))); } diff --git a/src/test/run-pass/expr-match-generic.rs b/src/test/run-pass/expr-match-generic.rs index d98cd130022f..b43085d346f3 100644 --- a/src/test/run-pass/expr-match-generic.rs +++ b/src/test/run-pass/expr-match-generic.rs @@ -14,7 +14,7 @@ type compare = extern "Rust" fn(T, T) -> bool; fn test_generic(expected: T, eq: compare) { - let actual: T = match true { true => { expected.clone() }, _ => fail2!("wat") }; + let actual: T = match true { true => { expected.clone() }, _ => fail!("wat") }; assert!((eq(expected, actual))); } diff --git a/src/test/run-pass/expr-match-struct.rs b/src/test/run-pass/expr-match-struct.rs index 7fa58a535b0a..7cfcc38f8dd3 100644 --- a/src/test/run-pass/expr-match-struct.rs +++ b/src/test/run-pass/expr-match-struct.rs @@ -17,7 +17,7 @@ struct R { i: int } fn test_rec() { - let rs = match true { true => R {i: 100}, _ => fail2!() }; + let rs = match true { true => R {i: 100}, _ => fail!() }; assert_eq!(rs.i, 100); } diff --git a/src/test/run-pass/expr-match-unique.rs b/src/test/run-pass/expr-match-unique.rs index 7f610d1babd8..cdd4e45877ad 100644 --- a/src/test/run-pass/expr-match-unique.rs +++ b/src/test/run-pass/expr-match-unique.rs @@ -15,7 +15,7 @@ // Tests for match as expressions resulting in boxed types fn test_box() { - let res = match true { true => { ~100 }, _ => fail2!() }; + let res = match true { true => { ~100 }, _ => fail!() }; assert_eq!(*res, 100); } diff --git a/src/test/run-pass/extern-call-deep.rs b/src/test/run-pass/extern-call-deep.rs index 41ae128626be..86922f5dc25e 100644 --- a/src/test/run-pass/extern-call-deep.rs +++ b/src/test/run-pass/extern-call-deep.rs @@ -31,13 +31,13 @@ extern fn cb(data: libc::uintptr_t) -> libc::uintptr_t { #[fixed_stack_segment] fn count(n: uint) -> uint { unsafe { - info2!("n = {}", n); + info!("n = {}", n); rustrt::rust_dbg_call(cb, n) } } pub fn main() { let result = count(1000u); - info2!("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 0490949e8a47..bbff0edfffd8 100644 --- a/src/test/run-pass/extern-call-deep2.rs +++ b/src/test/run-pass/extern-call-deep2.rs @@ -32,7 +32,7 @@ extern fn cb(data: libc::uintptr_t) -> libc::uintptr_t { #[fixed_stack_segment] #[inline(never)] fn count(n: uint) -> uint { unsafe { - info2!("n = {}", n); + info!("n = {}", n); rustrt::rust_dbg_call(cb, n) } } @@ -42,7 +42,7 @@ pub fn main() { // has a large stack) do task::spawn { let result = count(1000u); - info2!("result = {}", result); + info!("result = {}", result); assert_eq!(result, 1000u); }; } diff --git a/src/test/run-pass/extern-call-indirect.rs b/src/test/run-pass/extern-call-indirect.rs index 733625f492ef..bea937fa9c9a 100644 --- a/src/test/run-pass/extern-call-indirect.rs +++ b/src/test/run-pass/extern-call-indirect.rs @@ -31,13 +31,13 @@ extern fn cb(data: libc::uintptr_t) -> libc::uintptr_t { #[fixed_stack_segment] #[inline(never)] fn fact(n: uint) -> uint { unsafe { - info2!("n = {}", n); + info!("n = {}", n); rustrt::rust_dbg_call(cb, n) } } pub fn main() { let result = fact(10u); - info2!("result = {}", result); + info!("result = {}", result); assert_eq!(result, 3628800u); } diff --git a/src/test/run-pass/extern-call-scrub.rs b/src/test/run-pass/extern-call-scrub.rs index 74b1ed9a5c42..8a54b9bfc348 100644 --- a/src/test/run-pass/extern-call-scrub.rs +++ b/src/test/run-pass/extern-call-scrub.rs @@ -36,7 +36,7 @@ extern fn cb(data: libc::uintptr_t) -> libc::uintptr_t { #[fixed_stack_segment] #[inline(never)] fn count(n: uint) -> uint { unsafe { - info2!("n = {}", n); + info!("n = {}", n); rustrt::rust_dbg_call(cb, n) } } @@ -46,7 +46,7 @@ pub fn main() { // has a large stack) do task::spawn { let result = count(12u); - info2!("result = {}", result); + info!("result = {}", result); assert_eq!(result, 2048u); }; } diff --git a/src/test/run-pass/extern-crosscrate.rs b/src/test/run-pass/extern-crosscrate.rs index 3367b795462b..a2b42134b55b 100644 --- a/src/test/run-pass/extern-crosscrate.rs +++ b/src/test/run-pass/extern-crosscrate.rs @@ -16,13 +16,13 @@ extern mod externcallback(vers = "0.1"); #[fixed_stack_segment] #[inline(never)] fn fact(n: uint) -> uint { unsafe { - info2!("n = {}", n); + info!("n = {}", n); externcallback::rustrt::rust_dbg_call(externcallback::cb, n) } } pub fn main() { let result = fact(10u); - info2!("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 7e71d416b55a..3ce0dbe30e20 100644 --- a/src/test/run-pass/extern-yield.rs +++ b/src/test/run-pass/extern-yield.rs @@ -41,7 +41,7 @@ pub fn main() { do 10u.times { do task::spawn { let result = count(5u); - info2!("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 f0379e1dac1c..1c9f5e254f14 100644 --- a/src/test/run-pass/fact.rs +++ b/src/test/run-pass/fact.rs @@ -15,7 +15,7 @@ fn f(x: int) -> int { // info!("in f:"); - info2!("{}", x); + info!("{}", x); if x == 1 { // info!("bottoming out"); @@ -26,7 +26,7 @@ fn f(x: int) -> int { let y: int = x * f(x - 1); // info!("returned"); - info2!("{}", y); + info!("{}", y); return y; } } diff --git a/src/test/run-pass/fat-arrow-match.rs b/src/test/run-pass/fat-arrow-match.rs index be945e93ec9d..63e62e254b80 100644 --- a/src/test/run-pass/fat-arrow-match.rs +++ b/src/test/run-pass/fat-arrow-match.rs @@ -17,7 +17,7 @@ enum color { } pub fn main() { - error2!("{}", match red { + error!("{}", match red { red => { 1 } green => { 2 } blue => { 3 } diff --git a/src/test/run-pass/float-signature.rs b/src/test/run-pass/float-signature.rs index dae41d34e052..26974bbcecef 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: f64) -> f64 { return n + 0.12345; } let n: f64 = 0.1; let m: f64 = foo(n); - info2!("{}", m); + info!("{}", m); } diff --git a/src/test/run-pass/float.rs b/src/test/run-pass/float.rs index 1418255d601c..987ee233810f 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; - info2!("{:?}", -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 { - info2!("yes"); + info!("yes"); } } diff --git a/src/test/run-pass/fn-bare-item.rs b/src/test/run-pass/fn-bare-item.rs index be0f686c5a40..e01c7ee998c3 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() { - info2!("This is a bare function"); + info!("This is a bare function"); } pub fn main() { diff --git a/src/test/run-pass/for-loop-fail.rs b/src/test/run-pass/for-loop-fail.rs index 9599c5852df8..ff718500340c 100644 --- a/src/test/run-pass/for-loop-fail.rs +++ b/src/test/run-pass/for-loop-fail.rs @@ -8,4 +8,4 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -pub fn main() { let x: ~[int] = ~[]; for _ in x.iter() { fail2!("moop"); } } +pub fn main() { let x: ~[int] = ~[]; for _ in x.iter() { fail!("moop"); } } diff --git a/src/test/run-pass/foreach-put-structured.rs b/src/test/run-pass/foreach-put-structured.rs index 6e20bb20bd93..2b57cc033f9f 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; - info2!("{}", _0); - info2!("{}", _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 b5fa186902e3..53201c7a91aa 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| { info2!("main"); info2!("{}", i); sum = sum + i; } - info2!("sum"); - info2!("{}", 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 { info2!("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 b4412db1a588..0ba40fe063d7 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); - info2!("{:?}", *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 ab50b70b1b8c..a54c68a907b9 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()); - info2!("{:?}", *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 7ce3dc7a03da..396ac88bd06d 100644 --- a/src/test/run-pass/generic-derived-type.rs +++ b/src/test/run-pass/generic-derived-type.rs @@ -25,8 +25,8 @@ fn f(t: T) -> Pair { pub fn main() { let b = f::(10); - info2!("{:?}" ,b.a); - info2!("{:?}", 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 c5d6d23d9487..a203b6b3adab 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); info2!("{:?}", *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 d4ba0ddfc8e4..64e7d0101b87 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); info2!("{:?}", *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 4d8b382b511e..652349dea82d 100644 --- a/src/test/run-pass/generic-fn.rs +++ b/src/test/run-pass/generic-fn.rs @@ -23,14 +23,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); - info2!("{}", y); + info!("{}", y); assert_eq!(x, y); b = id::(a); - info2!("{}", b); + info!("{}", b); assert_eq!(a, b); q = id::(p); x = p.z; y = q.z; - info2!("{}", 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 7b3b11189746..f740d8cb2d15 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) => { info2!("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 739eb9f0aca3..984765c4e519 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) => { info2!("{:?}", 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) => { - info2!("{:?}", t.x); - info2!("{:?}", 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 5143676f34a5..1f480bf402be 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) { info2!("{}", 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 f9f5da51196b..9626884be9dd 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() { - info2!("{:?}", 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/getopts_ref.rs b/src/test/run-pass/getopts_ref.rs index e0ac464f321b..bfc140065655 100644 --- a/src/test/run-pass/getopts_ref.rs +++ b/src/test/run-pass/getopts_ref.rs @@ -21,7 +21,7 @@ pub fn main() { match getopts(args, opts) { Ok(ref m) => assert!(!m.opt_present("b")), - Err(ref f) => fail2!("{:?}", (*f).clone().to_err_msg()) + Err(ref f) => fail!("{:?}", (*f).clone().to_err_msg()) }; } diff --git a/src/test/run-pass/hashmap-memory.rs b/src/test/run-pass/hashmap-memory.rs index 13a544a200ba..73595fd782c4 100644 --- a/src/test/run-pass/hashmap-memory.rs +++ b/src/test/run-pass/hashmap-memory.rs @@ -47,11 +47,11 @@ mod map_reduce { return; } let (pp, cc) = stream(); - error2!("sending find_reducer"); + error!("sending find_reducer"); ctrl.send(find_reducer(key.as_bytes().to_owned(), cc)); - error2!("receiving"); + error!("receiving"); let c = pp.recv(); - error2!("{:?}", c); + error!("{:?}", c); im.insert(key, c); } diff --git a/src/test/run-pass/if-bot.rs b/src/test/run-pass/if-bot.rs index 768f3431832d..6ac169fed9b0 100644 --- a/src/test/run-pass/if-bot.rs +++ b/src/test/run-pass/if-bot.rs @@ -11,6 +11,6 @@ pub fn main() { - let i: int = if false { fail2!() } else { 5 }; - info2!("{:?}", i); + let i: int = if false { fail!() } else { 5 }; + info!("{:?}", i); } diff --git a/src/test/run-pass/if-check.rs b/src/test/run-pass/if-check.rs index 0fd5fc01d176..50a1b4345dc7 100644 --- a/src/test/run-pass/if-check.rs +++ b/src/test/run-pass/if-check.rs @@ -16,9 +16,9 @@ fn even(x: uint) -> bool { fn foo(x: uint) { if even(x) { - info2!("{}", x); + info!("{}", x); } else { - fail2!(); + fail!(); } } diff --git a/src/test/run-pass/import-glob-0.rs b/src/test/run-pass/import-glob-0.rs index 1da617273df6..0ace721cdc06 100644 --- a/src/test/run-pass/import-glob-0.rs +++ b/src/test/run-pass/import-glob-0.rs @@ -16,10 +16,10 @@ use module_of_many_things::*; use dug::too::greedily::and::too::deep::*; mod module_of_many_things { - pub fn f1() { info2!("f1"); } - pub fn f2() { info2!("f2"); } - fn f3() { info2!("f3"); } - pub fn f4() { info2!("f4"); } + pub fn f1() { info!("f1"); } + pub fn f2() { info!("f2"); } + fn f3() { info!("f3"); } + pub fn f4() { info!("f4"); } } mod dug { @@ -28,8 +28,8 @@ mod dug { pub mod and { pub mod too { pub mod deep { - pub fn nameless_fear() { info2!("Boo!"); } - pub fn also_redstone() { info2!("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 eff085e687df..2b20eed593aa 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) { info2!("{:?}", 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 3ca64ce199ec..9cda55f50840 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() { info2!("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 10f6d87bf4cf..64d47bf22195 100644 --- a/src/test/run-pass/import3.rs +++ b/src/test/run-pass/import3.rs @@ -17,7 +17,7 @@ use baz::zed::bar; mod baz { pub mod zed { - pub fn bar() { info2!("bar2"); } + pub fn bar() { info!("bar2"); } } } diff --git a/src/test/run-pass/import4.rs b/src/test/run-pass/import4.rs index d453306317bb..d368ab2e993d 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() { info2!("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 00c5f35c5423..e9539b290ae1 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() { info2!("foo"); } + pub fn bar() { info!("foo"); } } } diff --git a/src/test/run-pass/import6.rs b/src/test/run-pass/import6.rs index 150a89f61769..4f813247576c 100644 --- a/src/test/run-pass/import6.rs +++ b/src/test/run-pass/import6.rs @@ -17,7 +17,7 @@ use bar::baz; mod foo { pub mod zed { - pub fn baz() { info2!("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 e9241882f655..63a30ccee2ce 100644 --- a/src/test/run-pass/import7.rs +++ b/src/test/run-pass/import7.rs @@ -17,7 +17,7 @@ use bar::baz; mod foo { pub mod zed { - pub fn baz() { info2!("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 9b0c512d4f1f..2af4cf5e9842 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) { info2!("{}", 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 7e3547ba7f32..1e53dd849fc8 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() { info2!("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 05032dda759b..edc71b524e33 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); - info2!("{}", 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); - info2!("{}", s[3u8]); + info!("{}", s[3u8]); } diff --git a/src/test/run-pass/issue-1516.rs b/src/test/run-pass/issue-1516.rs index 17444e657087..4b73d83595e6 100644 --- a/src/test/run-pass/issue-1516.rs +++ b/src/test/run-pass/issue-1516.rs @@ -9,5 +9,5 @@ // except according to those terms. pub fn main() { - let early_error: &'static fn(&str) -> ! = |_msg| { fail2!() }; + let early_error: &'static fn(&str) -> ! = |_msg| { fail!() }; } diff --git a/src/test/run-pass/issue-1696.rs b/src/test/run-pass/issue-1696.rs index de62c57ab9fa..1532a8a3fb88 100644 --- a/src/test/run-pass/issue-1696.rs +++ b/src/test/run-pass/issue-1696.rs @@ -15,5 +15,5 @@ use std::hashmap::HashMap; pub fn main() { let mut m = HashMap::new(); m.insert("foo".as_bytes().to_owned(), "bar".as_bytes().to_owned()); - error2!("{:?}", m); + error!("{:?}", m); } diff --git a/src/test/run-pass/issue-2216.rs b/src/test/run-pass/issue-2216.rs index f51a49e9c7b9..4a1bb2ea8776 100644 --- a/src/test/run-pass/issue-2216.rs +++ b/src/test/run-pass/issue-2216.rs @@ -27,6 +27,6 @@ pub fn main() { break; } - error2!("{:?}", x); + error!("{:?}", x); assert_eq!(x, 42); } diff --git a/src/test/run-pass/issue-2311-2.rs b/src/test/run-pass/issue-2311-2.rs index cf8d3dc642c2..b03bfb958af1 100644 --- a/src/test/run-pass/issue-2311-2.rs +++ b/src/test/run-pass/issue-2311-2.rs @@ -15,7 +15,7 @@ struct foo { impl foo { pub fn bar>(&self, _c: C) -> B { - fail2!(); + fail!(); } } diff --git a/src/test/run-pass/issue-2312.rs b/src/test/run-pass/issue-2312.rs index 54a8730fa1bb..14b5efe904db 100644 --- a/src/test/run-pass/issue-2312.rs +++ b/src/test/run-pass/issue-2312.rs @@ -15,7 +15,7 @@ trait clam { } struct foo(int); impl foo { - pub fn bar>(&self, _c: C) -> B { fail2!(); } + pub fn bar>(&self, _c: C) -> B { fail!(); } } pub fn main() { } diff --git a/src/test/run-pass/issue-2611-3.rs b/src/test/run-pass/issue-2611-3.rs index 5882edf18803..a3d51bb9014e 100644 --- a/src/test/run-pass/issue-2611-3.rs +++ b/src/test/run-pass/issue-2611-3.rs @@ -20,7 +20,7 @@ struct E { } impl A for E { - fn b(_x: F) -> F { fail2!() } + fn b(_x: F) -> F { fail!() } //~^ ERROR in method `b`, type parameter 0 has 1 bound, but } diff --git a/src/test/run-pass/issue-2633.rs b/src/test/run-pass/issue-2633.rs index e905c895c351..bde18d77b9ad 100644 --- a/src/test/run-pass/issue-2633.rs +++ b/src/test/run-pass/issue-2633.rs @@ -13,7 +13,7 @@ struct cat { } fn meow() { - error2!("meow") + error!("meow") } fn cat() -> cat { diff --git a/src/test/run-pass/issue-2718.rs b/src/test/run-pass/issue-2718.rs index 617f98cdb5f1..7cebfa132234 100644 --- a/src/test/run-pass/issue-2718.rs +++ b/src/test/run-pass/issue-2718.rs @@ -52,9 +52,9 @@ pub mod pipes { } mod rusti { - pub fn atomic_xchg(_dst: &mut int, _src: int) -> int { fail2!(); } - pub fn atomic_xchg_acq(_dst: &mut int, _src: int) -> int { fail2!(); } - pub fn atomic_xchg_rel(_dst: &mut int, _src: int) -> int { fail2!(); } + pub fn atomic_xchg(_dst: &mut int, _src: int) -> int { fail!(); } + pub fn atomic_xchg_acq(_dst: &mut int, _src: int) -> int { fail!(); } + pub fn atomic_xchg_rel(_dst: &mut int, _src: int) -> int { fail!(); } } // We should consider moving this to ::std::unsafe, although I @@ -88,7 +88,7 @@ pub mod pipes { // The receiver will eventually clean this up. unsafe { forget(p); } } - full => { fail2!("duplicate send") } + full => { fail!("duplicate send") } blocked => { // The receiver will eventually clean this up. @@ -130,7 +130,7 @@ pub mod pipes { } full => { // This is impossible - fail2!("you dun goofed") + fail!("you dun goofed") } terminated => { // I have to clean up, use drop_glue @@ -147,7 +147,7 @@ pub mod pipes { } blocked => { // this shouldn't happen. - fail2!("terminating a blocked packet") + fail!("terminating a blocked packet") } terminated | full => { // I have to clean up, use drop_glue @@ -232,7 +232,7 @@ pub mod pingpong { let _addr : *::pipes::send_packet = match &p { &ping(ref x) => { cast::transmute(x) } }; - fail2!() + fail!() } } @@ -241,7 +241,7 @@ pub mod pingpong { let _addr : *::pipes::send_packet = match &p { &pong(ref x) => { cast::transmute(x) } }; - fail2!() + fail!() } } @@ -265,7 +265,7 @@ pub mod pingpong { pub fn do_pong(c: pong) -> (ping, ()) { let packet = ::pipes::recv(c); if packet.is_none() { - fail2!("sender closed the connection") + fail!("sender closed the connection") } (pingpong::liberate_pong(packet.unwrap()), ()) } @@ -280,7 +280,7 @@ pub mod pingpong { pub fn do_ping(c: ping) -> (pong, ()) { let packet = ::pipes::recv(c); if packet.is_none() { - fail2!("sender closed the connection") + fail!("sender closed the connection") } (pingpong::liberate_ping(packet.unwrap()), ()) } @@ -295,16 +295,16 @@ pub mod pingpong { fn client(chan: pingpong::client::ping) { let chan = pingpong::client::do_ping(chan); - error2!("Sent ping"); + error!("Sent ping"); let (_chan, _data) = pingpong::client::do_pong(chan); - error2!("Received pong"); + error!("Received pong"); } fn server(chan: pingpong::server::ping) { let (chan, _data) = pingpong::server::do_ping(chan); - error2!("Received ping"); + error!("Received ping"); let _chan = pingpong::server::do_pong(chan); - error2!("Sent pong"); + error!("Sent pong"); } pub fn main() { diff --git a/src/test/run-pass/issue-2804-2.rs b/src/test/run-pass/issue-2804-2.rs index 8fad80ce238e..9597823c3350 100644 --- a/src/test/run-pass/issue-2804-2.rs +++ b/src/test/run-pass/issue-2804-2.rs @@ -16,7 +16,7 @@ use std::hashmap::HashMap; fn add_interfaces(managed_ip: ~str, device: HashMap<~str, int>) { - error2!("{}, {:?}", managed_ip, device.get(&~"interfaces")); + error!("{}, {:?}", managed_ip, device.get(&~"interfaces")); } pub fn main() {} diff --git a/src/test/run-pass/issue-2804.rs b/src/test/run-pass/issue-2804.rs index efcdbaa482c0..2d590f25af1d 100644 --- a/src/test/run-pass/issue-2804.rs +++ b/src/test/run-pass/issue-2804.rs @@ -28,7 +28,7 @@ fn lookup(table: ~json::Object, key: ~str, default: ~str) -> ~str (*s).clone() } option::Some(value) => { - error2!("{} was expected to be a string but is a {:?}", key, value); + error!("{} was expected to be a string but is a {:?}", key, value); default } option::None => { @@ -47,7 +47,7 @@ fn add_interface(_store: int, managed_ip: ~str, data: extra::json::Json) -> (~st (label, bool_value(false)) } _ => { - error2!("Expected dict for {} interfaces but found {:?}", managed_ip, data); + error!("Expected dict for {} interfaces but found {:?}", managed_ip, data); (~"gnos:missing-interface", bool_value(true)) } } @@ -65,7 +65,7 @@ fn add_interfaces(store: int, managed_ip: ~str, device: HashMap<~str, extra::jso } _ => { - error2!("Expected list for {} interfaces but found {:?}", managed_ip, + error!("Expected list for {} interfaces but found {:?}", managed_ip, device.get(&~"interfaces")); ~[] } diff --git a/src/test/run-pass/issue-2904.rs b/src/test/run-pass/issue-2904.rs index f2a4692d3965..328ea167d1e5 100644 --- a/src/test/run-pass/issue-2904.rs +++ b/src/test/run-pass/issue-2904.rs @@ -55,8 +55,8 @@ fn square_from_char(c: char) -> square { '.' => { earth } ' ' => { empty } _ => { - error2!("invalid square: {:?}", c); - fail2!() + error!("invalid square: {:?}", c); + fail!() } } } diff --git a/src/test/run-pass/issue-2935.rs b/src/test/run-pass/issue-2935.rs index fff89381dbe3..c1f4e1e49aa0 100644 --- a/src/test/run-pass/issue-2935.rs +++ b/src/test/run-pass/issue-2935.rs @@ -29,6 +29,6 @@ pub fn main() { // x.f(); // y.f(); // (*z).f(); - error2!("ok so far..."); + error!("ok so far..."); z.f(); //segfault } diff --git a/src/test/run-pass/issue-3109.rs b/src/test/run-pass/issue-3109.rs index 76cb182b0b6a..15580a01f7ad 100644 --- a/src/test/run-pass/issue-3109.rs +++ b/src/test/run-pass/issue-3109.rs @@ -9,5 +9,5 @@ // except according to those terms. pub fn main() { - error2!("{:?}", ("hi there!", "you")); + error!("{:?}", ("hi there!", "you")); } diff --git a/src/test/run-pass/issue-3609.rs b/src/test/run-pass/issue-3609.rs index fdd26478a99d..8ed70a7ee32d 100644 --- a/src/test/run-pass/issue-3609.rs +++ b/src/test/run-pass/issue-3609.rs @@ -18,7 +18,7 @@ fn foo(name: ~str, samples_chan: Chan) { |buffer| { for i in range(0u, buffer.len()) { - error2!("{}: {}", i, buffer[i]) + error!("{}: {}", i, buffer[i]) } }; samples_chan.send(GetSamples(name.clone(), callback)); diff --git a/src/test/run-pass/issue-3895.rs b/src/test/run-pass/issue-3895.rs index ef9cab875412..efe0cb8d491d 100644 --- a/src/test/run-pass/issue-3895.rs +++ b/src/test/run-pass/issue-3895.rs @@ -13,6 +13,6 @@ pub fn main() { match BadChar { _ if true => BadChar, - BadChar | BadSyntax => fail2!() , + BadChar | BadSyntax => fail!() , }; } diff --git a/src/test/run-pass/issue-4016.rs b/src/test/run-pass/issue-4016.rs index 98b6a9c5f44b..c4178961d9e6 100644 --- a/src/test/run-pass/issue-4016.rs +++ b/src/test/run-pass/issue-4016.rs @@ -20,7 +20,7 @@ fn exec() { let doc = json::from_str("").unwrap(); let mut decoder = json::Decoder(doc); let _v: T = Decodable::decode(&mut decoder); - fail2!() + fail!() } pub fn main() {} diff --git a/src/test/run-pass/issue-5275.rs b/src/test/run-pass/issue-5275.rs index b0560b4e637b..8f0d01fab405 100644 --- a/src/test/run-pass/issue-5275.rs +++ b/src/test/run-pass/issue-5275.rs @@ -12,14 +12,14 @@ fn foo(self_: &A) -> int { if true { - fail2!() + fail!() } else { *bar(self_.bar) } } fn bar<'r>(_: &'r mut int) -> &'r int { - fail2!() + fail!() } struct A { diff --git a/src/test/run-pass/issue-6128.rs b/src/test/run-pass/issue-6128.rs index 51c7ed8babcc..a01a04ebf827 100644 --- a/src/test/run-pass/issue-6128.rs +++ b/src/test/run-pass/issue-6128.rs @@ -17,7 +17,7 @@ trait Graph { impl Graph for HashMap { fn f(&self, _e: E) { - fail2!(); + fail!(); } } diff --git a/src/test/run-pass/issue-6344-let.rs b/src/test/run-pass/issue-6344-let.rs index 2d70f2623e4a..05404b16f16a 100644 --- a/src/test/run-pass/issue-6344-let.rs +++ b/src/test/run-pass/issue-6344-let.rs @@ -17,5 +17,5 @@ pub fn main() { let a = A { x: 0 }; let A { x: ref x } = a; - info2!("{:?}", x) + info!("{:?}", x) } diff --git a/src/test/run-pass/issue-6344-match.rs b/src/test/run-pass/issue-6344-match.rs index 465e413b0ec0..ddac18235469 100644 --- a/src/test/run-pass/issue-6344-match.rs +++ b/src/test/run-pass/issue-6344-match.rs @@ -18,7 +18,7 @@ pub fn main() { match a { A { x : ref x } => { - info2!("{:?}", x) + info!("{:?}", x) } } } diff --git a/src/test/run-pass/issue-7563.rs b/src/test/run-pass/issue-7563.rs index 348a455830f7..ece53f4e3f22 100644 --- a/src/test/run-pass/issue-7563.rs +++ b/src/test/run-pass/issue-7563.rs @@ -19,7 +19,7 @@ pub fn main() { let sa = A { a: 100 }; let sb = B { b: 200, pa: &sa }; - debug2!("sa is {:?}", sa); - debug2!("sb is {:?}", sb); - debug2!("sb.pa is {:?}", sb.get_pa()); + debug!("sa is {:?}", sa); + debug!("sb is {:?}", sb); + debug!("sb.pa is {:?}", sb.get_pa()); } diff --git a/src/test/run-pass/issue-8351-1.rs b/src/test/run-pass/issue-8351-1.rs index 44e100576e22..9aaaa13c7994 100644 --- a/src/test/run-pass/issue-8351-1.rs +++ b/src/test/run-pass/issue-8351-1.rs @@ -18,8 +18,8 @@ enum E { pub fn main() { let e = Foo{f: 0}; match e { - Foo{f: 1} => fail2!(), + Foo{f: 1} => fail!(), Foo{_} => (), - _ => fail2!(), + _ => fail!(), } } diff --git a/src/test/run-pass/issue-8351-2.rs b/src/test/run-pass/issue-8351-2.rs index 4c3192189533..528303c8ad3f 100644 --- a/src/test/run-pass/issue-8351-2.rs +++ b/src/test/run-pass/issue-8351-2.rs @@ -18,8 +18,8 @@ enum E { pub fn main() { let e = Foo{f: 0, b: false}; match e { - Foo{f: 1, b: true} => fail2!(), + Foo{f: 1, b: true} => fail!(), Foo{b: false, f: 0} => (), - _ => fail2!(), + _ => fail!(), } } diff --git a/src/test/run-pass/istr.rs b/src/test/run-pass/istr.rs index a02edba5f653..9b3db58ea9b2 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"; - info2!("{}", 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"; info2!("{}", 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"); - info2!("{}", 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 82163200e592..5ada4aa8c758 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 ); - info2!("{}", sum); + info!("{}", sum); } diff --git a/src/test/run-pass/lambda-infer-unresolved.rs b/src/test/run-pass/lambda-infer-unresolved.rs index 0a6393d3deee..e615cfae6add 100644 --- a/src/test/run-pass/lambda-infer-unresolved.rs +++ b/src/test/run-pass/lambda-infer-unresolved.rs @@ -16,6 +16,6 @@ struct Refs { refs: ~[int], n: int } pub fn main() { let e = @mut Refs{refs: ~[], n: 0}; - let _f: &fn() = || error2!("{}", e.n); + let _f: &fn() = || error!("{}", e.n); e.refs.push(1); } diff --git a/src/test/run-pass/last-use-in-block.rs b/src/test/run-pass/last-use-in-block.rs index 2f7f0f26e0fa..e2dbf7d29db1 100644 --- a/src/test/run-pass/last-use-in-block.rs +++ b/src/test/run-pass/last-use-in-block.rs @@ -15,7 +15,7 @@ fn lp(s: ~str, f: &fn(~str) -> T) -> T { let r = f(s); return (r); } - fail2!(); + fail!(); } fn apply(s: ~str, f: &fn(~str) -> T) -> T { diff --git a/src/test/run-pass/last-use-is-capture.rs b/src/test/run-pass/last-use-is-capture.rs index a6beed631da1..5c349a095513 100644 --- a/src/test/run-pass/last-use-is-capture.rs +++ b/src/test/run-pass/last-use-is-capture.rs @@ -16,5 +16,5 @@ pub fn main() { fn invoke(f: &fn()) { f(); } let k = ~22; let _u = A {a: k.clone()}; - invoke(|| error2!("{:?}", k.clone()) ) + invoke(|| error!("{:?}", k.clone()) ) } diff --git a/src/test/run-pass/lazy-and-or.rs b/src/test/run-pass/lazy-and-or.rs index c821f582662b..a3dc848344c4 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; - info2!("{:?}", 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 53edb3d732cf..d58e7f2a2873 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) { info2!("{}", 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 db27a471ba35..05ac2d7e1204 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 i in x.iter() { info2!("{:?}", *i); y += *i; } - info2!("{:?}", y); + for i in x.iter() { 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; - info2!("{:?}", i); - info2!("{:?}", 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 103a34492d9e..3e11f74f04ab 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; } - info2!("{}", v); + info!("{}", v); } pub fn main() { diff --git a/src/test/run-pass/log-err-phi.rs b/src/test/run-pass/log-err-phi.rs index 399ef25b7272..57aeac9fcf87 100644 --- a/src/test/run-pass/log-err-phi.rs +++ b/src/test/run-pass/log-err-phi.rs @@ -10,4 +10,4 @@ -pub fn main() { if false { error2!("{}", ~"foo" + "bar"); } } +pub fn main() { if false { error!("{}", ~"foo" + "bar"); } } diff --git a/src/test/run-pass/log-linearized.rs b/src/test/run-pass/log-linearized.rs index 393b5c3d281d..42a0020fad15 100644 --- a/src/test/run-pass/log-linearized.rs +++ b/src/test/run-pass/log-linearized.rs @@ -26,7 +26,7 @@ fn mk() -> @mut Smallintmap { fn f() { let sim = mk::(); - error2!("{:?}", sim); + error!("{:?}", sim); } pub fn main() { diff --git a/src/test/run-pass/log-poly.rs b/src/test/run-pass/log-poly.rs index 5cd456113773..c5221cd73d7e 100644 --- a/src/test/run-pass/log-poly.rs +++ b/src/test/run-pass/log-poly.rs @@ -13,8 +13,8 @@ enum Numbers { } pub fn main() { - info2!("{}", 1); - info2!("{}", 2.0); - warn2!("{:?}", Three); - error2!("{:?}", ~[4]); + info!("{}", 1); + info!("{}", 2.0); + warn!("{:?}", Three); + error!("{:?}", ~[4]); } diff --git a/src/test/run-pass/loop-break-cont.rs b/src/test/run-pass/loop-break-cont.rs index 812089fd5a57..d6f148f559db 100644 --- a/src/test/run-pass/loop-break-cont.rs +++ b/src/test/run-pass/loop-break-cont.rs @@ -11,7 +11,7 @@ pub fn main() { let mut i = 0u; loop { - error2!("a"); + error!("a"); i += 1u; if i == 10u { break; @@ -23,7 +23,7 @@ pub fn main() { if i == 21u { break; } - error2!("b"); + error!("b"); is_even = false; i += 1u; if i % 2u != 0u { @@ -33,7 +33,7 @@ pub fn main() { } assert!(!is_even); loop { - error2!("c"); + error!("c"); if i == 22u { break; } diff --git a/src/test/run-pass/macro-interpolation.rs b/src/test/run-pass/macro-interpolation.rs index 0741d74b214b..4b89844194a5 100644 --- a/src/test/run-pass/macro-interpolation.rs +++ b/src/test/run-pass/macro-interpolation.rs @@ -18,7 +18,7 @@ macro_rules! overly_complicated ( Some($pat) => { $res } - _ => { fail2!(); } + _ => { fail!(); } } }) diff --git a/src/test/run-pass/match-bot-2.rs b/src/test/run-pass/match-bot-2.rs index 3abc4435edc5..ba897bd92c01 100644 --- a/src/test/run-pass/match-bot-2.rs +++ b/src/test/run-pass/match-bot-2.rs @@ -9,5 +9,5 @@ // except according to those terms. // n.b. This was only ever failing with optimization disabled. -fn a() -> int { match return 1 { 2 => 3, _ => fail2!() } } +fn a() -> int { match return 1 { 2 => 3, _ => fail!() } } pub fn main() { a(); } diff --git a/src/test/run-pass/match-bot.rs b/src/test/run-pass/match-bot.rs index fd26dbfac0f8..861d72ea228a 100644 --- a/src/test/run-pass/match-bot.rs +++ b/src/test/run-pass/match-bot.rs @@ -11,6 +11,6 @@ pub fn main() { let i: int = - match Some::(3) { None:: => { fail2!() } Some::(_) => { 5 } }; - info2!("{}", i); + match Some::(3) { None:: => { fail!() } Some::(_) => { 5 } }; + info!("{}", i); } diff --git a/src/test/run-pass/match-enum-struct-0.rs b/src/test/run-pass/match-enum-struct-0.rs index f5e4cf6c9260..0e3ecba8a357 100644 --- a/src/test/run-pass/match-enum-struct-0.rs +++ b/src/test/run-pass/match-enum-struct-0.rs @@ -20,7 +20,7 @@ enum E { pub fn main() { let e = Bar; match e { - Foo{f: _f} => fail2!(), + Foo{f: _f} => fail!(), _ => (), } } diff --git a/src/test/run-pass/match-enum-struct-1.rs b/src/test/run-pass/match-enum-struct-1.rs index 0f853cf64c57..5ee06e29cb8d 100644 --- a/src/test/run-pass/match-enum-struct-1.rs +++ b/src/test/run-pass/match-enum-struct-1.rs @@ -19,10 +19,10 @@ pub fn main() { let e = Foo{f: 1}; match e { Foo{_} => (), - _ => fail2!(), + _ => fail!(), } match e { Foo{f: _f} => (), - _ => fail2!(), + _ => fail!(), } } diff --git a/src/test/run-pass/match-join.rs b/src/test/run-pass/match-join.rs index e73319712aff..0f01985f274a 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() { info2!("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 416c932b6c7f..34d6597c62d1 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) { - info2!("{:?}", ::std::managed::refcount(s)); + info!("{:?}", ::std::managed::refcount(s)); let count = ::std::managed::refcount(s); let x: t = make_t(s); // ref up assert_eq!(::std::managed::refcount(s), count + 1u); - info2!("{:?}", ::std::managed::refcount(s)); + info!("{:?}", ::std::managed::refcount(s)); match x { make_t(y) => { - info2!("{:?}", y); // ref up then down + info!("{:?}", y); // ref up then down } - _ => { info2!("?"); fail2!(); } + _ => { info!("?"); fail!(); } } - info2!("{:?}", ::std::managed::refcount(s)); + info!("{:?}", ::std::managed::refcount(s)); assert_eq!(::std::managed::refcount(s), count + 1u); let _ = ::std::managed::refcount(s); // don't get bitten by last-use. } @@ -39,7 +39,7 @@ pub fn main() { foo(s); // ref up then down - info2!("{}", ::std::managed::refcount(s)); + info!("{}", ::std::managed::refcount(s)); let count2 = ::std::managed::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 9493b8d960de..84e9012be4e2 100644 --- a/src/test/run-pass/match-pattern-lit.rs +++ b/src/test/run-pass/match-pattern-lit.rs @@ -12,9 +12,9 @@ fn altlit(f: int) -> int { match f { - 10 => { info2!("case 10"); return 20; } - 11 => { info2!("case 11"); return 22; } - _ => fail2!("the impossible happened") + 10 => { info!("case 10"); return 20; } + 11 => { info!("case 11"); return 22; } + _ => fail!("the impossible happened") } } diff --git a/src/test/run-pass/match-pattern-no-type-params.rs b/src/test/run-pass/match-pattern-no-type-params.rs index 6ef3f75fbbc6..2076f46e8ab7 100644 --- a/src/test/run-pass/match-pattern-no-type-params.rs +++ b/src/test/run-pass/match-pattern-no-type-params.rs @@ -12,8 +12,8 @@ enum maybe { nothing, just(T), } fn foo(x: maybe) { match x { - nothing => { error2!("A"); } - just(_a) => { error2!("B"); } + nothing => { error!("A"); } + just(_a) => { error!("B"); } } } diff --git a/src/test/run-pass/match-pipe-binding.rs b/src/test/run-pass/match-pipe-binding.rs index 70832548f827..6df4c8123610 100644 --- a/src/test/run-pass/match-pipe-binding.rs +++ b/src/test/run-pass/match-pipe-binding.rs @@ -15,7 +15,7 @@ fn test1() { assert_eq!(a, ~"a"); assert_eq!(b, ~"b"); }, - _ => fail2!(), + _ => fail!(), } } @@ -25,7 +25,7 @@ fn test2() { assert_eq!(a, 2); assert_eq!(b, 3); }, - _ => fail2!(), + _ => fail!(), } } @@ -35,7 +35,7 @@ fn test3() { assert_eq!(*a, 2); assert_eq!(*b, 3); }, - _ => fail2!(), + _ => fail!(), } } @@ -45,7 +45,7 @@ fn test4() { assert_eq!(a, 2); assert_eq!(b, 3); }, - _ => fail2!(), + _ => fail!(), } } @@ -55,7 +55,7 @@ fn test5() { assert_eq!(*a, 2); assert_eq!(*b, 3); }, - _ => fail2!(), + _ => fail!(), } } diff --git a/src/test/run-pass/match-range.rs b/src/test/run-pass/match-range.rs index a95c4e5289b1..6b02b21a084b 100644 --- a/src/test/run-pass/match-range.rs +++ b/src/test/run-pass/match-range.rs @@ -11,31 +11,31 @@ pub fn main() { match 5u { 1u..5u => {} - _ => fail2!("should match range"), + _ => fail!("should match range"), } match 5u { - 6u..7u => fail2!("shouldn't match range"), + 6u..7u => fail!("shouldn't match range"), _ => {} } match 5u { - 1u => fail2!("should match non-first range"), + 1u => fail!("should match non-first range"), 2u..6u => {} - _ => fail2!("math is broken") + _ => fail!("math is broken") } match 'c' { 'a'..'z' => {} - _ => fail2!("should suppport char ranges") + _ => fail!("should suppport char ranges") } match -3 { -7..5 => {} - _ => fail2!("should match signed range") + _ => fail!("should match signed range") } match 3.0 { 1.0..5.0 => {} - _ => fail2!("should match float range") + _ => fail!("should match float range") } match -1.5 { -3.6..3.6 => {} - _ => fail2!("should match negative float range") + _ => fail!("should match negative float range") } } diff --git a/src/test/run-pass/match-ref-binding-in-guard-3256.rs b/src/test/run-pass/match-ref-binding-in-guard-3256.rs index 74a3f2553624..e1d2f0e1c484 100644 --- a/src/test/run-pass/match-ref-binding-in-guard-3256.rs +++ b/src/test/run-pass/match-ref-binding-in-guard-3256.rs @@ -17,7 +17,7 @@ pub fn main() { Some(ref z) if z.with(|b| *b) => { do z.with |b| { assert!(*b); } }, - _ => fail2!() + _ => fail!() } } } diff --git a/src/test/run-pass/match-str.rs b/src/test/run-pass/match-str.rs index ecec003519c8..8bbcc507f184 100644 --- a/src/test/run-pass/match-str.rs +++ b/src/test/run-pass/match-str.rs @@ -11,21 +11,21 @@ // Issue #53 pub fn main() { - match ~"test" { ~"not-test" => fail2!(), ~"test" => (), _ => fail2!() } + match ~"test" { ~"not-test" => fail!(), ~"test" => (), _ => fail!() } enum t { tag1(~str), tag2, } match tag1(~"test") { - tag2 => fail2!(), - tag1(~"not-test") => fail2!(), + tag2 => fail!(), + tag1(~"not-test") => fail!(), tag1(~"test") => (), - _ => fail2!() + _ => fail!() } - let x = match ~"a" { ~"a" => 1, ~"b" => 2, _ => fail2!() }; + let x = match ~"a" { ~"a" => 1, ~"b" => 2, _ => fail!() }; assert_eq!(x, 1); - match ~"a" { ~"a" => { } ~"b" => { }, _ => fail2!() } + match ~"a" { ~"a" => { } ~"b" => { }, _ => fail!() } } diff --git a/src/test/run-pass/match-struct-0.rs b/src/test/run-pass/match-struct-0.rs index 215b05ac73f4..67e844c519ee 100644 --- a/src/test/run-pass/match-struct-0.rs +++ b/src/test/run-pass/match-struct-0.rs @@ -15,15 +15,15 @@ struct Foo{ pub fn main() { let f = Foo{f: 1}; match f { - Foo{f: 0} => fail2!(), + Foo{f: 0} => fail!(), Foo{_} => (), } match f { - Foo{f: 0} => fail2!(), + Foo{f: 0} => fail!(), Foo{f: _f} => (), } match f { - Foo{f: 0} => fail2!(), + Foo{f: 0} => fail!(), _ => (), } } diff --git a/src/test/run-pass/match-unique-bind.rs b/src/test/run-pass/match-unique-bind.rs index 7f2af90d09af..50aa840e6d74 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 => { - info2!("{:?}", x); + info!("{:?}", x); assert_eq!(x, 100); } } diff --git a/src/test/run-pass/match-with-ret-arm.rs b/src/test/run-pass/match-with-ret-arm.rs index 2476d440a157..4257442ea33c 100644 --- a/src/test/run-pass/match-with-ret-arm.rs +++ b/src/test/run-pass/match-with-ret-arm.rs @@ -19,5 +19,5 @@ pub fn main() { Some(num) => num as u32 }; assert_eq!(f, 1234u32); - error2!("{}", f) + error!("{}", f) } diff --git a/src/test/run-pass/morestack-address.rs b/src/test/run-pass/morestack-address.rs index ad8b32839ea4..ec678df357a8 100644 --- a/src/test/run-pass/morestack-address.rs +++ b/src/test/run-pass/morestack-address.rs @@ -19,6 +19,6 @@ pub fn main() { unsafe { let addr = rusti::morestack_addr(); assert!(addr.is_not_null()); - error2!("{}", addr); + error!("{}", addr); } } diff --git a/src/test/run-pass/mutable-alias-vec.rs b/src/test/run-pass/mutable-alias-vec.rs index 9ec91d930c05..0d08c11b664a 100644 --- a/src/test/run-pass/mutable-alias-vec.rs +++ b/src/test/run-pass/mutable-alias-vec.rs @@ -21,6 +21,6 @@ pub fn main() { grow(&mut v); grow(&mut v); let len = v.len(); - info2!("{}", len); + info!("{}", len); assert_eq!(len, 3 as uint); } diff --git a/src/test/run-pass/negative.rs b/src/test/run-pass/negative.rs index a435f2c6050d..d92496c4b7b4 100644 --- a/src/test/run-pass/negative.rs +++ b/src/test/run-pass/negative.rs @@ -11,6 +11,6 @@ pub fn main() { match -5 { -5 => {} - _ => { fail2!() } + _ => { fail!() } } } diff --git a/src/test/run-pass/nested-matchs.rs b/src/test/run-pass/nested-matchs.rs index 9c728194e90d..a516e2bf9bc0 100644 --- a/src/test/run-pass/nested-matchs.rs +++ b/src/test/run-pass/nested-matchs.rs @@ -9,16 +9,16 @@ // except according to those terms. -fn baz() -> ! { fail2!(); } +fn baz() -> ! { fail!(); } fn foo() { match Some::(5) { Some::(_x) => { let mut bar; match None:: { None:: => { bar = 5; } _ => { baz(); } } - info2!("{:?}", bar); + info!("{:?}", bar); } - None:: => { info2!("hello"); } + None:: => { info!("hello"); } } } diff --git a/src/test/run-pass/nested-pattern.rs b/src/test/run-pass/nested-pattern.rs index cc8436e7c4b2..0bc6280393cf 100644 --- a/src/test/run-pass/nested-pattern.rs +++ b/src/test/run-pass/nested-pattern.rs @@ -16,8 +16,8 @@ enum t { foo(int, uint), bar(int, Option), } fn nested(o: t) { match o { - bar(_i, Some::(_)) => { error2!("wrong pattern matched"); fail2!(); } - _ => { error2!("succeeded"); } + bar(_i, Some::(_)) => { error!("wrong pattern matched"); fail!(); } + _ => { error!("succeeded"); } } } diff --git a/src/test/run-pass/nested-patterns.rs b/src/test/run-pass/nested-patterns.rs index b979518f8a10..d901a625e1d1 100644 --- a/src/test/run-pass/nested-patterns.rs +++ b/src/test/run-pass/nested-patterns.rs @@ -16,7 +16,7 @@ struct C { c: int } pub fn main() { match A {a: 10, b: @20} { x@A {a, b: @20} => { assert!(x.a == 10); assert!(a == 10); } - A {b: _b, _} => { fail2!(); } + A {b: _b, _} => { fail!(); } } let mut x@B {b, _} = B {a: 10, b: C {c: 20}}; x.b.c = 30; diff --git a/src/test/run-pass/opeq.rs b/src/test/run-pass/opeq.rs index 5172af171844..c83a3b7dfd0c 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; - info2!("{}", x); + info!("{}", x); assert_eq!(x, 2); x += 3; - info2!("{}", x); + info!("{}", x); assert_eq!(x, 5); x *= x; - info2!("{}", x); + info!("{}", x); assert_eq!(x, 25); x /= 5; - info2!("{}", x); + info!("{}", x); assert_eq!(x, 5); } diff --git a/src/test/run-pass/option-unwrap.rs b/src/test/run-pass/option-unwrap.rs index 7c8872fae8a7..66cd7f2b55f7 100644 --- a/src/test/run-pass/option-unwrap.rs +++ b/src/test/run-pass/option-unwrap.rs @@ -24,7 +24,7 @@ impl Drop for dtor { fn unwrap(o: Option) -> T { match o { Some(v) => v, - None => fail2!() + None => fail!() } } diff --git a/src/test/run-pass/over-constrained-vregs.rs b/src/test/run-pass/over-constrained-vregs.rs index 0fc56cecec55..cbd0416cb69b 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; - info2!("{:?}", b); + info!("{:?}", b); } } diff --git a/src/test/run-pass/overload-index-operator.rs b/src/test/run-pass/overload-index-operator.rs index 8de802e1fc97..b475222619d6 100644 --- a/src/test/run-pass/overload-index-operator.rs +++ b/src/test/run-pass/overload-index-operator.rs @@ -36,7 +36,7 @@ impl Index for AssociationList { return pair.value.clone(); } } - fail2!("No value found for key: {:?}", index); + fail!("No value found for key: {:?}", index); } } diff --git a/src/test/run-pass/paren-free.rs b/src/test/run-pass/paren-free.rs index 29789f38a4bf..751ba78b2820 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 => { info2!("right"); } false => { info2!("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 7d4a74fe32cb..cfb5ecb1f5db 100644 --- a/src/test/run-pass/parse-fail.rs +++ b/src/test/run-pass/parse-fail.rs @@ -11,6 +11,6 @@ #[allow(unreachable_code)]; // -*- rust -*- -fn dont_call_me() { fail2!(); info2!("{}", 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 a9cfd3aa1832..14ce305d6c1b 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) { info2!("{:?}", x); } -fn magic2(x: @int) { info2!("{:?}", x); } +fn magic(x: A) { info!("{:?}", x); } +fn magic2(x: @int) { info!("{:?}", x); } struct A { a: @int } diff --git a/src/test/run-pass/purity-infer.rs b/src/test/run-pass/purity-infer.rs index 030df6bcc085..debde77b2112 100644 --- a/src/test/run-pass/purity-infer.rs +++ b/src/test/run-pass/purity-infer.rs @@ -11,5 +11,5 @@ fn something(f: &fn()) { f(); } pub fn main() { - something(|| error2!("hi!") ); + something(|| error!("hi!") ); } diff --git a/src/test/run-pass/rcvr-borrowed-to-region.rs b/src/test/run-pass/rcvr-borrowed-to-region.rs index 376a14924c08..8f256bbf2a40 100644 --- a/src/test/run-pass/rcvr-borrowed-to-region.rs +++ b/src/test/run-pass/rcvr-borrowed-to-region.rs @@ -28,16 +28,16 @@ pub fn main() { let x = @6; let y = x.get(); - info2!("y={}", y); + info!("y={}", y); assert_eq!(y, 6); let x = ~6; let y = x.get(); - info2!("y={}", y); + info!("y={}", y); assert_eq!(y, 6); let x = &6; let y = x.get(); - info2!("y={}", y); + info!("y={}", 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 1f1b9d3d1ee9..fd37cc12302d 100644 --- a/src/test/run-pass/rcvr-borrowed-to-slice.rs +++ b/src/test/run-pass/rcvr-borrowed-to-slice.rs @@ -24,16 +24,16 @@ fn call_sum(x: &[int]) -> int { x.sum_() } pub fn main() { let x = ~[1, 2, 3]; let y = call_sum(x); - info2!("y=={}", y); + info!("y=={}", y); assert_eq!(y, 6); let x = ~[1, 2, 3]; let y = x.sum_(); - info2!("y=={}", y); + info!("y=={}", y); assert_eq!(y, 6); let x = ~[1, 2, 3]; let y = x.sum_(); - info2!("y=={}", y); + info!("y=={}", 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 43304b66176d..55375b628440 100644 --- a/src/test/run-pass/rec-align-u32.rs +++ b/src/test/run-pass/rec-align-u32.rs @@ -54,9 +54,9 @@ pub fn main() { // Send it through the shape code let y = format!("{:?}", x); - info2!("align inner = {:?}", rusti::min_align_of::()); - info2!("size outer = {:?}", mem::size_of::()); - info2!("y = {}", y); + info!("align inner = {:?}", rusti::min_align_of::()); + info!("size outer = {:?}", mem::size_of::()); + info!("y = {}", 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 5adb8cf95105..9185ac123b28 100644 --- a/src/test/run-pass/rec-align-u64.rs +++ b/src/test/run-pass/rec-align-u64.rs @@ -76,9 +76,9 @@ pub fn main() { // Send it through the shape code let y = format!("{:?}", x); - info2!("align inner = {}", rusti::min_align_of::()); - info2!("size outer = {}", mem::size_of::()); - info2!("y = {}", y); + info!("align inner = {}", rusti::min_align_of::()); + info!("size outer = {}", mem::size_of::()); + info!("y = {}", 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 086d03ae4e30..669965bd617c 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"}; - info2!("{}", x.foo.clone()); - info2!("{}", x.bar.clone()); + info!("{}", x.foo.clone()); + info!("{}", x.bar.clone()); } diff --git a/src/test/run-pass/reflect-visit-data.rs b/src/test/run-pass/reflect-visit-data.rs index 5a2243b19408..9e7021a56bbf 100644 --- a/src/test/run-pass/reflect-visit-data.rs +++ b/src/test/run-pass/reflect-visit-data.rs @@ -551,7 +551,7 @@ impl TyVisitor for my_visitor { _sz: uint, _align: uint) -> bool { true } fn visit_rec_field(&mut self, _i: uint, _name: &str, _mtbl: uint, inner: *TyDesc) -> bool { - error2!("rec field!"); + error!("rec field!"); self.visit_inner(inner) } fn visit_leave_rec(&mut self, _n_fields: uint, @@ -569,7 +569,7 @@ impl TyVisitor for my_visitor { fn visit_enter_tup(&mut self, _n_fields: uint, _sz: uint, _align: uint) -> bool { true } fn visit_tup_field(&mut self, _i: uint, inner: *TyDesc) -> bool { - error2!("tup field!"); + error!("tup field!"); self.visit_inner(inner) } fn visit_leave_tup(&mut self, _n_fields: uint, @@ -633,7 +633,7 @@ pub fn main() { vals: ~[]}); let mut v = ptr_visit_adaptor(Inner {inner: u}); let td = get_tydesc_for(r); - error2!("tydesc sz: {}, align: {}", + error!("tydesc sz: {}, align: {}", (*td).size, (*td).align); visit_tydesc(td, &mut v as &mut TyVisitor); @@ -641,7 +641,7 @@ pub fn main() { for s in r.iter() { println!("val: {}", *s); } - error2!("{:?}", u.vals.clone()); + error!("{:?}", u.vals.clone()); assert_eq!(u.vals.clone(), ~[ ~"1", ~"2", ~"3", ~"true", ~"false", ~"5", ~"4", ~"3", ~"12"]); } diff --git a/src/test/run-pass/reflect-visit-type.rs b/src/test/run-pass/reflect-visit-type.rs index 0afc5dd1b17e..e447c9c650c9 100644 --- a/src/test/run-pass/reflect-visit-type.rs +++ b/src/test/run-pass/reflect-visit-type.rs @@ -17,32 +17,32 @@ struct MyVisitor { impl TyVisitor for MyVisitor { fn visit_bot(&mut self) -> bool { self.types.push(~"bot"); - error2!("visited bot type"); + error!("visited bot type"); true } fn visit_nil(&mut self) -> bool { self.types.push(~"nil"); - error2!("visited nil type"); + error!("visited nil type"); true } fn visit_bool(&mut self) -> bool { self.types.push(~"bool"); - error2!("visited bool type"); + error!("visited bool type"); true } fn visit_int(&mut self) -> bool { self.types.push(~"int"); - error2!("visited int type"); + error!("visited int type"); true } fn visit_i8(&mut self) -> bool { self.types.push(~"i8"); - error2!("visited i8 type"); + error!("visited i8 type"); true } fn visit_i16(&mut self) -> bool { self.types.push(~"i16"); - error2!("visited i16 type"); + error!("visited i16 type"); true } fn visit_i32(&mut self) -> bool { true } diff --git a/src/test/run-pass/region-dependent-addr-of.rs b/src/test/run-pass/region-dependent-addr-of.rs index 1d44d8defdc1..d8076f543ecc 100644 --- a/src/test/run-pass/region-dependent-addr-of.rs +++ b/src/test/run-pass/region-dependent-addr-of.rs @@ -57,21 +57,21 @@ fn get_v5<'v>(a: &'v A, _i: uint) -> &'v int { fn get_v6_a<'v>(a: &'v A, _i: uint) -> &'v int { match a.value.v6 { Some(ref v) => &v.f, - None => fail2!() + None => fail!() } } fn get_v6_b<'v>(a: &'v A, _i: uint) -> &'v int { match *a { A { value: B { v6: Some(ref v), _ } } => &v.f, - _ => fail2!() + _ => fail!() } } fn get_v6_c<'v>(a: &'v A, _i: uint) -> &'v int { match a { &A { value: B { v6: Some(ref v), _ } } => &v.f, - _ => fail2!() + _ => fail!() } } diff --git a/src/test/run-pass/region-return-interior-of-option.rs b/src/test/run-pass/region-return-interior-of-option.rs index 9258b149fd31..aa4630717db6 100644 --- a/src/test/run-pass/region-return-interior-of-option.rs +++ b/src/test/run-pass/region-return-interior-of-option.rs @@ -11,7 +11,7 @@ fn get<'r, T>(opt: &'r Option) -> &'r T { match *opt { Some(ref v) => v, - None => fail2!("none") + None => fail!("none") } } diff --git a/src/test/run-pass/regions-addr-of-ret.rs b/src/test/run-pass/regions-addr-of-ret.rs index 08b1d2498693..898759f67d24 100644 --- a/src/test/run-pass/regions-addr-of-ret.rs +++ b/src/test/run-pass/regions-addr-of-ret.rs @@ -14,5 +14,5 @@ fn f<'a>(x : &'a int) -> &'a int { pub fn main() { let three = &3; - error2!("{}", *f(three)); + error!("{}", *f(three)); } diff --git a/src/test/run-pass/regions-borrow-at.rs b/src/test/run-pass/regions-borrow-at.rs index a504296a182b..b4ec9914f263 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); - info2!("r={}", r); + info!("r={}", r); assert_eq!(r, 22u); } diff --git a/src/test/run-pass/regions-bot.rs b/src/test/run-pass/regions-bot.rs index 5d8d5d6033a4..dbc5bf6626af 100644 --- a/src/test/run-pass/regions-bot.rs +++ b/src/test/run-pass/regions-bot.rs @@ -10,7 +10,7 @@ // A very limited test of the "bottom" region -fn produce_static() -> &'static T { fail2!(); } +fn produce_static() -> &'static T { fail!(); } fn foo(_x: &T) -> &uint { produce_static() } diff --git a/src/test/run-pass/regions-self-impls.rs b/src/test/run-pass/regions-self-impls.rs index 61d088851fd0..ceff247b5dd7 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 }; - info2!("{:?}", *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 f0b7306990dd..1b429110e10e 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; } } - info2!("{:?}", *z); + info!("{:?}", *z); } diff --git a/src/test/run-pass/regions-simple.rs b/src/test/run-pass/regions-simple.rs index e57c2e9807e0..bb612c5b0df2 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; - info2!("{:?}", *y); + info!("{:?}", *y); } diff --git a/src/test/run-pass/regions-static-closure.rs b/src/test/run-pass/regions-static-closure.rs index 3cb6fea3e532..a2eb459ce206 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(|| info2!("Hello, world!")); + let cl_box = box_it(|| info!("Hello, world!")); call_static_closure(cl_box); } diff --git a/src/test/run-pass/repeated-vector-syntax.rs b/src/test/run-pass/repeated-vector-syntax.rs index 6291e229b6c9..465c9b7090e6 100644 --- a/src/test/run-pass/repeated-vector-syntax.rs +++ b/src/test/run-pass/repeated-vector-syntax.rs @@ -17,6 +17,6 @@ pub fn main() { let x = [ @[true], ..512 ]; let y = [ 0, ..1 ]; - error2!("{:?}", x); - error2!("{:?}", y); + error!("{:?}", x); + error!("{:?}", y); } 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 2e30044f3188..f5bc9895755e 100644 --- a/src/test/run-pass/resource-assign-is-not-copy.rs +++ b/src/test/run-pass/resource-assign-is-not-copy.rs @@ -32,7 +32,7 @@ pub fn main() { let a = r(i); let b = (a, 10); let (c, _d) = b; - info2!("{:?}", 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 e7384203310c..0c0707e9036a 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(&mut self) { unsafe { - info2!("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::<*mut r, uint>(self), cast::transmute::<**int, uint>(&(self.v)), cast::transmute::<*int, uint>(self.v)); @@ -54,11 +54,11 @@ pub fn main() { next: None, r: { let rs = r(i1p); - info2!("r = {:x}", cast::transmute::<*r, uint>(&rs)); + info!("r = {:x}", cast::transmute::<*r, uint>(&rs)); rs } }); - info2!("x1 = {:x}, x1.r = {:x}", + info!("x1 = {:x}, x1.r = {:x}", cast::transmute::<@mut t, uint>(x1), cast::transmute::<*r, uint>(&x1.r)); @@ -66,12 +66,12 @@ pub fn main() { next: None, r: { let rs = r(i2p); - info2!("r2 = {:x}", cast::transmute::<*r, uint>(&rs)); + info!("r2 = {:x}", cast::transmute::<*r, uint>(&rs)); rs } }); - info2!("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/resource-destruct.rs b/src/test/run-pass/resource-destruct.rs index 70adccbb9c92..50b6509bb736 100644 --- a/src/test/run-pass/resource-destruct.rs +++ b/src/test/run-pass/resource-destruct.rs @@ -15,7 +15,7 @@ struct shrinky_pointer { #[unsafe_destructor] impl Drop for shrinky_pointer { fn drop(&mut self) { - error2!("Hello!"); **(self.i) -= 1; + error!("Hello!"); **(self.i) -= 1; } } @@ -32,6 +32,6 @@ fn shrinky_pointer(i: @@mut int) -> shrinky_pointer { pub fn main() { let my_total = @@mut 10; { let pt = shrinky_pointer(my_total); assert!((pt.look_at() == 10)); } - error2!("my_total = {}", **my_total); + error!("my_total = {}", **my_total); assert_eq!(**my_total, 9); } diff --git a/src/test/run-pass/ret-bang.rs b/src/test/run-pass/ret-bang.rs index f56cf57e12e9..9754b08cd18a 100644 --- a/src/test/run-pass/ret-bang.rs +++ b/src/test/run-pass/ret-bang.rs @@ -12,7 +12,7 @@ // -*- rust -*- -fn my_err(s: ~str) -> ! { error2!("{:?}", s); fail2!(); } +fn my_err(s: ~str) -> ! { error!("{:?}", s); fail!(); } fn okay(i: uint) -> int { if i == 3u { my_err(~"I don't like three"); } else { return 42; } diff --git a/src/test/run-pass/rt-start-main-thread.rs b/src/test/run-pass/rt-start-main-thread.rs index 9a6dfb22106a..47a723ce6e14 100644 --- a/src/test/run-pass/rt-start-main-thread.rs +++ b/src/test/run-pass/rt-start-main-thread.rs @@ -13,9 +13,9 @@ #[start] fn start(argc: int, argv: **u8) -> int { do std::rt::start_on_main_thread(argc, argv) { - info2!("running on main thread"); + info!("running on main thread"); do spawn { - info2!("running on another thread"); + info!("running on another thread"); } } } diff --git a/src/test/run-pass/sendfn-generic-fn.rs b/src/test/run-pass/sendfn-generic-fn.rs index 7cc83e2ff546..d077db69c2a8 100644 --- a/src/test/run-pass/sendfn-generic-fn.rs +++ b/src/test/run-pass/sendfn-generic-fn.rs @@ -26,12 +26,12 @@ fn make_generic_record(a: A, b: B) -> Pair { fn test05_start(f: &~fn(v: f64, v: ~str) -> Pair) { let p = (*f)(22.22, ~"Hi"); - info2!("{:?}", p.clone()); + info!("{:?}", p.clone()); assert!(p.a == 22.22); assert!(p.b == ~"Hi"); let q = (*f)(44.44, ~"Ho"); - info2!("{:?}", q.clone()); + info!("{:?}", q.clone()); assert!(q.a == 44.44); assert!(q.b == ~"Ho"); } diff --git a/src/test/run-pass/sendfn-spawn-with-fn-arg.rs b/src/test/run-pass/sendfn-spawn-with-fn-arg.rs index 6cc8b27834cf..ecf1830864cd 100644 --- a/src/test/run-pass/sendfn-spawn-with-fn-arg.rs +++ b/src/test/run-pass/sendfn-spawn-with-fn-arg.rs @@ -20,7 +20,7 @@ fn test05_start(f: ~fn(int)) { fn test05() { let three = ~3; let fn_to_send: ~fn(int) = |n| { - error2!("{}", *three + n); // will copy x into the closure + error!("{}", *three + n); // will copy x into the closure assert_eq!(*three, 3); }; let fn_to_send = Cell::new(fn_to_send); diff --git a/src/test/run-pass/shadow.rs b/src/test/run-pass/shadow.rs index 345c2aad0d38..050c505b7c14 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 _i in c.iter() { - info2!("{:?}", a); + info!("{:?}", a); let a = 17; b.push(a); } diff --git a/src/test/run-pass/shape_intrinsic_tag_then_rec.rs b/src/test/run-pass/shape_intrinsic_tag_then_rec.rs index a989ac68d711..4420804aad1b 100644 --- a/src/test/run-pass/shape_intrinsic_tag_then_rec.rs +++ b/src/test/run-pass/shape_intrinsic_tag_then_rec.rs @@ -57,6 +57,6 @@ pub fn main() { let p_: Path_ = Path_ { global: true, idents: ~[~"hi"], types: ~[t] }; let p: path = Spanned { data: p_, span: sp }; let x = X { sp: sp, path: p }; - error2!("{:?}", x.path.clone()); - error2!("{:?}", x.clone()); + error!("{:?}", x.path.clone()); + error!("{:?}", x.clone()); } diff --git a/src/test/run-pass/simple-infer.rs b/src/test/run-pass/simple-infer.rs index 0924655a7671..e3d3b3389ba1 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; info2!("{}", 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 1c080bb8146b..d8b7c99d000a 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:: => { info2!("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 d34da045c02d..4d2309cb8697 100644 --- a/src/test/run-pass/size-and-align.rs +++ b/src/test/run-pass/size-and-align.rs @@ -17,11 +17,11 @@ enum clam { a(T, int), b, } fn uhoh(v: ~[clam]) { match v[1] { a::(ref _t, ref u) => { - info2!("incorrect"); - info2!("{:?}", u); - fail2!(); + info!("incorrect"); + info!("{:?}", u); + fail!(); } - b:: => { info2!("correct"); } + b:: => { info!("correct"); } } } diff --git a/src/test/run-pass/spawn-fn.rs b/src/test/run-pass/spawn-fn.rs index f95ddcad4d63..b8f356f80d4c 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) { - info2!("{:?}", s); - info2!("{:?}", 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; info2!("parent sleeping"); task::deschedule(); } + while i > 0 { i = i - 1; info!("parent sleeping"); task::deschedule(); } } diff --git a/src/test/run-pass/spawn.rs b/src/test/run-pass/spawn.rs index 9273752d6293..5c24c6228120 100644 --- a/src/test/run-pass/spawn.rs +++ b/src/test/run-pass/spawn.rs @@ -17,4 +17,4 @@ pub fn main() { task::spawn(|| child(10) ); } -fn child(i: int) { error2!("{}", i); assert!((i == 10)); } +fn child(i: int) { error!("{}", i); assert!((i == 10)); } diff --git a/src/test/run-pass/spawn2.rs b/src/test/run-pass/spawn2.rs index 31967b31c638..a94877714c59 100644 --- a/src/test/run-pass/spawn2.rs +++ b/src/test/run-pass/spawn2.rs @@ -15,15 +15,15 @@ pub fn main() { task::spawn(|| child((10, 20, 30, 40, 50, 60, 70, 80, 90)) ); } fn child(args: (int, int, int, int, int, int, int, int, int)) { let (i1, i2, i3, i4, i5, i6, i7, i8, i9) = args; - error2!("{}", i1); - error2!("{}", i2); - error2!("{}", i3); - error2!("{}", i4); - error2!("{}", i5); - error2!("{}", i6); - error2!("{}", i7); - error2!("{}", i8); - error2!("{}", i9); + error!("{}", i1); + error!("{}", i2); + error!("{}", i3); + error!("{}", i4); + error!("{}", i5); + error!("{}", i6); + error!("{}", i7); + error!("{}", i8); + error!("{}", i9); assert_eq!(i1, 10); assert_eq!(i2, 20); assert_eq!(i3, 30); diff --git a/src/test/run-pass/stat.rs b/src/test/run-pass/stat.rs index aa0661d49a21..7501c46079d9 100644 --- a/src/test/run-pass/stat.rs +++ b/src/test/run-pass/stat.rs @@ -23,7 +23,7 @@ pub fn main() { { match io::file_writer(&path, [io::Create, io::Truncate]) { - Err(ref e) => fail2!("{}", e.clone()), + Err(ref e) => fail!("{}", e.clone()), Ok(f) => { for _ in range(0u, 1000) { f.write_u8(0); diff --git a/src/test/run-pass/str-append.rs b/src/test/run-pass/str-append.rs index fe57c5dd4e51..127838fd9ec9 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"); - info2!("{}", 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"; - info2!("{}", a.clone()); - info2!("{}", 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 dc605c50bb0f..870fc20f7711 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; - info2!("{}", 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 ca80f71cca7f..ebed8e24a484 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]; - info2!("{:?}", c); + info!("{:?}", c); assert_eq!(c, 0x6f as u8); } diff --git a/src/test/run-pass/string-self-append.rs b/src/test/run-pass/string-self-append.rs index f230bb38701e..68f1e21571c3 100644 --- a/src/test/run-pass/string-self-append.rs +++ b/src/test/run-pass/string-self-append.rs @@ -16,7 +16,7 @@ pub fn main() { let mut i = 20; let mut expected_len = 1u; while i > 0 { - error2!("{}", a.len()); + error!("{}", a.len()); assert_eq!(a.len(), expected_len); a = a + a; // FIXME(#3387)---can't write a += a i -= 1; diff --git a/src/test/run-pass/struct-literal-dtor.rs b/src/test/run-pass/struct-literal-dtor.rs index a4238799d09f..c5f8d0410d81 100644 --- a/src/test/run-pass/struct-literal-dtor.rs +++ b/src/test/run-pass/struct-literal-dtor.rs @@ -14,7 +14,7 @@ struct foo { impl Drop for foo { fn drop(&mut self) { - error2!("{}", self.x); + error!("{}", self.x); } } diff --git a/src/test/run-pass/struct-return.rs b/src/test/run-pass/struct-return.rs index 7b5988b9b3dd..8b22b4c9ac10 100644 --- a/src/test/run-pass/struct-return.rs +++ b/src/test/run-pass/struct-return.rs @@ -31,10 +31,10 @@ fn test1() { c: 0xcccc_cccc_cccc_cccc_u64, d: 0xdddd_dddd_dddd_dddd_u64 }; let qq = rustrt::rust_dbg_abi_1(q); - error2!("a: {:x}", qq.a as uint); - error2!("b: {:x}", qq.b as uint); - error2!("c: {:x}", qq.c as uint); - error2!("d: {:x}", qq.d as uint); + error!("a: {:x}", qq.a as uint); + error!("b: {:x}", qq.b as uint); + error!("c: {:x}", qq.c as uint); + error!("d: {:x}", qq.d as uint); assert_eq!(qq.a, q.c + 1u64); assert_eq!(qq.b, q.d - 1u64); assert_eq!(qq.c, q.a + 1u64); @@ -51,9 +51,9 @@ fn test2() { b: 0b_1010_1010_u8, c: 1.0987654321e-15_f64 }; let ff = rustrt::rust_dbg_abi_2(f); - error2!("a: {}", ff.a as f64); - error2!("b: {}", ff.b as uint); - error2!("c: {}", ff.c as f64); + error!("a: {}", ff.a as f64); + error!("b: {}", ff.b as uint); + error!("c: {}", ff.c as f64); assert_eq!(ff.a, f.c + 1.0f64); assert_eq!(ff.b, 0xff_u8); assert_eq!(ff.c, f.a - 1.0f64); diff --git a/src/test/run-pass/supported-cast.rs b/src/test/run-pass/supported-cast.rs index 090e932d8dc8..60e5a157bfc4 100644 --- a/src/test/run-pass/supported-cast.rs +++ b/src/test/run-pass/supported-cast.rs @@ -12,221 +12,221 @@ use std::libc; pub fn main() { let f = 1 as *libc::FILE; - info2!("{}", f as int); - info2!("{}", f as uint); - info2!("{}", f as i8); - info2!("{}", f as i16); - info2!("{}", f as i32); - info2!("{}", f as i64); - info2!("{}", f as u8); - info2!("{}", f as u16); - info2!("{}", f as u32); - info2!("{}", 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); - info2!("{}", 1 as int); - info2!("{}", 1 as uint); - info2!("{}", 1 as *libc::FILE); - info2!("{}", 1 as i8); - info2!("{}", 1 as i16); - info2!("{}", 1 as i32); - info2!("{}", 1 as i64); - info2!("{}", 1 as u8); - info2!("{}", 1 as u16); - info2!("{}", 1 as u32); - info2!("{}", 1 as u64); - info2!("{}", 1 as f32); - info2!("{}", 1 as f64); + info!("{}", 1 as int); + info!("{}", 1 as uint); + 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); - info2!("{}", 1u as int); - info2!("{}", 1u as uint); - info2!("{}", 1u as *libc::FILE); - info2!("{}", 1u as i8); - info2!("{}", 1u as i16); - info2!("{}", 1u as i32); - info2!("{}", 1u as i64); - info2!("{}", 1u as u8); - info2!("{}", 1u as u16); - info2!("{}", 1u as u32); - info2!("{}", 1u as u64); - info2!("{}", 1u as f32); - info2!("{}", 1u as f64); + info!("{}", 1u as int); + info!("{}", 1u as uint); + 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); - info2!("{}", 1i8 as int); - info2!("{}", 1i8 as uint); - info2!("{}", 1i8 as *libc::FILE); - info2!("{}", 1i8 as i8); - info2!("{}", 1i8 as i16); - info2!("{}", 1i8 as i32); - info2!("{}", 1i8 as i64); - info2!("{}", 1i8 as u8); - info2!("{}", 1i8 as u16); - info2!("{}", 1i8 as u32); - info2!("{}", 1i8 as u64); - info2!("{}", 1i8 as f32); - info2!("{}", 1i8 as f64); + info!("{}", 1i8 as int); + info!("{}", 1i8 as uint); + 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); - info2!("{}", 1u8 as int); - info2!("{}", 1u8 as uint); - info2!("{}", 1u8 as *libc::FILE); - info2!("{}", 1u8 as i8); - info2!("{}", 1u8 as i16); - info2!("{}", 1u8 as i32); - info2!("{}", 1u8 as i64); - info2!("{}", 1u8 as u8); - info2!("{}", 1u8 as u16); - info2!("{}", 1u8 as u32); - info2!("{}", 1u8 as u64); - info2!("{}", 1u8 as f32); - info2!("{}", 1u8 as f64); + info!("{}", 1u8 as int); + info!("{}", 1u8 as uint); + 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); - info2!("{}", 1i16 as int); - info2!("{}", 1i16 as uint); - info2!("{}", 1i16 as *libc::FILE); - info2!("{}", 1i16 as i8); - info2!("{}", 1i16 as i16); - info2!("{}", 1i16 as i32); - info2!("{}", 1i16 as i64); - info2!("{}", 1i16 as u8); - info2!("{}", 1i16 as u16); - info2!("{}", 1i16 as u32); - info2!("{}", 1i16 as u64); - info2!("{}", 1i16 as f32); - info2!("{}", 1i16 as f64); + info!("{}", 1i16 as int); + info!("{}", 1i16 as uint); + 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); - info2!("{}", 1u16 as int); - info2!("{}", 1u16 as uint); - info2!("{}", 1u16 as *libc::FILE); - info2!("{}", 1u16 as i8); - info2!("{}", 1u16 as i16); - info2!("{}", 1u16 as i32); - info2!("{}", 1u16 as i64); - info2!("{}", 1u16 as u8); - info2!("{}", 1u16 as u16); - info2!("{}", 1u16 as u32); - info2!("{}", 1u16 as u64); - info2!("{}", 1u16 as f32); - info2!("{}", 1u16 as f64); + info!("{}", 1u16 as int); + info!("{}", 1u16 as uint); + 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); - info2!("{}", 1i32 as int); - info2!("{}", 1i32 as uint); - info2!("{}", 1i32 as *libc::FILE); - info2!("{}", 1i32 as i8); - info2!("{}", 1i32 as i16); - info2!("{}", 1i32 as i32); - info2!("{}", 1i32 as i64); - info2!("{}", 1i32 as u8); - info2!("{}", 1i32 as u16); - info2!("{}", 1i32 as u32); - info2!("{}", 1i32 as u64); - info2!("{}", 1i32 as f32); - info2!("{}", 1i32 as f64); + info!("{}", 1i32 as int); + info!("{}", 1i32 as uint); + 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); - info2!("{}", 1u32 as int); - info2!("{}", 1u32 as uint); - info2!("{}", 1u32 as *libc::FILE); - info2!("{}", 1u32 as i8); - info2!("{}", 1u32 as i16); - info2!("{}", 1u32 as i32); - info2!("{}", 1u32 as i64); - info2!("{}", 1u32 as u8); - info2!("{}", 1u32 as u16); - info2!("{}", 1u32 as u32); - info2!("{}", 1u32 as u64); - info2!("{}", 1u32 as f32); - info2!("{}", 1u32 as f64); + info!("{}", 1u32 as int); + info!("{}", 1u32 as uint); + 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); - info2!("{}", 1i64 as int); - info2!("{}", 1i64 as uint); - info2!("{}", 1i64 as *libc::FILE); - info2!("{}", 1i64 as i8); - info2!("{}", 1i64 as i16); - info2!("{}", 1i64 as i32); - info2!("{}", 1i64 as i64); - info2!("{}", 1i64 as u8); - info2!("{}", 1i64 as u16); - info2!("{}", 1i64 as u32); - info2!("{}", 1i64 as u64); - info2!("{}", 1i64 as f32); - info2!("{}", 1i64 as f64); + info!("{}", 1i64 as int); + info!("{}", 1i64 as uint); + 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); - info2!("{}", 1u64 as int); - info2!("{}", 1u64 as uint); - info2!("{}", 1u64 as *libc::FILE); - info2!("{}", 1u64 as i8); - info2!("{}", 1u64 as i16); - info2!("{}", 1u64 as i32); - info2!("{}", 1u64 as i64); - info2!("{}", 1u64 as u8); - info2!("{}", 1u64 as u16); - info2!("{}", 1u64 as u32); - info2!("{}", 1u64 as u64); - info2!("{}", 1u64 as f32); - info2!("{}", 1u64 as f64); + info!("{}", 1u64 as int); + info!("{}", 1u64 as uint); + 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); - info2!("{}", 1u64 as int); - info2!("{}", 1u64 as uint); - info2!("{}", 1u64 as *libc::FILE); - info2!("{}", 1u64 as i8); - info2!("{}", 1u64 as i16); - info2!("{}", 1u64 as i32); - info2!("{}", 1u64 as i64); - info2!("{}", 1u64 as u8); - info2!("{}", 1u64 as u16); - info2!("{}", 1u64 as u32); - info2!("{}", 1u64 as u64); - info2!("{}", 1u64 as f32); - info2!("{}", 1u64 as f64); + info!("{}", 1u64 as int); + info!("{}", 1u64 as uint); + 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); - info2!("{}", true as int); - info2!("{}", true as uint); - info2!("{}", true as *libc::FILE); - info2!("{}", true as i8); - info2!("{}", true as i16); - info2!("{}", true as i32); - info2!("{}", true as i64); - info2!("{}", true as u8); - info2!("{}", true as u16); - info2!("{}", true as u32); - info2!("{}", true as u64); - info2!("{}", true as f32); - info2!("{}", true as f64); + info!("{}", true as int); + info!("{}", true as uint); + 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); - info2!("{}", 1. as int); - info2!("{}", 1. as uint); - info2!("{}", 1. as i8); - info2!("{}", 1. as i16); - info2!("{}", 1. as i32); - info2!("{}", 1. as i64); - info2!("{}", 1. as u8); - info2!("{}", 1. as u16); - info2!("{}", 1. as u32); - info2!("{}", 1. as u64); - info2!("{}", 1. as f32); - info2!("{}", 1. as f64); + info!("{}", 1. as int); + info!("{}", 1. as uint); + 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); - info2!("{}", 1f32 as int); - info2!("{}", 1f32 as uint); - info2!("{}", 1f32 as i8); - info2!("{}", 1f32 as i16); - info2!("{}", 1f32 as i32); - info2!("{}", 1f32 as i64); - info2!("{}", 1f32 as u8); - info2!("{}", 1f32 as u16); - info2!("{}", 1f32 as u32); - info2!("{}", 1f32 as u64); - info2!("{}", 1f32 as f32); - info2!("{}", 1f32 as f64); + info!("{}", 1f32 as int); + info!("{}", 1f32 as uint); + 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); - info2!("{}", 1f64 as int); - info2!("{}", 1f64 as uint); - info2!("{}", 1f64 as i8); - info2!("{}", 1f64 as i16); - info2!("{}", 1f64 as i32); - info2!("{}", 1f64 as i64); - info2!("{}", 1f64 as u8); - info2!("{}", 1f64 as u16); - info2!("{}", 1f64 as u32); - info2!("{}", 1f64 as u64); - info2!("{}", 1f64 as f32); - info2!("{}", 1f64 as f64); + info!("{}", 1f64 as int); + info!("{}", 1f64 as uint); + 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-cfg.rs b/src/test/run-pass/syntax-extension-cfg.rs index 89ca7de00e2b..321929207f7a 100644 --- a/src/test/run-pass/syntax-extension-cfg.rs +++ b/src/test/run-pass/syntax-extension-cfg.rs @@ -13,23 +13,23 @@ fn main() { // check - if ! cfg!(foo) { fail2!() } - if cfg!(not(foo)) { fail2!() } + if ! cfg!(foo) { fail!() } + if cfg!(not(foo)) { fail!() } - if ! cfg!(bar(baz)) { fail2!() } - if cfg!(not(bar(baz))) { fail2!() } + if ! cfg!(bar(baz)) { fail!() } + if cfg!(not(bar(baz))) { fail!() } - if ! cfg!(qux="foo") { fail2!() } - if cfg!(not(qux="foo")) { fail2!() } + if ! cfg!(qux="foo") { fail!() } + if cfg!(not(qux="foo")) { fail!() } - if ! cfg!(foo, bar(baz), qux="foo") { fail2!() } - if cfg!(not(foo, bar(baz), qux="foo")) { fail2!() } + if ! cfg!(foo, bar(baz), qux="foo") { fail!() } + if cfg!(not(foo, bar(baz), qux="foo")) { fail!() } - if cfg!(not_a_cfg) { fail2!() } - if cfg!(not_a_cfg, foo, bar(baz), qux="foo") { fail2!() } + if cfg!(not_a_cfg) { fail!() } + if cfg!(not_a_cfg, foo, bar(baz), qux="foo") { fail!() } - if ! cfg!(not(not_a_cfg)) { fail2!() } - if ! cfg!(not(not_a_cfg), foo, bar(baz), qux="foo") { fail2!() } + if ! cfg!(not(not_a_cfg)) { fail!() } + if ! cfg!(not(not_a_cfg), foo, bar(baz), qux="foo") { fail!() } - if cfg!(trailing_comma, ) { fail2!() } + if cfg!(trailing_comma, ) { fail!() } } diff --git a/src/test/run-pass/tag-align-shape.rs b/src/test/run-pass/tag-align-shape.rs index 6f5ca090052f..42d730ff6bfe 100644 --- a/src/test/run-pass/tag-align-shape.rs +++ b/src/test/run-pass/tag-align-shape.rs @@ -22,6 +22,6 @@ struct t_rec { pub fn main() { let x = t_rec {c8: 22u8, t: a_tag(44u64)}; let y = format!("{:?}", x); - info2!("y = {}", y); + info!("y = {}", y); assert_eq!(y, ~"t_rec{c8: 22u8, t: a_tag(44u64)}"); } diff --git a/src/test/run-pass/tail-cps.rs b/src/test/run-pass/tail-cps.rs index 9991f05aa3ac..22e2304c0ceb 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 { - info2!("evenk"); - info2!("{:?}", 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 { - info2!("oddk"); - info2!("{:?}", 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-0.rs b/src/test/run-pass/task-comm-0.rs index 69d66092abf6..804b03559fa2 100644 --- a/src/test/run-pass/task-comm-0.rs +++ b/src/test/run-pass/task-comm-0.rs @@ -20,21 +20,21 @@ pub fn main() { test05(); } fn test05_start(ch : &Chan) { ch.send(10); - error2!("sent 10"); + error!("sent 10"); ch.send(20); - error2!("sent 20"); + error!("sent 20"); ch.send(30); - error2!("sent 30"); + error!("sent 30"); } fn test05() { let (po, ch) = comm::stream(); task::spawn(|| test05_start(&ch) ); let mut value: int = po.recv(); - error2!("{}", value); + error!("{}", value); value = po.recv(); - error2!("{}", value); + error!("{}", value); value = po.recv(); - error2!("{}", value); + error!("{}", value); assert_eq!(value, 30); } diff --git a/src/test/run-pass/task-comm-1.rs b/src/test/run-pass/task-comm-1.rs index f169566653a3..d202bac7089b 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() { info2!("Started / Finished task."); } +fn start() { info!("Started / Finished task."); } fn test00() { task::try(|| start() ); - info2!("Completing."); + info!("Completing."); } diff --git a/src/test/run-pass/task-comm-10.rs b/src/test/run-pass/task-comm-10.rs index 023bb142e444..9195208fb96c 100644 --- a/src/test/run-pass/task-comm-10.rs +++ b/src/test/run-pass/task-comm-10.rs @@ -23,10 +23,10 @@ fn start(c: &comm::Chan>) { let mut b; a = p.recv(); assert!(a == ~"A"); - error2!("{:?}", a); + error!("{:?}", a); b = p.recv(); assert!(b == ~"B"); - error2!("{:?}", b); + error!("{:?}", b); } pub fn main() { diff --git a/src/test/run-pass/task-comm-12.rs b/src/test/run-pass/task-comm-12.rs index 9d5f89375904..0d221a6cb1d7 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) { info2!("Started / Finished task."); } +fn start(_task_number: int) { info!("Started / Finished task."); } fn test00() { let i: int = 0; @@ -34,5 +34,5 @@ fn test00() { // Try joining tasks that have already finished. result.recv(); - info2!("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 2bbed1497cc5..b039f01bf0cd 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() { - info2!("Check that we don't deadlock."); + info!("Check that we don't deadlock."); let (_p, ch) = comm::stream(); task::try(|| start(&ch, 0, 10) ); - info2!("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 cacaea5e8c06..da9b3703a99f 100644 --- a/src/test/run-pass/task-comm-14.rs +++ b/src/test/run-pass/task-comm-14.rs @@ -20,7 +20,7 @@ pub fn main() { // Spawn 10 tasks each sending us back one int. let mut i = 10; while (i > 0) { - info2!("{}", i); + info!("{}", i); let ch = ch.clone(); task::spawn({let i = i; || child(i, &ch)}); i = i - 1; @@ -31,15 +31,15 @@ pub fn main() { i = 10; while (i > 0) { - info2!("{}", i); + info!("{}", i); po.recv(); i = i - 1; } - info2!("main thread exiting"); + info!("main thread exiting"); } fn child(x: int, ch: &comm::SharedChan) { - info2!("{}", 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 b4a1a38faa20..eb48fa1812d7 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::SharedChan; use std::comm; use std::task; -pub fn main() { info2!("===== WITHOUT THREADS ====="); test00(); } +pub fn main() { info!("===== WITHOUT THREADS ====="); test00(); } fn test00_start(ch: &SharedChan, message: int, count: int) { - info2!("Starting test00_start"); + info!("Starting test00_start"); let mut i: int = 0; while i < count { - info2!("Sending Message"); + info!("Sending Message"); ch.send(message + 0); i = i + 1; } - info2!("Ending test00_start"); + info!("Ending test00_start"); } fn test00() { let number_of_tasks: int = 16; let number_of_messages: int = 4; - info2!("Creating tasks"); + info!("Creating tasks"); let (po, ch) = comm::stream(); let ch = comm::SharedChan::new(ch); @@ -67,8 +67,8 @@ fn test00() { // Join spawned tasks... for r in results.iter() { r.recv(); } - info2!("Completed: Final number is: "); - error2!("{:?}", sum); + info!("Completed: Final number is: "); + error!("{:?}", sum); // assert (sum == (((number_of_tasks * (number_of_tasks - 1)) / 2) * // number_of_messages)); assert_eq!(sum, 480); diff --git a/src/test/run-pass/task-comm-4.rs b/src/test/run-pass/task-comm-4.rs index 80d981b0d455..8e1704fe12f5 100644 --- a/src/test/run-pass/task-comm-4.rs +++ b/src/test/run-pass/task-comm-4.rs @@ -24,31 +24,31 @@ fn test00() { c.send(4); r = p.recv(); sum += r; - info2!("{}", r); + info!("{}", r); r = p.recv(); sum += r; - info2!("{}", r); + info!("{}", r); r = p.recv(); sum += r; - info2!("{}", r); + info!("{}", r); r = p.recv(); sum += r; - info2!("{}", r); + info!("{}", r); c.send(5); c.send(6); c.send(7); c.send(8); r = p.recv(); sum += r; - info2!("{}", r); + info!("{}", r); r = p.recv(); sum += r; - info2!("{}", r); + info!("{}", r); r = p.recv(); sum += r; - info2!("{}", r); + info!("{}", r); r = p.recv(); sum += r; - info2!("{}", 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 20d22204bede..049810ff5692 100644 --- a/src/test/run-pass/task-comm-9.rs +++ b/src/test/run-pass/task-comm-9.rs @@ -37,7 +37,7 @@ fn test00() { let mut i: int = 0; while i < number_of_messages { sum += p.recv(); - info2!("{:?}", r); + info!("{:?}", r); i += 1; } diff --git a/src/test/run-pass/tempfile.rs b/src/test/run-pass/tempfile.rs index 5d12f4e88177..142186853f52 100644 --- a/src/test/run-pass/tempfile.rs +++ b/src/test/run-pass/tempfile.rs @@ -41,7 +41,7 @@ fn test_rm_tempdir() { let f: ~fn() = || { let tmp = TempDir::new("test_rm_tempdir").unwrap(); wr.send(tmp.path().clone()); - fail2!("fail to unwind past `tmp`"); + fail!("fail to unwind past `tmp`"); }; task::try(f); let path = rd.recv(); @@ -52,7 +52,7 @@ fn test_rm_tempdir() { let cell = Cell::new(tmp); let f: ~fn() = || { let _tmp = cell.take(); - fail2!("fail to unwind past `tmp`"); + fail!("fail to unwind past `tmp`"); }; task::try(f); assert!(!os::path_exists(&path)); @@ -83,7 +83,7 @@ fn test_rm_tempdir() { fn recursive_mkdir_rel() { let path = Path::new("frob"); let cwd = os::getcwd(); - debug2!("recursive_mkdir_rel: Making: {} in cwd {} [{:?}]", path.display(), + debug!("recursive_mkdir_rel: Making: {} in cwd {} [{:?}]", path.display(), cwd.display(), os::path_exists(&path)); assert!(os::mkdir_recursive(&path, (S_IRUSR | S_IWUSR | S_IXUSR) as i32)); assert!(os::path_is_dir(&path)); @@ -101,13 +101,13 @@ fn recursive_mkdir_dot() { fn recursive_mkdir_rel_2() { let path = Path::new("./frob/baz"); let cwd = os::getcwd(); - debug2!("recursive_mkdir_rel_2: Making: {} in cwd {} [{:?}]", path.display(), + debug!("recursive_mkdir_rel_2: Making: {} in cwd {} [{:?}]", path.display(), cwd.display(), os::path_exists(&path)); assert!(os::mkdir_recursive(&path, (S_IRUSR | S_IWUSR | S_IXUSR) as i32)); assert!(os::path_is_dir(&path)); assert!(os::path_is_dir(&path.dir_path())); let path2 = Path::new("quux/blat"); - debug2!("recursive_mkdir_rel_2: Making: {} in cwd {}", path2.display(), + debug!("recursive_mkdir_rel_2: Making: {} in cwd {}", path2.display(), cwd.display()); assert!(os::mkdir_recursive(&path2, (S_IRUSR | S_IWUSR | S_IXUSR) as i32)); assert!(os::path_is_dir(&path2)); @@ -123,7 +123,7 @@ pub fn test_rmdir_recursive_ok() { let tmpdir = tmpdir.path(); let root = tmpdir.join("foo"); - debug2!("making {}", root.display()); + debug!("making {}", root.display()); assert!(os::make_dir(&root, rwx)); assert!(os::make_dir(&root.join("foo"), rwx)); assert!(os::make_dir(&root.join("foo").join("bar"), rwx)); diff --git a/src/test/run-pass/terminate-in-initializer.rs b/src/test/run-pass/terminate-in-initializer.rs index 37cbc2b40de1..c1b308c489e1 100644 --- a/src/test/run-pass/terminate-in-initializer.rs +++ b/src/test/run-pass/terminate-in-initializer.rs @@ -22,12 +22,12 @@ fn test_cont() { let mut i = 0; while i < 1 { i += 1; let _x: @int = continue; } fn test_ret() { let _x: @int = return; } fn test_fail() { - fn f() { let _x: @int = fail2!(); } + fn f() { let _x: @int = fail!(); } task::try(|| f() ); } fn test_fail_indirect() { - fn f() -> ! { fail2!(); } + fn f() -> ! { fail!(); } fn g() { let _x: @int = f(); } task::try(|| g() ); } diff --git a/src/test/run-pass/test-runner-hides-main.rs b/src/test/run-pass/test-runner-hides-main.rs index a399d22cdad0..3f1e9fe4c519 100644 --- a/src/test/run-pass/test-runner-hides-main.rs +++ b/src/test/run-pass/test-runner-hides-main.rs @@ -15,4 +15,4 @@ extern mod extra; // Building as a test runner means that a synthetic main will be run, // not ours -pub fn main() { fail2!(); } +pub fn main() { fail!(); } diff --git a/src/test/run-pass/threads.rs b/src/test/run-pass/threads.rs index 81fcfd7efa0e..d5f853fc2411 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; } - info2!("main thread exiting"); + info!("main thread exiting"); } -fn child(x: int) { info2!("{}", x); } +fn child(x: int) { info!("{}", x); } diff --git a/src/test/run-pass/trivial-message.rs b/src/test/run-pass/trivial-message.rs index 62b415422a3b..faea070c94de 100644 --- a/src/test/run-pass/trivial-message.rs +++ b/src/test/run-pass/trivial-message.rs @@ -19,5 +19,5 @@ pub fn main() { let (po, ch) = comm::stream(); ch.send(42); let r = po.recv(); - error2!("{:?}", r); + error!("{:?}", r); } diff --git a/src/test/run-pass/typeck-macro-interaction-issue-8852.rs b/src/test/run-pass/typeck-macro-interaction-issue-8852.rs index b4f28114f967..a4512e99ce0d 100644 --- a/src/test/run-pass/typeck-macro-interaction-issue-8852.rs +++ b/src/test/run-pass/typeck-macro-interaction-issue-8852.rs @@ -11,7 +11,7 @@ macro_rules! test( match (a, b) { (A(x), A(y)) => A($e), (B(x), B(y)) => B($e), - _ => fail2!() + _ => fail!() } } ) diff --git a/src/test/run-pass/typeclasses-eq-example-static.rs b/src/test/run-pass/typeclasses-eq-example-static.rs index 0d37c0f443d2..c14dd0471f91 100644 --- a/src/test/run-pass/typeclasses-eq-example-static.rs +++ b/src/test/run-pass/typeclasses-eq-example-static.rs @@ -61,5 +61,5 @@ pub fn main() { assert!(!Equal::isEq(branch(@leaf(magenta), @leaf(cyan)), branch(@leaf(magenta), @leaf(magenta)))); - error2!("Assertions all succeeded!"); + error!("Assertions all succeeded!"); } diff --git a/src/test/run-pass/typeclasses-eq-example.rs b/src/test/run-pass/typeclasses-eq-example.rs index 11973df2fec3..18a68bc1c34f 100644 --- a/src/test/run-pass/typeclasses-eq-example.rs +++ b/src/test/run-pass/typeclasses-eq-example.rs @@ -60,5 +60,5 @@ pub fn main() { assert!(!branch(@leaf(magenta), @leaf(cyan)) .isEq(branch(@leaf(magenta), @leaf(magenta)))); - error2!("Assertions all succeeded!"); + error!("Assertions all succeeded!"); } diff --git a/src/test/run-pass/unary-minus-suffix-inference.rs b/src/test/run-pass/unary-minus-suffix-inference.rs index e1ed28bc2ccd..4898ef1cd0ae 100644 --- a/src/test/run-pass/unary-minus-suffix-inference.rs +++ b/src/test/run-pass/unary-minus-suffix-inference.rs @@ -11,43 +11,43 @@ pub fn main() { let a = 1; let a_neg: i8 = -a; - error2!("{}", a_neg); + error!("{}", a_neg); let b = 1; let b_neg: i16 = -b; - error2!("{}", b_neg); + error!("{}", b_neg); let c = 1; let c_neg: i32 = -c; - error2!("{}", c_neg); + error!("{}", c_neg); let d = 1; let d_neg: i64 = -d; - error2!("{}", d_neg); + error!("{}", d_neg); let e = 1; let e_neg: int = -e; - error2!("{}", e_neg); + error!("{}", e_neg); // intentional overflows let f = 1; let f_neg: u8 = -f; - error2!("{}", f_neg); + error!("{}", f_neg); let g = 1; let g_neg: u16 = -g; - error2!("{}", g_neg); + error!("{}", g_neg); let h = 1; let h_neg: u32 = -h; - error2!("{}", h_neg); + error!("{}", h_neg); let i = 1; let i_neg: u64 = -i; - error2!("{}", i_neg); + error!("{}", i_neg); let j = 1; let j_neg: uint = -j; - error2!("{}", j_neg); + error!("{}", j_neg); } diff --git a/src/test/run-pass/unique-copy-box.rs b/src/test/run-pass/unique-copy-box.rs index 6f4c85960356..d84ebe0ba766 100644 --- a/src/test/run-pass/unique-copy-box.rs +++ b/src/test/run-pass/unique-copy-box.rs @@ -18,6 +18,6 @@ pub fn main() { let rc1 = managed::refcount(*i); let j = i.clone(); let rc2 = managed::refcount(*i); - error2!("rc1: {} rc2: {}", rc1, rc2); + error!("rc1: {} rc2: {}", rc1, rc2); assert_eq!(rc1 + 1u, rc2); } diff --git a/src/test/run-pass/unique-decl.rs b/src/test/run-pass/unique-decl.rs index 14a651943fde..74b73d773699 100644 --- a/src/test/run-pass/unique-decl.rs +++ b/src/test/run-pass/unique-decl.rs @@ -13,5 +13,5 @@ pub fn main() { } fn f(_i: ~int) -> ~int { - fail2!(); + fail!(); } diff --git a/src/test/run-pass/unique-in-tag.rs b/src/test/run-pass/unique-in-tag.rs index d0fa48a6c4d5..b1fc4e76ea08 100644 --- a/src/test/run-pass/unique-in-tag.rs +++ b/src/test/run-pass/unique-in-tag.rs @@ -14,7 +14,7 @@ fn test1() { let x = u(~10); assert!(match x { u(a) => { - error2!("{:?}", a); + error!("{:?}", a); *a } _ => { 66 } diff --git a/src/test/run-pass/unique-log.rs b/src/test/run-pass/unique-log.rs index 24342190e3fc..96d61b377af5 100644 --- a/src/test/run-pass/unique-log.rs +++ b/src/test/run-pass/unique-log.rs @@ -10,5 +10,5 @@ pub fn main() { let i = ~100; - error2!("{:?}", i); + error!("{:?}", i); } diff --git a/src/test/run-pass/unique-pat-3.rs b/src/test/run-pass/unique-pat-3.rs index 7a9790973d01..077bbdfb0baa 100644 --- a/src/test/run-pass/unique-pat-3.rs +++ b/src/test/run-pass/unique-pat-3.rs @@ -14,7 +14,7 @@ enum bar { u(~int), w(int), } pub fn main() { assert!(match u(~10) { u(a) => { - error2!("{:?}", a); + error!("{:?}", a); *a } _ => { 66 } diff --git a/src/test/run-pass/unique-pat.rs b/src/test/run-pass/unique-pat.rs index d33db85eb30e..0b9ad6ee194e 100644 --- a/src/test/run-pass/unique-pat.rs +++ b/src/test/run-pass/unique-pat.rs @@ -11,7 +11,7 @@ fn simple() { match ~true { ~true => { } - _ => { fail2!(); } + _ => { fail!(); } } } diff --git a/src/test/run-pass/unit-like-struct-drop-run.rs b/src/test/run-pass/unit-like-struct-drop-run.rs index 2d7234cbe314..7b450168cc4a 100644 --- a/src/test/run-pass/unit-like-struct-drop-run.rs +++ b/src/test/run-pass/unit-like-struct-drop-run.rs @@ -16,7 +16,7 @@ struct Foo; impl Drop for Foo { fn drop(&mut self) { - fail2!("This failure should happen."); + fail!("This failure should happen."); } } diff --git a/src/test/run-pass/unreachable-code-1.rs b/src/test/run-pass/unreachable-code-1.rs index e094f874c3fd..d1896a258c63 100644 --- a/src/test/run-pass/unreachable-code-1.rs +++ b/src/test/run-pass/unreachable-code-1.rs @@ -14,7 +14,7 @@ fn id(x: bool) -> bool { x } fn call_id() { - let c = fail2!(); + let c = fail!(); id(c); //~ WARNING unreachable statement } diff --git a/src/test/run-pass/unreachable-code.rs b/src/test/run-pass/unreachable-code.rs index 55a359efeed4..2c65e2283e8e 100644 --- a/src/test/run-pass/unreachable-code.rs +++ b/src/test/run-pass/unreachable-code.rs @@ -15,7 +15,7 @@ fn id(x: bool) -> bool { x } fn call_id() { - let c = fail2!(); + let c = fail!(); id(c); } diff --git a/src/test/run-pass/unwind-box.rs b/src/test/run-pass/unwind-box.rs index de65d9bbaba2..24e898a90bb7 100644 --- a/src/test/run-pass/unwind-box.rs +++ b/src/test/run-pass/unwind-box.rs @@ -14,7 +14,7 @@ use std::task; fn f() { let _a = @0; - fail2!(); + fail!(); } pub fn main() { diff --git a/src/test/run-pass/unwind-resource.rs b/src/test/run-pass/unwind-resource.rs index 6ab40c10aa45..c5276b727a95 100644 --- a/src/test/run-pass/unwind-resource.rs +++ b/src/test/run-pass/unwind-resource.rs @@ -21,14 +21,14 @@ struct complainer { impl Drop for complainer { fn drop(&mut self) { - error2!("About to send!"); + error!("About to send!"); self.c.send(true); - error2!("Sent!"); + error!("Sent!"); } } fn complainer(c: SharedChan) -> complainer { - error2!("Hello!"); + error!("Hello!"); complainer { c: c } @@ -36,13 +36,13 @@ fn complainer(c: SharedChan) -> complainer { fn f(c: SharedChan) { let _c = complainer(c); - fail2!(); + fail!(); } pub fn main() { let (p, c) = stream(); let c = SharedChan::new(c); task::spawn_unlinked(|| f(c.clone()) ); - error2!("hiiiiiiiii"); + error!("hiiiiiiiii"); assert!(p.recv()); } diff --git a/src/test/run-pass/unwind-resource2.rs b/src/test/run-pass/unwind-resource2.rs index 751b9430e3b5..5b0cd17eea05 100644 --- a/src/test/run-pass/unwind-resource2.rs +++ b/src/test/run-pass/unwind-resource2.rs @@ -29,7 +29,7 @@ fn complainer(c: @int) -> complainer { fn f() { let _c = complainer(@0); - fail2!(); + fail!(); } pub fn main() { diff --git a/src/test/run-pass/unwind-unique.rs b/src/test/run-pass/unwind-unique.rs index 07610fe7115c..0038392115b1 100644 --- a/src/test/run-pass/unwind-unique.rs +++ b/src/test/run-pass/unwind-unique.rs @@ -14,7 +14,7 @@ use std::task; fn f() { let _a = ~0; - fail2!(); + fail!(); } pub fn main() { diff --git a/src/test/run-pass/use-uninit-match.rs b/src/test/run-pass/use-uninit-match.rs index 18698a48613b..69e28e30d092 100644 --- a/src/test/run-pass/use-uninit-match.rs +++ b/src/test/run-pass/use-uninit-match.rs @@ -21,4 +21,4 @@ fn foo(o: myoption) -> int { enum myoption { none, some(T), } -pub fn main() { info2!("{}", 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 844b0521f3a3..a85861d2aa5d 100644 --- a/src/test/run-pass/use-uninit-match2.rs +++ b/src/test/run-pass/use-uninit-match2.rs @@ -13,7 +13,7 @@ fn foo(o: myoption) -> int { let mut x: int; match o { - none:: => { fail2!(); } + none:: => { fail!(); } some::(_t) => { x = 5; } } return x; @@ -21,4 +21,4 @@ fn foo(o: myoption) -> int { enum myoption { none, some(T), } -pub fn main() { info2!("{}", 5); } +pub fn main() { info!("{}", 5); } diff --git a/src/test/run-pass/utf8.rs b/src/test/run-pass/utf8.rs index 5222b0eb984a..984b4938faa3 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 ab in a.byte_iter() { - info2!("{}", i); - info2!("{}", ab); + info!("{}", i); + info!("{}", ab); let bb: u8 = b[i]; - info2!("{}", 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 0a8a9b1bab79..3a4a424c3b83 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; - info2!("{}", 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 e11bd257d42f..7ffbade05c1c 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]; } - info2!("{}", later[0]); + info!("{}", later[0]); } diff --git a/src/test/run-pass/vec-matching-autoslice.rs b/src/test/run-pass/vec-matching-autoslice.rs index 8965ee688425..2ad21aba6cdd 100644 --- a/src/test/run-pass/vec-matching-autoslice.rs +++ b/src/test/run-pass/vec-matching-autoslice.rs @@ -1,22 +1,22 @@ pub fn main() { let x = @[1, 2, 3]; match x { - [2, .._] => fail2!(), + [2, .._] => fail!(), [1, ..tail] => { assert_eq!(tail, [2, 3]); } - [_] => fail2!(), - [] => fail2!() + [_] => fail!(), + [] => fail!() } let y = (~[(1, true), (2, false)], 0.5); match y { - ([_, _, _], 0.5) => fail2!(), + ([_, _, _], 0.5) => fail!(), ([(1, a), (b, false), ..tail], _) => { assert_eq!(a, true); assert_eq!(b, 2); assert!(tail.is_empty()); } - ([.._tail], _) => fail2!() + ([.._tail], _) => fail!() } } diff --git a/src/test/run-pass/vec-matching.rs b/src/test/run-pass/vec-matching.rs index dec29c8da533..c09fb8d6bc7e 100644 --- a/src/test/run-pass/vec-matching.rs +++ b/src/test/run-pass/vec-matching.rs @@ -1,14 +1,14 @@ fn a() { let x = ~[1]; match x { - [_, _, _, _, _, .._] => fail2!(), - [.._, _, _, _, _] => fail2!(), - [_, .._, _, _] => fail2!(), - [_, _] => fail2!(), + [_, _, _, _, _, .._] => fail!(), + [.._, _, _, _, _] => fail!(), + [_, .._, _, _] => fail!(), + [_, _] => fail!(), [a] => { assert_eq!(a, 1); } - [] => fail2!() + [] => fail!() } } @@ -20,7 +20,7 @@ fn b() { assert_eq!(b, 2); assert_eq!(c, &[3]); } - _ => fail2!() + _ => fail!() } match x { [..a, b, c] => { @@ -28,7 +28,7 @@ fn b() { assert_eq!(b, 2); assert_eq!(c, 3); } - _ => fail2!() + _ => fail!() } match x { [a, ..b, c] => { @@ -36,7 +36,7 @@ fn b() { assert_eq!(b, &[2]); assert_eq!(c, 3); } - _ => fail2!() + _ => fail!() } match x { [a, b, c] => { @@ -44,14 +44,14 @@ fn b() { assert_eq!(b, 2); assert_eq!(c, 3); } - _ => fail2!() + _ => fail!() } } fn c() { let x = [1]; match x { - [2, .. _] => fail2!(), + [2, .. _] => fail!(), [.. _] => () } } diff --git a/src/test/run-pass/vec-self-append.rs b/src/test/run-pass/vec-self-append.rs index 4d5286502b7d..ce70643cfc68 100644 --- a/src/test/run-pass/vec-self-append.rs +++ b/src/test/run-pass/vec-self-append.rs @@ -47,7 +47,7 @@ fn test_loop() { let mut i = 20; let mut expected_len = 1u; while i > 0 { - error2!("{}", a.len()); + error!("{}", a.len()); assert_eq!(a.len(), expected_len); a = a + a; // FIXME(#3387)---can't write a += a i -= 1; diff --git a/src/test/run-pass/weird-exprs.rs b/src/test/run-pass/weird-exprs.rs index 9de4e2952946..0e24ba326b7a 100644 --- a/src/test/run-pass/weird-exprs.rs +++ b/src/test/run-pass/weird-exprs.rs @@ -61,17 +61,17 @@ fn canttouchthis() -> uint { fn p() -> bool { true } let _a = (assert!((true)) == (assert!(p()))); let _c = (assert!((p())) == ()); - let _b: bool = (info2!("{}", 0) == (return 0u)); + let _b: bool = (info!("{}", 0) == (return 0u)); } fn angrydome() { loop { if break { } } let mut i = 0; - loop { i += 1; if i == 1 { match (continue) { 1 => { }, _ => fail2!("wat") } } + loop { i += 1; if i == 1 { match (continue) { 1 => { }, _ => fail!("wat") } } break; } } -fn evil_lincoln() { let _evil = info2!("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 44c3225bb159..ed7ba12ea0f2 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)); - info2!("{}", i); + info!("{}", i); i -= 1; continue; } diff --git a/src/test/run-pass/while-loop-constraints-2.rs b/src/test/run-pass/while-loop-constraints-2.rs index a07d122c8e2c..a21aa4a9a624 100644 --- a/src/test/run-pass/while-loop-constraints-2.rs +++ b/src/test/run-pass/while-loop-constraints-2.rs @@ -18,7 +18,7 @@ pub fn main() { while z < 50 { z += 1; while false { x = y; y = z; } - info2!("{}", 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 05eea29b31da..82fb39a7c626 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 { - info2!("{}", 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 - info2!("breaking"); + info!("breaking"); break; } } diff --git a/src/test/run-pass/while.rs b/src/test/run-pass/while.rs index 4295c89865f1..fe2506ad686a 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 { info2!("{}", y); info2!("hello"); y = y + 1; } + while y < x { info!("{}", y); info!("hello"); y = y + 1; } while x > 0 { - info2!("goodbye"); + info!("goodbye"); x = x - 1; - info2!("{}", x); + info!("{}", x); } } diff --git a/src/test/run-pass/writealias.rs b/src/test/run-pass/writealias.rs index 06c2ca7be0bc..2db954d27c10 100644 --- a/src/test/run-pass/writealias.rs +++ b/src/test/run-pass/writealias.rs @@ -22,7 +22,7 @@ pub fn main() { Some(ref z) if z.with(|b| *b) => { do z.with |b| { assert!(*b); } }, - _ => fail2!() + _ => fail!() } } } diff --git a/src/test/run-pass/yield.rs b/src/test/run-pass/yield.rs index 6f6f59d80a5d..2c331f29223d 100644 --- a/src/test/run-pass/yield.rs +++ b/src/test/run-pass/yield.rs @@ -15,14 +15,14 @@ pub fn main() { let mut builder = task::task(); let result = builder.future_result(); builder.spawn(child); - error2!("1"); + error!("1"); task::deschedule(); - error2!("2"); + error!("2"); task::deschedule(); - error2!("3"); + error!("3"); result.recv(); } fn child() { - error2!("4"); task::deschedule(); error2!("5"); task::deschedule(); error2!("6"); + error!("4"); task::deschedule(); error!("5"); task::deschedule(); error!("6"); } diff --git a/src/test/run-pass/yield1.rs b/src/test/run-pass/yield1.rs index 6b189e515ff6..21088c9dacc9 100644 --- a/src/test/run-pass/yield1.rs +++ b/src/test/run-pass/yield1.rs @@ -15,9 +15,9 @@ pub fn main() { let mut builder = task::task(); let result = builder.future_result(); builder.spawn(child); - error2!("1"); + error!("1"); task::deschedule(); result.recv(); } -fn child() { error2!("2"); } +fn child() { error!("2"); } diff --git a/src/test/run-pass/yield2.rs b/src/test/run-pass/yield2.rs index 6dc96536540d..aaf4b257f7af 100644 --- a/src/test/run-pass/yield2.rs +++ b/src/test/run-pass/yield2.rs @@ -13,5 +13,5 @@ use std::task; pub fn main() { let mut i: int = 0; - while i < 100 { i = i + 1; error2!("{}", i); task::deschedule(); } + while i < 100 { i = i + 1; error!("{}", i); task::deschedule(); } }