{"record":{"id":"93e4976abff0d6ae","repo":"a-b-street/abstreet","slug":"the-common-roads-on-the-first-aren-t-consecutive-near","errorCode":null,"errorMessage":"The common roads on the first aren't consecutive, near {:?}","messagePattern":"The common roads on the first aren't consecutive, near (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"blockfinding/src/lib.rs","lineNumber":274,"sourceCode":"                self.restore_invariant();\n                other.restore_invariant();\n                self.roads.reverse();\n                continue;\n            }\n\n            // Check if all of the common roads are at the end of each perimeter, so we can\n            // \"blindly\" do this snipping. If this isn't true, then the overlapping portions are\n            // split by non-overlapping roads. This happens when merging the two blocks would\n            // result in a \"hole.\"\n            for id in self.roads.iter().rev().take(common.len()) {\n                if !common.contains(&id.road) {\n                    if debug_failures {\n                        warn!(\n                            \"The common roads on the first aren't consecutive, near {:?}\",\n                            id\n                        );\n                    }\n                    bail!(\n                        \"The common roads on the first aren't consecutive, near {:?}\",\n                        id\n                    );\n                }\n            }\n            for id in other.roads.iter().rev().take(common.len()) {\n                if !common.contains(&id.road) {\n                    if debug_failures {\n                        warn!(\n                            \"The common roads on the second aren't consecutive, near {:?}\",\n                            id\n                        );\n                    }\n                    bail!(\n                        \"The common roads on the first aren't consecutive, near {:?}\",\n                        id\n                    );\n                }","sourceCodeStart":256,"sourceCodeEnd":292,"githubUrl":"https://github.com/a-b-street/abstreet/blob/0964f29315820c91b171b585eb51e300164e9197/blockfinding/src/lib.rs#L256-L292","documentation":"After rotation, try_to_merge requires the common roads on the first perimeter to form one consecutive run at the end of the list. A gap was found (a non-common road inside what should be the shared tail), so the perimeters don't share a single contiguous boundary and the merge bails, naming the offending road side.","triggerScenarios":"try_to_merge where, scanning self.roads in reverse over the last `common.len()` entries, an entry's road is not in `common` — the common roads are not consecutive even though the counts matched.","commonSituations":"Complex block shapes where the shared boundary is interrupted by another block touching in between; geometry produced by aggressive earlier merges; maps with irregular intersections.","solutions":["Skip this merge pair (use debug_failures=true to log and continue instead of failing hard).","Inspect the road side named in the message to find the intervening geometry; adjust block formation or the skip set.","Attempt merging with a different neighbor block instead."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"if let Err(e) = a.try_to_merge(map, b, &mut small_roads, /*debug_failures*/ true) {\n    warn!(\"merge skipped: {}\", e); // message names the offending road side\n    continue;\n}","preventionTips":["Run with debug_failures=true during development to see which road side breaks contiguity.","Keep block formation conservative to avoid blocks with interrupted shared boundaries."],"tags":["merge","perimeter-tracing","geometry"],"backgroundTag":"internal-invariant-violation","analyzedSha":"0964f29315820c91b171b585eb51e300164e9197","analyzedAt":"2026-09-13T18:02:03.421Z","contentChangedAt":"2026-09-13T18:02:03.421Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}