{"record":{"id":"31409f8afcf340f5","repo":"DioxusLabs/dioxus","slug":"const-vec-capacity-exceeded","errorCode":null,"errorMessage":"const vec capacity exceeded","messagePattern":"const vec capacity exceeded","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/dioxus-const-vec/src/lib.rs","lineNumber":152,"sourceCode":"        }\n    }\n\n    /// Push a value onto the end of the [`ConstVec`].\n    ///\n    /// # Example\n    ///\n    /// ```rust\n    /// # use dioxus_const_vec::ConstVec;\n    /// const ONE: ConstVec<u8> = {\n    ///     let mut vec = ConstVec::new();\n    ///     vec.push(1);\n    ///     vec\n    /// };\n    /// assert_eq!(ONE.as_ref(), &[1]);\n    /// ```\n    pub const fn push(&mut self, value: T) {\n        if self.len as usize >= MAX_SIZE {\n            panic!(\"const vec capacity exceeded\");\n        }\n        self.memory[self.len as usize] = MaybeUninit::new(value);\n        self.len += 1;\n    }\n\n    /// Extend the [`ConstVec`] with the contents of a slice.\n    ///\n    /// # Example\n    ///\n    /// ```rust\n    /// # use dioxus_const_vec::ConstVec;\n    /// const ONE: ConstVec<u8> = {\n    ///     let mut vec = ConstVec::new();\n    ///     vec.extend(&[1, 2, 3]);\n    ///     vec\n    /// };\n    /// assert_eq!(ONE.as_ref(), &[1, 2, 3]);\n    /// ```","sourceCodeStart":134,"sourceCodeEnd":170,"githubUrl":"https://github.com/DioxusLabs/dioxus/blob/24f6a829df0dfa203961a98ea4cae21c2ff27e28/packages/dioxus-const-vec/src/lib.rs#L134-L170","documentation":"ConstVec is backed by a fixed MAX_SIZE array. Pushing more elements than that capacity (commonly via extend in const contexts) exceeds the backing storage and triggers this panic, since const code cannot grow an allocation.","triggerScenarios":"Thrown at packages/dioxus-const-vec/src/lib.rs:152 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["The const vec is at its fixed capacity. Increase the capacity parameter or push fewer elements."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"24f6a829df0dfa203961a98ea4cae21c2ff27e28","analyzedAt":"2026-08-23T07:10:14.078Z","contentChangedAt":"2026-08-23T07:10:14.078Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}