{"record":{"id":"68ecff71f7f3b3e4","repo":"a-b-street/abstreet","slug":"a-trip-just-walking-from-to-doesn-t-make-sense","errorCode":null,"errorMessage":"A trip just walking from {:?} to {:?} doesn't make sense","messagePattern":"A trip just walking from (.+?) to (.+?) doesn't make sense","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sim/src/make/spawner.rs","lineNumber":122,"sourceCode":"            TripSpec::SpawningFailure { .. } => {\n                // TODO The legs are a lie. Since the trip gets cancelled, this doesn't matter.\n                // I'm not going to bother doing better because I think TripLeg will get\n                // revamped soon anyway.\n                legs.push(TripLeg::RideBus(TransitRouteID(0), None));\n            }\n            TripSpec::UsingParkedCar { car, goal, .. } => {\n                legs.push(TripLeg::Walk(SidewalkSpot::deferred_parking_spot()));\n                legs.push(TripLeg::Drive(*car, goal.clone()));\n                match goal {\n                    DrivingGoal::ParkNear(b) => {\n                        legs.push(TripLeg::Walk(SidewalkSpot::building(*b, map)));\n                    }\n                    DrivingGoal::Border(_, _) => {}\n                }\n            }\n            TripSpec::JustWalking { start, goal, .. } => {\n                if start == goal {\n                    panic!(\n                        \"A trip just walking from {:?} to {:?} doesn't make sense\",\n                        start, goal\n                    );\n                }\n                legs.push(TripLeg::Walk(goal.clone()));\n            }\n            TripSpec::UsingBike { start, goal, bike } => {\n                // TODO Might not be possible to walk to the same border if there's no sidewalk\n                let backup_plan = match goal {\n                    DrivingGoal::ParkNear(b) => Some(TripSpec::JustWalking {\n                        start: SidewalkSpot::building(*start, map),\n                        goal: SidewalkSpot::building(*b, map),\n                    }),\n                    DrivingGoal::Border(i, _) => {\n                        SidewalkSpot::end_at_border(*i, map).map(|goal| TripSpec::JustWalking {\n                            start: SidewalkSpot::building(*start, map),\n                            goal,\n                        })","sourceCodeStart":104,"sourceCodeEnd":140,"githubUrl":"https://github.com/a-b-street/abstreet/blob/0964f29315820c91b171b585eb51e300164e9197/sim/src/make/spawner.rs#L104-L140","documentation":"TripSpec::JustWalking describes a purely pedestrian trip; if the start and goal building positions are identical there is no trip to perform. into_plan panics because a zero-distance walk would produce an empty trip with no legs.","triggerScenarios":"into_plan() with TripSpec::JustWalking where start == goal (same building or position), typically when a scenario samples origin and destination and they collide.","commonSituations":"Random scenario generators picking the same building twice; data pipelines where origin/destination columns alias; people parked at a building asked to walk to it.","solutions":["Skip or resample trips whose origin equals the destination in the scenario generator","Convert the trip into a no-op/parking-only spec instead of JustWalking","Deduplicate origin/destination pairs when building TripSpecs"],"exampleFix":"// before\nTripSpec::JustWalking { start: b, goal: b, .. }\n// after\nif start == goal { return None; } // or pick a different goal building","handlingStrategy":"validation","validationCode":"if start == goal {\n    return None; // skip: nothing to walk\n}\nlet spec = TripSpec::JustWalking { start, goal, depart };","typeGuard":null,"tryCatchPattern":"let plan = std::panic::catch_unwind(|| spec.into_plan(&map, &mut rng));","preventionTips":["Deduplicate origin/destination pairs in scenario generators","Resample the goal building when it equals the start"],"tags":["rust","panic","invalid-argument-value","simulation"],"backgroundTag":"invalid-argument-value","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"}