{"record":{"id":"4d014776849b9a29","repo":"gfx-rs/wgpu","slug":"name-is-not-core","errorCode":null,"errorMessage":"${name} is not core","messagePattern":"(.+?) is not core","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"wgpu/src/dispatch.rs","lineNumber":822,"sourceCode":"        #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone)]\n        pub enum $name {\n            #[cfg(wgpu_core)]\n            Core($core_type),\n            #[cfg(webgpu)]\n            WebGPU($webgpu_type),\n            #[allow(clippy::allow_attributes, private_interfaces)]\n            #[cfg(custom)]\n            Custom($custom_type),\n        }\n\n        impl $name {\n            #[cfg(wgpu_core)]\n            #[inline]\n            #[allow(clippy::allow_attributes, unused)]\n            pub fn as_core(&self) -> &$core_type {\n                match self {\n                    Self::Core(value) => value,\n                    _ => panic!(concat!(stringify!($name), \" is not core\")),\n                }\n            }\n\n            #[cfg(wgpu_core)]\n            #[inline]\n            #[allow(clippy::allow_attributes, unused)]\n            pub fn as_core_opt(&self) -> Option<&$core_type> {\n                match self {\n                    Self::Core(value) => Some(value),\n                    _ => None,\n                }\n            }\n\n            #[cfg(custom)]\n            #[inline]\n            #[allow(clippy::allow_attributes, unused)]\n            pub fn as_custom<T: $interface>(&self) -> Option<&T> {\n                match self {","sourceCodeStart":804,"sourceCodeEnd":840,"githubUrl":"https://github.com/gfx-rs/wgpu/blob/3e11ff59bf3f9795d285ecc045014089640d7248/wgpu/src/dispatch.rs#L804-L840","documentation":"Panic from the macro-generated as_core() accessor on a dispatch enum: the value is the WebGPU or Custom variant, not Core. It fires when a backend-specific accessor is called on an object created by a different backend; the faulty input is the non-Core dispatch value.","triggerScenarios":"Thrown at wgpu/src/dispatch.rs:822 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify which backend produced the object before calling as_core()","Design call sites to keep objects within one backend context"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3e11ff59bf3f9795d285ecc045014089640d7248","analyzedAt":"2026-09-03T01:43:21.459Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T07:17:11.731Z"}