{"record":{"id":"a67b61a56cddc924","repo":"sharkdp/bat","slug":"a-builtin-fixed-glob-matcher-failed-to-compile","errorCode":null,"errorMessage":"A builtin fixed glob matcher failed to compile","messagePattern":"A builtin fixed glob matcher failed to compile","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/syntax_mapping/builtin.rs","lineNumber":57,"sourceCode":"// The benefit for this is that operations like listing all builtin mappings\n// would be effectively memoised. The caller would not have to compile another\n// `GlobMatcher` for rules that they have previously visited.\n//\n// Unfortunately, this means we are going to have to store a distinct closure\n// for each rule anyway, which makes a `BuiltinMatcher` enum a pointless layer\n// of indirection.\n//\n// In the current implementation, the closure within each generated rule simply\n// calls either `build_matcher_fixed` or `build_matcher_dynamic`, depending on\n// whether the defined matcher contains dynamic segments or not.\n\n/// Compile a fixed glob string into a glob matcher.\n///\n/// A failure to compile is a fatal error.\n///\n/// Used internally by `Lazy<Option<GlobMatcher>>`'s lazy evaluation closure.\nfn build_matcher_fixed(from: &str, case: Case) -> GlobMatcher {\n    make_glob_matcher(from, case).expect(\"A builtin fixed glob matcher failed to compile\")\n}\n\n/// Join a list of matcher segments to create a glob string, replacing all\n/// environment variables, then compile to a glob matcher.\n///\n/// Returns `None` if any replacement fails, or if the joined glob string fails\n/// to compile.\n///\n/// Used internally by `Lazy<Option<GlobMatcher>>`'s lazy evaluation closure.\nfn build_matcher_dynamic(segs: &[MatcherSegment], case: Case) -> Option<GlobMatcher> {\n    // join segments\n    let mut buf = String::new();\n    for seg in segs {\n        match seg {\n            MatcherSegment::Text(s) => buf.push_str(s),\n            MatcherSegment::Env(var) => {\n                let replaced = env::var(var).ok()?;\n                buf.push_str(&replaced);","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/sharkdp/bat/blob/b671e53c2cd0177beb357cf6cb997ee4215c7155/src/syntax_mapping/builtin.rs#L39-L75","documentation":"Error \"A builtin fixed glob matcher failed to compile\" thrown in sharkdp/bat.","triggerScenarios":"Thrown at src/syntax_mapping/builtin.rs:57 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b671e53c2cd0177beb357cf6cb997ee4215c7155","analyzedAt":"2026-08-16T08:15:54.742Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}