{"record":{"id":"a3254d8c3fd13020","repo":"zed-industries/zed","slug":"in-place-temp-path-requires-output","errorCode":null,"errorMessage":"in_place_temp_path requires output","messagePattern":"in_place_temp_path requires output","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/edit_prediction_cli/src/main.rs","lineNumber":1573,"sourceCode":"                        if let Some(summary_path) = &args.summary_json {\n                            score::write_summary_json(\n                                &examples,\n                                summary_path,\n                                Some(args.related_context_limit * 3),\n                                context_source_filter.as_deref(),\n                            )?;\n                        }\n                    }\n                    Command::Repair(args) => {\n                        let examples = finished_examples.lock().unwrap();\n                        repair::print_report(&examples, args.confidence_threshold);\n                    }\n                    _ => (),\n                };\n\n                // For --in-place, atomically rename temp file to original\n                if let Some(temp_path) = &in_place_temp_path {\n                    let final_path = output.as_ref().expect(\"in_place_temp_path requires output\");\n                    std::fs::rename(temp_path, final_path)\n                        .expect(\"Failed to rename temp file to final output\");\n                }\n\n                anyhow::Ok(())\n            }\n            .await;\n\n            if let Err(e) = result {\n                panic!(\"Fatal error: {:?}\", e);\n            }\n\n            let _ = cx.update(|cx| cx.quit());\n        })\n        .detach();\n    });\n}\n","sourceCodeStart":1555,"sourceCodeEnd":1591,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/edit_prediction_cli/src/main.rs#L1555-L1591","documentation":"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.","triggerScenarios":"Thrown at crates/edit_prediction_cli/src/main.rs:1573 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Always pass `-o` when using `--in-place`","Check the run's argument handling for dropped output configuration"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}