GitoxideLabs/gitoxide · error

assignment present

Error message

assignment present

What it means

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.

Solutions

  1. Use matches within the lifetime/scope of their Outcome
  2. Re-run the search instead of caching matches across searches
  3. Update gix-attributes and dependents to matching versions
  4. File an upstream issue with a safe-API repro if it occurs without unsafe code
Defensive patterns

Strategy: type-guard

Try / catch

std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| match.to_outer(&outcome)));

Prevention

When it happens

Trigger: 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.

Common situations: Custom integrations that keep matches alive past their Outcome, or mismatched gix crate versions.

Understand the failure class

Background: "This is a bug, please report it": internal invariant violations, unreachable panics, and SNH errors explained — this error's family across 47 libraries.

Related errors


AI-assisted analysis of GitoxideLabs/gitoxide@e73179060b (2026-09-08). Data as JSON: /api/errors/5e459e803378b714. Report an issue: GitHub.

Appendix: source

Thrown at gix-attributes/src/search/outcome.rs:381

pub struct Match {
    /// The glob pattern itself, like `/target/*`.
    pub pattern: RefMapKey,
    /// The key=value pair of the attribute that matched at the pattern. There can be multiple matches per pattern.
    pub assignment: RefMapKey,
    /// Additional information about the kind of match.
    pub kind: MatchKind,
    /// Information about the location of the match.
    pub location: MatchLocation,
}

impl Match {
    fn to_outer<'a>(&self, out: &'a Outcome) -> crate::search::Match<'a> {
        crate::search::Match {
            pattern: out.patterns.resolve(self.pattern).expect("pattern still present"),
            assignment: out
                .assignments
                .resolve(self.assignment)
                .expect("assignment present")
                .as_ref(),
            kind: self.kind,
            location: self.location.to_outer(out),
        }
    }
}

/// A version of `MatchLocation` without references.
#[derive(Clone, PartialEq, Eq, Debug, Hash, Ord, PartialOrd)]
pub struct MatchLocation {
    /// The path to the source from which the pattern was loaded, or `None` if it was specified by other means.
    pub source: Option<RefMapKey>,
    /// The line at which the pattern was found in its `source` file, or the occurrence in which it was provided.
    pub sequence_number: usize,
}

impl MatchLocation {
    fn to_outer<'a>(&self, out: &'a Outcome) -> crate::search::MatchLocation<'a> {

View on GitHub (pinned to e73179060b)