From cd6df6935f6c5432a9c46c702563939be8880f2c Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 13 Jul 2021 15:02:29 +0300 Subject: [PATCH] minor: make sure that project_root works correctly --- crates/sourcegen/src/lib.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/sourcegen/src/lib.rs b/crates/sourcegen/src/lib.rs index 9197dbed8f6..2d280663426 100644 --- a/crates/sourcegen/src/lib.rs +++ b/crates/sourcegen/src/lib.rs @@ -191,5 +191,7 @@ fn normalize_newlines(s: &str) -> String { pub fn project_root() -> PathBuf { let dir = env!("CARGO_MANIFEST_DIR"); - PathBuf::from(dir).parent().unwrap().parent().unwrap().to_owned() + let res = PathBuf::from(dir).parent().unwrap().parent().unwrap().to_owned(); + assert!(res.join("bors.toml").exists()); + res }