{"record":{"id":"e3cbdb0c37cb15ef","repo":"bevyengine/bevy","slug":"not-supported-in-this-position-please-use-one-of-e3cbdb","errorCode":null,"errorMessage":"Not supported in this position, please use one of the following:\n- path to function\n- nothing to default to MapEntities implementation","messagePattern":"Not supported in this position, please use one of the following:\n- path to function\n- nothing to default to MapEntities implementation","errorType":"validation","errorClass":"syn::Error","httpStatus":null,"severity":"error","filePath":"crates/bevy_ecs/macro_logic/src/map_entities.rs","lineNumber":120,"sourceCode":"}\n\n/// The type of `MapEntities` attribute.\n#[derive(Debug)]\npub enum MapEntitiesAttributeKind {\n    /// expressions like function or struct names\n    ///\n    /// structs will throw compile errors on the code generation so this is safe\n    Path(ExprPath),\n    /// When no value is specified\n    Default,\n}\n\nimpl MapEntitiesAttributeKind {\n    fn from_expr(value: Expr) -> syn::Result<Self> {\n        match value {\n            Expr::Path(path) => Ok(Self::Path(path)),\n            // throw meaningful error on all other expressions\n            _ => Err(syn::Error::new(\n                value.span(),\n                [\n                    \"Not supported in this position, please use one of the following:\",\n                    \"- path to function\",\n                    \"- nothing to default to MapEntities implementation\",\n                ]\n                .join(\"\\n\"),\n            )),\n        }\n    }\n\n    fn to_token_stream(&self, bevy_ecs_path: &Path) -> TokenStream {\n        match self {\n            MapEntitiesAttributeKind::Path(path) => path.to_token_stream(),\n            MapEntitiesAttributeKind::Default => {\n                quote!(\n                   <Self as #bevy_ecs_path::entity::MapEntities>::map_entities\n                )","sourceCodeStart":102,"sourceCodeEnd":138,"githubUrl":"https://github.com/bevyengine/bevy/blob/396ca727080776bd313bb892423b7d94e03b81b4/crates/bevy_ecs/macro_logic/src/map_entities.rs#L102-L138","documentation":"Compile error from MapEntitiesAttributeKind::from_expr: the #[map_entities] attribute value was parsed as an expression that is not a plain path (e.g. a literal, call, or struct literal), so the macro rejected it with this sentinel listing the accepted forms — a function path or nothing at all.","triggerScenarios":"Thrown at crates/bevy_ecs/macro_logic/src/map_entities.rs:120 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a plain function path: #[map_entities(my_map_fn)]","Omit the value entirely to use the type's MapEntities impl: #[map_entities]","Wrap the logic in a free function and reference it by name instead of an inline expression"],"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-14T00:17:10.932Z"}