zed-industries/zed · error

in_place_temp_path requires output

Error message

in_place_temp_path requires output

What it means

Invariant guard at the end of an in-place CLI run: the temp output path only exists when an output path was also given, so renaming the temp file over the final output expects `output` to be Some. Firing indicates the in-place flag and output option got out of sync during the run.

Source

Thrown at crates/edit_prediction_cli/src/main.rs:1573

                        if let Some(summary_path) = &args.summary_json {
                            score::write_summary_json(
                                &examples,
                                summary_path,
                                Some(args.related_context_limit * 3),
                                context_source_filter.as_deref(),
                            )?;
                        }
                    }
                    Command::Repair(args) => {
                        let examples = finished_examples.lock().unwrap();
                        repair::print_report(&examples, args.confidence_threshold);
                    }
                    _ => (),
                };

                // For --in-place, atomically rename temp file to original
                if let Some(temp_path) = &in_place_temp_path {
                    let final_path = output.as_ref().expect("in_place_temp_path requires output");
                    std::fs::rename(temp_path, final_path)
                        .expect("Failed to rename temp file to final output");
                }

                anyhow::Ok(())
            }
            .await;

            if let Err(e) = result {
                panic!("Fatal error: {:?}", e);
            }

            let _ = cx.update(|cx| cx.quit());
        })
        .detach();
    });
}

View on GitHub (pinned to f4178619ac)

Solutions

  1. Always pass `-o` when using `--in-place`
  2. Check the run's argument handling for dropped output configuration
Defensive patterns

Strategy: type-guard

When it happens

Trigger: Thrown at crates/edit_prediction_cli/src/main.rs:1573 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of zed-industries/zed@f4178619ac (2026-08-20). Data as JSON: /api/errors/a3254d8c3fd13020. Report an issue: GitHub.