return
}
- let metadata = t!(fs::metadata(&file));
+ let metadata = t!(fs::metadata(&file), &file);
if metadata.mode() & 0o111 != 0 {
println!("binary checked into source: {}", file.display());
*bad = true;
use std::path::Path;
pub fn check(path: &Path, bad: &mut bool) {
- for entry in t!(path.read_dir()).map(|e| t!(e)) {
+ for entry in t!(path.read_dir(), path).map(|e| t!(e)) {
// Look for `Cargo.toml` with a sibling `src/lib.rs` or `lib.rs`
if entry.file_name().to_str() == Some("Cargo.toml") {
if path.join("src/lib.rs").is_file() {
use std::env;
macro_rules! t {
+ ($e:expr, $p:expr) => (match $e {
+ Ok(e) => e,
+ Err(e) => panic!("{} failed on {} with {}", stringify!($e), ($p).display(), e),
+ });
+
($e:expr) => (match $e {
Ok(e) => e,
Err(e) => panic!("{} failed with {}", stringify!($e), e),
fn walk(path: &Path, skip: &mut FnMut(&Path) -> bool, f: &mut FnMut(&Path)) {
- for entry in t!(fs::read_dir(path)) {
+ for entry in t!(fs::read_dir(path), path) {
let entry = t!(entry);
let kind = t!(entry.file_type());
let path = entry.path();
}
contents.truncate(0);
- t!(t!(File::open(file)).read_to_string(&mut contents));
+ t!(t!(File::open(file), file).read_to_string(&mut contents));
let skip_cr = contents.contains("ignore-tidy-cr");
let skip_tab = contents.contains("ignore-tidy-tab");
let skip_length = contents.contains("ignore-tidy-linelength");