From: Owen Sanchez Date: Sun, 5 Feb 2017 00:42:35 +0000 (-0700) Subject: Add some writes to a log file for debugging X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=7e4b633417fe4886d35c11d38b28b3f98ff4e373;p=rust.git Add some writes to a log file for debugging --- diff --git a/clippy_lints/src/large_enum_variant.rs b/clippy_lints/src/large_enum_variant.rs index 36c5e7a288a..aa7db1f77e2 100644 --- a/clippy_lints/src/large_enum_variant.rs +++ b/clippy_lints/src/large_enum_variant.rs @@ -67,7 +67,15 @@ fn check_item(&mut self, cx: &LateContext, item: &Item) { } }) .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, diff --git a/log b/log new file mode 100644 index 00000000000..0cbafc97889 --- /dev/null +++ b/log @@ -0,0 +1 @@ +size, max size: 0, 200