From 6b790b83ec01c97411ac0c6cbcffa73b4178dd0f Mon Sep 17 00:00:00 2001 From: ISSOtm Date: Tue, 28 Sep 2021 09:25:17 +0200 Subject: [PATCH] Warn when preproc order references unknown preprocs --- src/book/mod.rs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/book/mod.rs b/src/book/mod.rs index 73ced4d5..df140797 100644 --- a/src/book/mod.rs +++ b/src/book/mod.rs @@ -416,7 +416,14 @@ fn determine_preprocessors(config: &Config) -> Result> )) })?; - if exists(after) { + if !exists(after) { + // Only warn so that preprocessors can be toggled on and off (e.g. for + // troubleshooting) without having to worry about order too much. + warn!( + "preprocessor.{}.after contains \"{}\", which was not found", + name, after + ); + } else { preprocessor_names.add_dependency(name, after); } } @@ -437,7 +444,13 @@ fn determine_preprocessors(config: &Config) -> Result> )) })?; - if exists(before) { + if !exists(before) { + // See equivalent warning above for rationale + warn!( + "preprocessor.{}.before contains \"{}\", which was not found", + name, before + ); + } else { preprocessor_names.add_dependency(before, name); } }