Skip to content

Commit be529e9

Browse files
committed
Disable very verbose debug code
1 parent bfa6e72 commit be529e9

File tree

5 files changed

+5
-32
lines changed

5 files changed

+5
-32
lines changed

src/librustc/ty/instance.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// except according to those terms.
1010

1111
use hir::def_id::DefId;
12-
use ty::{self, TyCtxt, Ty, TypeFoldable, Substs};
12+
use ty::{self, Ty, TypeFoldable, Substs, TyCtxt};
1313
use ty::subst::Kind;
1414
use traits;
1515
use syntax::abi::Abi;

src/librustc_mir/monomorphize/deduplicate_instances.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ pub(crate) fn collapse_interchangable_instances<'a, 'tcx>(
5858
if false /*param.name.as_str().starts_with("<")*/ {
5959
ty.into()
6060
} else {
61-
#[allow(unused_mut)]
61+
/*#[allow(unused_mut)]
6262
let mut mir = Vec::new();
6363
::util::write_mir_pretty(tcx, Some(instance.def_id()), &mut mir).unwrap();
6464
let mut generics = Some(tcx.generics_of(instance.def_id()));
@@ -85,7 +85,7 @@ pub(crate) fn collapse_interchangable_instances<'a, 'tcx>(
8585
instance,
8686
pretty_generics,
8787
String::from_utf8_lossy(&mir)
88-
));
88+
));*/
8989
tcx.mk_ty(ty::TyNever)
9090
}
9191
}

src/librustc_trans/callee.rs

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -47,33 +47,6 @@ pub fn get_fn<'a, 'tcx>(cx: &CodegenCx<'a, 'tcx>,
4747

4848
info!("get_fn(collapsed_instance={:?})", instance);
4949

50-
struct ShowOnPanic(String);
51-
impl Drop for ShowOnPanic {
52-
fn drop(&mut self) {
53-
if ::std::thread::panicking() {
54-
info!("{}", self.0);
55-
}
56-
}
57-
}
58-
let mut mir = Vec::new();
59-
if !instance.substs.is_noop() {
60-
//::rustc_mir::util::write_mir_pretty(tcx, Some(instance.def_id()), &mut mir).unwrap();
61-
} else {
62-
use std::io::Write;
63-
write!(mir, "no substs for instance").unwrap();
64-
}
65-
let generics = tcx.generics_of(instance.def_id());
66-
67-
let _d = ShowOnPanic("mir: ".to_string() + &String::from_utf8(mir).unwrap());
68-
let _c = if let Some(parent) = generics.parent {
69-
let parent_generics = tcx.generics_of(parent);
70-
ShowOnPanic(format!("parent generics: {:#?}", parent_generics))
71-
} else {
72-
ShowOnPanic("no parent generics".to_string())
73-
};
74-
let _b = ShowOnPanic(format!("generics: {:#?}", generics));
75-
let _a = ShowOnPanic(format!("instance: {:#?}", instance));
76-
7750
assert!(!instance.substs.needs_infer());
7851
assert!(!instance.substs.has_escaping_regions());
7952
assert!(!instance.substs.has_param_types());

src/librustc_trans/debuginfo/metadata.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1568,7 +1568,7 @@ fn create_struct_stub<'a, 'tcx>(cx: &CodegenCx<'a, 'tcx>,
15681568
containing_scope: DIScope)
15691569
-> DICompositeType {
15701570
// FIXME: ignore unused generic subsitutions
1571-
cx.tcx.sess.warn(&format!("create_struct_stub({:?})", struct_type));
1571+
//cx.tcx.sess.warn(&format!("create_struct_stub({:?})", struct_type));
15721572
let (struct_size, struct_align) = cx.size_and_align_of(struct_type);
15731573

15741574
let name = CString::new(struct_type_name).unwrap();

src/librustc_trans/trans_item.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ pub trait MonoItemExt<'a, 'tcx>: fmt::Debug + BaseMonoItemExt<'a, 'tcx> {
6969
}
7070
}
7171
MonoItem::Fn(instance) => {
72-
cx.tcx.sess.warn(&format!("trans_instance({:?})", instance));
72+
//cx.tcx.sess.warn(&format!("trans_instance({:?})", instance));
7373
base::trans_instance(&cx, instance);
7474
}
7575
}

0 commit comments

Comments
 (0)