diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2013-10-21 13:08:31 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2013-10-22 08:09:56 -0700 |
| commit | daf5f5a4d10513ff42e79fa7ef8819b170f3a13d (patch) | |
| tree | 7a07a79c43e02debcc6bbb33d90a5e41b70119e6 /src/librustc | |
| parent | 15a6bdebab4e7b811b9a902e3f8ed225c59af06e (diff) | |
Drop the '2' suffix from logging macros
Who doesn't like a massive renaming?
Diffstat (limited to 'src/librustc')
89 files changed, 924 insertions, 924 deletions
diff --git a/src/librustc/back/link.rs b/src/librustc/back/link.rs index 7c2856b7577..8bf3d5008db 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 faf8dd25186..3d6a8350795 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 5ca81a91bfd..67a59f24e29 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 aad2228f66f..9541a03aff2 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 9700f68383a..f7b1955191a 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 6def597b89f..617051c217f 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 226c19a5d5e..3c79ea2fe5e 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 cf34d129fec..aa1c4c1eb7e 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<ebml::Doc> { 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 5434e7ab07b..9f40593a93a 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<i64>], 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<i64>]) { 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 8f426147078..4b679072bba 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 593a02c9508..e682ff299a9 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 d7a544320c2..62de991ce96 100644 --- a/src/librustc/metadata/tydecode.rs +++ b/src/librustc/metadata/tydecode.rs @@ -80,10 +80,10 @@ fn scan<R>(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<T>(st: &mut PState, f: &fn(&mut PState) -> T) -> Option<T> { 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 146e3cd9200..33be1be8955 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 b6a782c09b7..294bbcb46f7 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 47c29436856..b05bdaa2032 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 485004a642c..a0c6fdc3225 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<ast::NodeId>) { - 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 224c8bf6a6b..6c927794dc8 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 8464c19cb01..2722fff12a8 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 239254e82dd..e0314209967 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 9e92bd3829c..27fbecb5979 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 dd624a88283..d12808c3a4d 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 2d03b0c778d..de5e00d241e 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 b9355d32663..22fd1d393e9 100644 --- a/src/librustc/middle/dataflow.rs +++ b/src/librustc/middle/dataflow.rs @@ -131,7 +131,7 @@ impl<O:DataFlowOperator> DataFlowContext<O> { bits_per_id: uint) -> DataFlowContext<O> { 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<O:DataFlowOperator> DataFlowContext<O> { 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<O:DataFlowOperator> DataFlowContext<O> { 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<O:DataFlowOperator> DataFlowContext<O> { 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<O:DataFlowOperator> DataFlowContext<O> { 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<O:DataFlowOperator> DataFlowContext<O> { } 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<O:DataFlowOperator> DataFlowContext<O> { 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<O:DataFlowOperator> DataFlowContext<O> { 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<O:DataFlowOperator> DataFlowContext<O> { } 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<O:DataFlowOperator+Clone+'static> DataFlowContext<O> { } } - 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 8cc4c23bd1c..c0ac48bfee8 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 383c37952d7..9aaddab69a1 100644 --- a/src/librustc/middle/freevars.rs +++ b/src/librustc/middle/freevars.rs @@ -53,7 +53,7 @@ impl Visitor<int> 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 98912b57572..87dce84d23d 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 b20cb8ed809..5737039f83c 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 8b21ce32024..b0cdd53de92 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 824dbb5b561..6c53fc1602f 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 3b8ea2c33ec..37e89e58fa5 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 71d0621fc16..1ed517c9512 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 c502dac7db0..17aab598289 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 0ae8e01fe9d..29acfe14381 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 a6c22bd5742..b480aaac1ac 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 1c572b2cbad..fdb7f1508fb 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 89dfa64511f..6bb41929db1 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 ce789ee7ab6..5e64dc5c2e2 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 cfeefc8642c..7f809451b35 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 6cb63f9e1a1..df7b09f9db7 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<BasicBlockRef>) -> @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 1754741a1f4..2042c6ddad1 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 febe4de730d..27b1e6b39dc 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 5add2250038..736feeb0618 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 3f2d18ddbe2..e98618c4e01 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 b35ffe5c965..1e22c46dd5d 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 839313f7bbe..7a3a67b35ee 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 875be5d3af5..f036f922de9 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 6c665f6f6fe..bfea123939a 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<ast::NodeId>, 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<ast::NodeId>, 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<ast::NodeId>, 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 2b473d2b6e1..21930778656 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 105cb6e5606..ec00f144308 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 294f3379f84..d57c24e37d5 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<Datum>, @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 7ccca6df000..2138afd2e9b 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 48d3e3f7c58..238b15fe597 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 09dd2f21a3b..7f8f1daebc4 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 01470b13e3a..aaa187931c9 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 41a835fcab9..a5be9a3ca5e 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 6334677a406..e627f39f201 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<ast::NodeId>) { - 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 81466af6f74..a8c18c72167 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 79b3453037d..f625ce4b01c 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<ast::NodeId>) -> (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 1ab9e4581f2..54ecc15c44f 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 bde98eff41c..38c5e0b55f7 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 efb85bc8df2..de41548895d 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 8667d7224e7..2a8d16a2ceb 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 f6c1741a9bd..577e0a28105 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 20a9fb8f7a9..39aa6c5e396 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<V:Clone>( } 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 fdf0a094dc0..ccda6bbaf9d 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<AC:AstConv,RS:RegionScope + Clone + 'static>( opt_self_info: Option<&SelfInfo>, decl: &ast::fn_decl) -> (Option<Option<ty::t>>, 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<AC:AstConv,RS:RegionScope + Clone + 'static>( // 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 545a487ab44..25048d888fa 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 e0df9bf1cfc..f6efd3aa5ad 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<method_map_entry> { - 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 627216ea7b7..eddf8aa5185 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<ty::t>, 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<ast::TyParam>, 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 edc2947d890..06a13059462 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 b4ac7aaa6d2..9ba709f7651 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 46805af8938..3c4ff35b768 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<vtable_origin> { - 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<T>. 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 4f281ce5f45..46c7968a0a4 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 ae8081df7ba..795074fa619 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 238bcff6537..9c69e6fd85c 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 8d1eaf34256..e1f65f79e4f 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 3f6248eae12..2d810f1da74 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<ty::vstore> { - 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<ty::TraitStore> { - 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<C:Combine>(this: &C, a: ty::t, b: ty::t) -> ures { pub fn eq_regions<C:Combine>(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 5e9eb51cbb6..87c7373b005 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<ty::mt> { 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<ty::Region> { - 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 919ad68a818..8a32a305b3a 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<T>, b: &Bound<T>) -> 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<L:LatticeDir + TyLatticeDir + Combine>( this: &L, a: ty::t, b: ty::t) -> cres<ty::t> { - 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<L:LatticeDir + Combine, let a_bounds = &nde_a.possible_types; let b_bounds = &nde_b.possible_types; - debug2!("{}.lattice_vars({}={} <: {}={})", + debug!("{}.lattice_vars({}={} <: {}={})", this.tag(), a_vid.to_str(), a_bounds.inf_str(this.infcx()), b_vid.to_str(), b_bounds.inf_str(this.infcx())); @@ -494,7 +494,7 @@ pub fn lattice_var_and_t<L:LatticeDir + Combine, // The comments in this function are written for LUB, but they // apply equally well to GLB if you inverse upper/lower/sub/super/etc. - debug2!("{}.lattice_var_and_t({}={} <: {})", + debug!("{}.lattice_var_and_t({}={} <: {})", this.tag(), a_id.to_str(), a_bounds.inf_str(this.infcx()), @@ -503,13 +503,13 @@ pub fn lattice_var_and_t<L:LatticeDir + Combine, match this.bnd(a_bounds) { Some(ref a_bnd) => { // 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 c8974a722fd..42793d956df 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<ty::mt> { 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<ty::Region> { - 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 c93b50c76b0..487eb4c3289 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<T,E>(@mut self, f: &fn() -> Result<T,E>) -> Result<T,E> { 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<T,E>(@mut self, f: &fn() -> Result<T,E>) -> Result<T,E> { - 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<T,E>(@mut self, f: &fn() -> Result<T,E>) -> Result<T,E> { - debug2!("probe()"); + debug!("probe()"); do indent { let snapshot = self.start_snapshot(); let r = f(); @@ -725,7 +725,7 @@ impl InferCtxt { expected_ty: Option<ty::t>, 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 3ab7ced3941..68c5ec3b7d6 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<RegionResolutionError> { - 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<Region> { - 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<RegionResolutionError>) -> ~[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 dcb0e6fbd41..564fcb76dc7 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<ty::t> { 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 2a2d7fbcfc7..e5afefe0c71 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<ty::Region> { - 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<ty::mt> { - 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<ty::t> { - 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<ty::FnSig> { - 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 8792a068671..48660ab64e5 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 c05306a27be..b58a526b7ea 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 <http://en.wikipedia.org/wiki/Disjoint-set_data_structure> - 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 116d26967b2..10005bfb2cb 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 f6483a48ed0..1967122745d 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 712bf66bdaf..8bdb518b621 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 46c71ea12f5..ecc53ae5f80 100644 --- a/src/librustc/util/common.rs +++ b/src/librustc/util/common.rs @@ -29,9 +29,9 @@ pub fn time<T, U>(do_it: bool, what: &str, u: U, f: &fn(U) -> T) -> T { pub fn indent<R>(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(()) } |
