{"record":{"id":"19e226487f82463c","repo":"bevyengine/bevy","slug":"world-conflicts-with-a-previous-mutable-system-pa","errorCode":null,"errorMessage":"&World conflicts with a previous mutable system parameter. Allowing this would break Rust's mutability rules","messagePattern":"&World conflicts with a previous mutable system parameter\\. Allowing this would break Rust's mutability rules","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/bevy_ecs/src/system/system_param.rs","lineNumber":808,"sourceCode":"    type State = ();\n    type Item<'w, 's> = &'w World;\n\n    fn init_state(_world: &mut World) -> Self::State {}\n\n    fn init_access(\n        _state: &Self::State,\n        _system_meta: &mut SystemMeta,\n        component_access_set: &mut FilteredAccessSet,\n        _world: &mut World,\n    ) {\n        let mut filtered_access = FilteredAccess::default();\n\n        filtered_access.read_all();\n        if !component_access_set\n            .get_conflicts_single(&filtered_access)\n            .is_empty()\n        {\n            panic!(\"&World conflicts with a previous mutable system parameter. Allowing this would break Rust's mutability rules\");\n        }\n        component_access_set.add(filtered_access);\n    }\n\n    #[inline]\n    unsafe fn get_param<'w, 's>(\n        _state: &'s mut Self::State,\n        _system_meta: &SystemMeta,\n        world: UnsafeWorldCell<'w>,\n        _change_tick: Tick,\n    ) -> Result<Self::Item<'w, 's>, SystemParamValidationError> {\n        // SAFETY: Read-only access to the entire world was registered in `init_state`.\n        Ok(unsafe { world.world() })\n    }\n}\n\n// SAFETY: `DeferredWorld` can read all components and resources but cannot be used to gain any other mutable references.\nunsafe impl<'w> SystemParam for DeferredWorld<'w> {","sourceCodeStart":790,"sourceCodeEnd":826,"githubUrl":"https://github.com/bevyengine/bevy/blob/396ca727080776bd313bb892423b7d94e03b81b4/crates/bevy_ecs/src/system/system_param.rs#L790-L826","documentation":"Panics in the SystemParam::init_access impl for &World: requesting read-only access to the entire World conflicts with a mutable system parameter already declared earlier in the same system's signature, which would violate Rust's aliasing rules.","triggerScenarios":"Thrown at crates/bevy_ecs/src/system/system_param.rs:808 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Replace &World with narrower parameters such as Res<T>, Local<T>, or Query so access is disjoint","Wrap the conflicting parameters in a ParamSet","Use DeferredWorld or commands instead of direct world access"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"396ca727080776bd313bb892423b7d94e03b81b4","analyzedAt":"2026-08-20T16:12:39.808Z","contentChangedAt":"2026-08-20T16:12:39.808Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}