git.delta.rocks / jrsonnet / refs/commits / ff546d6d7462

difftreelog

refactor do not use eager compspec for destructuring

suqoqynkYaroslav Bolyukin2026-05-05parent: #a102a18.patch.diff
in: master

1 file changed

modifiedcrates/jrsonnet-evaluator/src/evaluate/compspec.rsdiffbeforeafterboth
130 'eager: {130 'eager: {
131 let mut out = Vec::new();131 let mut out = Vec::new();
132132
133 if evaluate_compspecs_eager(133 if comp.compspecs.iter().all(|c| {
134 matches!(
135 c,
136 LCompSpec::If(_)
137 | LCompSpec::For {
138 destruct: LDestruct::Full(_),
139 ..
140 }
141 )
142 }) && evaluate_compspecs_eager(
134 ctx.clone(),143 ctx.clone(),
135 &comp.compspecs,144 &comp.compspecs,
136 &cached_overs,145 &cached_overs,
241 }250 }
242 // TODO: Should not be eager? CoW won't work here251 // TODO: Should not be eager? CoW won't work here
243 #[cfg(feature = "exp-destruct")]252 #[cfg(feature = "exp-destruct")]
244 _ => {253 _ => unreachable!("eager compspecs are not possible with non-full patterns"),
245 for (i, item) in arr.iter().enumerate() {
246 let item_val = item?;
247 let mut inner_builder = ContextBuilder::extend(ctx.clone(), 1);
248 let fctx = Pending::new();
249 destructure::destruct(
250 destruct,
251 Thunk::evaluated(item_val),
252 fctx.clone(),
253 &mut inner_builder,
254 );
255 let inner_ctx = inner_builder.build().into_future(fctx);
256 evaluate_compspecs_eager(
257 inner_ctx,
258 specs,
259 cached_overs,
260 idx + 1,
261 if i == 0 { inner_reserve } else { 0 },
262 collector,
263 )?;
264 }
265 }
266 }254 }
267 }255 }
268 }256 }