{"record":{"id":"5e459e803378b714","repo":"GitoxideLabs/gitoxide","slug":"assignment-present","errorCode":null,"errorMessage":"assignment present","messagePattern":"assignment present","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"gix-attributes/src/search/outcome.rs","lineNumber":381,"sourceCode":"pub struct Match {\n    /// The glob pattern itself, like `/target/*`.\n    pub pattern: RefMapKey,\n    /// The key=value pair of the attribute that matched at the pattern. There can be multiple matches per pattern.\n    pub assignment: RefMapKey,\n    /// Additional information about the kind of match.\n    pub kind: MatchKind,\n    /// Information about the location of the match.\n    pub location: MatchLocation,\n}\n\nimpl Match {\n    fn to_outer<'a>(&self, out: &'a Outcome) -> crate::search::Match<'a> {\n        crate::search::Match {\n            pattern: out.patterns.resolve(self.pattern).expect(\"pattern still present\"),\n            assignment: out\n                .assignments\n                .resolve(self.assignment)\n                .expect(\"assignment present\")\n                .as_ref(),\n            kind: self.kind,\n            location: self.location.to_outer(out),\n        }\n    }\n}\n\n/// A version of `MatchLocation` without references.\n#[derive(Clone, PartialEq, Eq, Debug, Hash, Ord, PartialOrd)]\npub struct MatchLocation {\n    /// The path to the source from which the pattern was loaded, or `None` if it was specified by other means.\n    pub source: Option<RefMapKey>,\n    /// The line at which the pattern was found in its `source` file, or the occurrence in which it was provided.\n    pub sequence_number: usize,\n}\n\nimpl MatchLocation {\n    fn to_outer<'a>(&self, out: &'a Outcome) -> crate::search::MatchLocation<'a> {","sourceCodeStart":363,"sourceCodeEnd":399,"githubUrl":"https://github.com/GitoxideLabs/gitoxide/blob/e73179060badf27222d790981fac3f84c1830a7e/gix-attributes/src/search/outcome.rs#L363-L399","documentation":"Same family as the previous: `Match::to_outer` resolves the assignment index via `out.assignments.resolve(self.assignment).expect(\"assignment present\")`. Assignment results are interned in the Outcome's assignment arena; failure means the arena no longer contains the referenced entry when the match is converted to the public type.","triggerScenarios":"Converting an internal Match to a public `crate::search::Match` while the owning Outcome's assignment storage is missing the entry — only via Outcome reuse across search sets, unsafe aliasing, or internal refactors breaking interning.","commonSituations":"Custom integrations that keep matches alive past their Outcome, or mismatched gix crate versions.","solutions":["Use matches within the lifetime/scope of their Outcome","Re-run the search instead of caching matches across searches","Update gix-attributes and dependents to matching versions","File an upstream issue with a safe-API repro if it occurs without unsafe code"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":"std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| match.to_outer(&outcome)));","preventionTips":["Keep matches and their Outcome together","Re-run searches instead of reusing stale results","Keep crate versions consistent"],"tags":["rust","panic","lifetime","internal-invariant"],"backgroundTag":"internal-invariant-violation","analyzedSha":"e73179060badf27222d790981fac3f84c1830a7e","analyzedAt":"2026-09-08T11:26:50.865Z","contentChangedAt":"2026-09-08T11:26:50.865Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}