{"record":{"id":"1a5e91cba9aa01d7","repo":"loco-rs/loco","slug":"rust-block-is-never-closed","errorCode":null,"errorMessage":"{}:{}: ```rust block is never closed","messagePattern":"(.+?):(.+?): ```rust block is never closed","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"xtask/src/docs_syntax.rs","lineNumber":206,"sourceCode":"                    let reason = reason_at(&lines[opened_at][at + SKIP_MARKER.len()..]);\n                    if reason.is_none() {\n                        bail!(\n                            \"{}:{}: `{SKIP_MARKER}` needs a reason — write it as \\\n                             ```rust {SKIP_MARKER}=\\\"why this is not Rust\\\"\",\n                            path.display(),\n                            opened_at + 1\n                        );\n                    }\n                    true\n                }\n            };\n            index += 1;\n            let start = index;\n            while index < lines.len() && !closing.is_match(lines[index]) {\n                index += 1;\n            }\n            if index >= lines.len() {\n                bail!(\n                    \"{}:{}: ```rust block is never closed\",\n                    path.display(),\n                    opened_at + 1\n                );\n            }\n            out.push(Block {\n                file: path.clone(),\n                line: opened_at + 1,\n                code: lines[start..index.min(lines.len())].join(\"\\n\"),\n                skipped,\n            });\n            index += 1;\n        }\n    }\n    Ok(())\n}\n","sourceCodeStart":188,"sourceCodeEnd":223,"githubUrl":"https://github.com/loco-rs/loco/blob/23639d1e360dbc618073642b507d6f8664adbaff/xtask/src/docs_syntax.rs#L188-L223","documentation":"The docs-syntax extractor scans for an opening ```rust fence and then a matching closing fence; this bail fires when the file ends without a closing fence. The unclosed block cannot be delimited, so the file's markdown is malformed and the tool aborts with the path and line of the opening fence.","triggerScenarios":"A markdown file under docs/ (or a scanned source dir) contains ```` ```rust ```` at a line with no subsequent ```` ``` ```` line before EOF; `collect` recurses into itself and hits this when processing such files.","commonSituations":"Manual doc edits that truncate a code block; copy/paste that drops the closing fence; merge conflicts partially resolving a fenced block; code-generation scripts that forget the closer.","solutions":["Open the file at the reported line and add the missing closing ``` fence","Run a markdown linter (e.g. markdownlint MD040/unclosed-fence rules) over docs/ to catch other unclosed blocks","Check any script that generates docs to ensure it emits closing fences"],"exampleFix":"// before\n```rust\nfn main() {}\n<!-- file ends, no closing fence -->\n// after\n```rust\nfn main() {}\n```","handlingStrategy":"validation","validationCode":"grep -c '^```rust' file.md; grep -c '^```' file.md # counts must be balanced","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run markdownlint (unclosed-fence rules) over docs before committing","Review diffs of docs files for truncated code blocks","Ensure doc generators always emit closing fences"],"tags":["docs","markdown","validation","unclosed-block"],"backgroundTag":"invalid-argument-format","analyzedSha":"23639d1e360dbc618073642b507d6f8664adbaff","analyzedAt":"2026-09-12T01:47:20.769Z","contentChangedAt":"2026-09-12T01:47:20.769Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}