{"record":{"id":"063c47df338bcd3a","repo":"bevyengine/bevy","slug":"cannot-contiguously-iterate-non-dense-query-0","errorCode":null,"errorMessage":"Cannot contiguously iterate non-dense query {0}","messagePattern":"Cannot contiguously iterate non-dense query (.+?)","errorType":"exception","errorClass":"QueryNotDenseError","httpStatus":null,"severity":"error","filePath":"crates/bevy_ecs/src/query/error.rs","lineNumber":42,"sourceCode":"    AliasedMutability(Entity),\n}\n\n/// An error that occurs when evaluating a [`Query`](crate::system::Query) or [`QueryState`](crate::query::QueryState) as a single expected result via\n/// [`single`](crate::system::Query::single) or [`single_mut`](crate::system::Query::single_mut).\n#[derive(Debug, thiserror::Error)]\npub enum QuerySingleError {\n    /// No entity fits the query.\n    #[error(\"No entities fit the query {0}\")]\n    NoEntities(DebugName),\n    /// Multiple entities fit the query.\n    #[error(\"Multiple entities fit the query {0}\")]\n    MultipleEntities(DebugName),\n}\n\n/// An error that occurs when creating a contiguous iterator from a non-dense [`Query`](crate::system::Query) or [`QueryState`](crate::query::QueryState) via\n/// [`contiguous_iter`](crate::system::Query::contiguous_iter) or [`contiguous_iter_mut`](crate::system::Query::contiguous_iter_mut).\n#[derive(Debug, thiserror::Error)]\n#[error(\"Cannot contiguously iterate non-dense query {0}\")]\npub struct QueryNotDenseError(pub DebugName);\n\n#[cfg(test)]\nmod test {\n    use crate::{prelude::World, query::QueryEntityError};\n    use bevy_ecs_macros::Component;\n\n    #[test]\n    fn query_does_not_match() {\n        let mut world = World::new();\n\n        #[derive(Component)]\n        struct Present1;\n        #[derive(Component)]\n        struct Present2;\n        #[derive(Component, Debug, PartialEq)]\n        struct NotPresent;\n","sourceCodeStart":24,"sourceCodeEnd":60,"githubUrl":"https://github.com/bevyengine/bevy/blob/396ca727080776bd313bb892423b7d94e03b81b4/crates/bevy_ecs/src/query/error.rs#L24-L60","documentation":"Panic message from update_component_access in query filter codegen (e.g. Added<T>/Changed<T> filters): registering the filter's component access found the component already accessed exclusively (mutably) elsewhere in the same query, while the filter needs shared (read) access — an unsound access conflict detected while building FilteredAccess.","triggerScenarios":"Thrown at crates/bevy_ecs/src/query/error.rs:42 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Split conflicting accesses into separate systems","Use ParamSet to sequence the mutable and read-only accesses","Add Without<T> / disjoint filters so the two accesses never touch the same entity","Drop the mutable access if read-only suffices"],"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"}