Add some writes to a log file for debugging

This commit is contained in:
Owen Sanchez 2017-02-04 17:42:35 -07:00
parent 37a0e52a1e
commit 7e4b633417
2 changed files with 9 additions and 0 deletions

View File

@ -67,7 +67,15 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for LargeEnumVariant {
}
})
.sum();
use std::io::Write;
let mut f = ::std::fs::File::create("log").unwrap();
writeln!(f, "size, max size: {}, {}", size, self.maximum_variant_size_allowed).unwrap();
if size > self.maximum_variant_size_allowed {
writeln!(f, "size > max").unwrap();
// panic!("foo");
span_lint_and_then(cx,
LARGE_ENUM_VARIANT,
def.variants[i].span,

1
log Normal file
View File

@ -0,0 +1 @@
size, max size: 0, 200