diff --git a/core/dr-catalog/src/runner.rs b/core/dr-catalog/src/runner.rs index b47f850..d0d171f 100644 --- a/core/dr-catalog/src/runner.rs +++ b/core/dr-catalog/src/runner.rs @@ -853,11 +853,16 @@ mod tests { let seen = seen.clone(); threads.push(std::thread::spawn(move || { let conn = open(&path); - Runner::new(&conn) + // Bound to a local rather than left as the block's tail: the + // `Runner` borrows `conn`, and a tail expression's temporaries + // are dropped *after* the block's locals, so the borrow would + // outlive what it borrows. + let completed = Runner::new(&conn) .with(recording(vec![JobKind::Thumbnail], seen)) .drain_all(0) .unwrap() - .completed + .completed; + completed })); }