From 07b4b35c44d488fea2916e7d985f60f923ed0e4c Mon Sep 17 00:00:00 2001 From: Melody Horn Date: Sun, 10 Nov 2024 21:28:27 -0700 Subject: fix that with no default features --- src/makefile/input.rs | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'src/makefile/input.rs') diff --git a/src/makefile/input.rs b/src/makefile/input.rs index f1d4f70..fccea3b 100644 --- a/src/makefile/input.rs +++ b/src/makefile/input.rs @@ -16,6 +16,7 @@ use crate::args::Args; use super::command_line::CommandLine; #[cfg(feature = "full")] use super::conditional::{Line as ConditionalLine, State as ConditionalState}; +#[cfg(feature = "full")] use super::eval_context::DeferredEvalContext; use super::inference_rules::InferenceRule; #[cfg(feature = "full")] @@ -594,6 +595,7 @@ impl<'a, 'parent, R: BufRead> MakefileReader<'a, 'parent, R> { log::error!("rule-specific macros are not implemented yet"); return Ok(()); } + #[cfg(feature = "full")] let mut deferred_eval_context = DeferredEvalContext::new(self); let prerequisites = self .macros @@ -630,7 +632,12 @@ impl<'a, 'parent, R: BufRead> MakefileReader<'a, 'parent, R> { Ok(macro_pieces.join(" ")) }) - .expand(&prerequisites, Some(&mut deferred_eval_context))?; + .expand( + &prerequisites, + #[cfg(feature = "full")] + Some(&mut deferred_eval_context), + )?; + #[cfg(feature = "full")] for child in deferred_eval_context { self.extend(child); } @@ -903,8 +910,14 @@ impl<'a, 'parent, R: BufRead> MakefileReader<'a, 'parent, R> { } fn expand_macros(&mut self, text: &TokenString) -> Result { + #[cfg(feature = "full")] let mut deferred_eval_context = DeferredEvalContext::new(self); - let result = self.expand_macros_deferred_eval(text, &mut deferred_eval_context); + let result = self.expand_macros_deferred_eval( + text, + #[cfg(feature = "full")] + &mut deferred_eval_context, + ); + #[cfg(feature = "full")] for child in deferred_eval_context { self.extend(child); } @@ -914,10 +927,14 @@ impl<'a, 'parent, R: BufRead> MakefileReader<'a, 'parent, R> { fn expand_macros_deferred_eval( &self, text: &TokenString, - deferred_eval_context: &mut DeferredEvalContext, + #[cfg(feature = "full")] deferred_eval_context: &mut DeferredEvalContext, ) -> Result { self.macros - .expand(text, Some(deferred_eval_context)) + .expand( + text, + #[cfg(feature = "full")] + Some(deferred_eval_context), + ) .wrap_err_with(|| format!("while expanding \"{}\"", text)) } -- cgit v1.2.3