{"record":{"id":"33189ede541cd381","repo":"SeaQL/sea-orm","slug":"pushed-above","errorCode":null,"errorMessage":"Pushed above","messagePattern":"Pushed above","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"info","filePath":"src/query/loader.rs","lineNumber":1157,"sourceCode":"        } else {\n            output.push(T::default());\n        }\n    }\n    output\n}\n\nfn assemble_vectors<I, T: Default>(input: &[Vec<I>], items: Vec<T>) -> Vec<Vec<T>> {\n    let mut items = items.into_iter();\n\n    let mut output = Vec::new();\n\n    for input in input.iter() {\n        output.push(Vec::new());\n\n        for _inner in input.iter() {\n            output\n                .last_mut()\n                .expect(\"Pushed above\")\n                .push(items.next().unwrap_or_default());\n        }\n    }\n\n    output\n}\n\ntrait Container: Default + Clone {\n    type Item;\n    fn add(&mut self, item: Self::Item);\n}\n\nimpl<T: Clone> Container for Vec<T> {\n    type Item = T;\n    fn add(&mut self, item: Self::Item) {\n        self.push(item);\n    }\n}","sourceCodeStart":1139,"sourceCodeEnd":1175,"githubUrl":"https://github.com/SeaQL/sea-orm/blob/e29bcd1b417c41a553b386fe94511d7c64a1c8ec/src/query/loader.rs#L1139-L1175","documentation":"In `src/query/loader.rs:1157` (the shared `loader_impl_impl` used by `load_self`, `load_self_many`, `load_self_via`, etc.), the code pushes one `Vec` per input group and then immediately reads `.last_mut().expect(\"Pushed above\")`. The expect documents that a group was just pushed, so `last_mut()` must be `Some`. This is a purely internal invariant; it cannot fire from user input under the current implementation.","triggerScenarios":"Not reachable through public API — it would require the surrounding grouping loop to be modified so `output` is empty when entries are appended.","commonSituations":"Only seen when hacking on SeaORM internals or patching the loader implementation itself.","solutions":["No action needed for library users — unreachable in released code.","If hacking on the loader, keep the `output.push(Vec::new())` loop preceding the inner `last_mut()` access intact.","If it fires in a fork, audit any modified grouping/partition logic in `loader_impl_impl`."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"// Unreachable; only relevant when patching the loader\nif let Some(slot) = output.last_mut() {\n    slot.push(items.next().unwrap_or_default());\n} else {\n    unreachable!(\"group pushed above\");\n}","preventionTips":["Do not modify the push/last_mut pairing in loader_impl_impl when forking.","Keep loader grouping tests covering empty and multi-group inputs.","Prefer upstream loader APIs (load_self, load_self_many) over reimplementing grouping."],"tags":["internal-invariant","unreachable","loader"],"backgroundTag":"internal-invariant-violation","analyzedSha":"e29bcd1b417c41a553b386fe94511d7c64a1c8ec","analyzedAt":"2026-09-10T11:31:52.468Z","contentChangedAt":"2026-09-10T11:31:52.468Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}