{"record":{"id":"b73b0da5537bc906","repo":"oxc-project/oxc","slug":"cannot-pop-all-entries","errorCode":null,"errorMessage":"Cannot pop all entries","messagePattern":"Cannot pop all entries","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"crates/oxc_data_structures/src/stack/non_empty.rs","lineNumber":320,"sourceCode":"    }\n\n    /// Pop value from stack.\n    ///\n    /// # Panics\n    /// Panics if the stack has only 1 entry on it.\n    #[inline]\n    pub fn pop(&mut self) -> T {\n        // Panic if trying to remove last entry from stack.\n        //\n        // Putting the panic in an `#[inline(never)]` + `#[cold]` function removes a 6-byte `lea`\n        // instruction vs `assert!(self.cursor != self.start, \"Cannot pop all entries\")`.\n        // This reduces this function on x86_64 from 32 bytes to 26 bytes.\n        // This function is commonly used, and we want it to be inlined, so every byte counts.\n        // https://godbolt.org/z/5587z99rM\n        #[inline(never)]\n        #[cold]\n        fn error() -> ! {\n            panic!(\"Cannot pop all entries\");\n        }\n\n        if self.cursor == self.start {\n            error();\n        }\n\n        // SAFETY: Assertion above ensures stack has at least 2 entries\n        unsafe { self.pop_unchecked() }\n    }\n\n    /// Pop value from stack, without checking that stack isn't empty.\n    ///\n    /// # SAFETY\n    ///\n    /// * Stack must have at least 2 entries, so that after pop, it still has at least 1.\n    #[inline]\n    pub unsafe fn pop_unchecked(&mut self) -> T {\n        debug_assert!(self.cursor > self.start);","sourceCodeStart":302,"sourceCodeEnd":338,"githubUrl":"https://github.com/oxc-project/oxc/blob/36ec0ef2bae567d1a8413ada2fe795f1af1f2785/crates/oxc_data_structures/src/stack/non_empty.rs#L302-L338","documentation":"Diagnostic from oxlint's vue/require-prop-types rule (crates/oxc_linter/src/rules/vue/require_prop_types.rs). Every declared prop must carry at least a type definition. It reports array-syntax props (`props: ['foo']`) and object entries lacking a `type` key. Without types Vue performs no validation and IDEs cannot infer the prop's shape, so bad data flows through unchecked.","triggerScenarios":"`props: ['foo', 'bar']`, `defineProps(['value'])`, or object props without a type (`props: { foo: {} }`) in a Vue component's default-export options object or equivalent declaration. The rule inspects object expressions, arrays, and call expressions (e.g. defineProps) within component definitions.","commonSituations":"Prototype-era components left with array props; props added quickly during feature work; migrations from very old Vue syntax where types were optional everywhere.","solutions":["Convert array syntax to object syntax with types: `props: { foo: String }`.","For complex shapes use PropType with a constructor: `type: Object as PropType<MyShape>`.","If a prop is deliberately untyped, suppress the rule on that line and note why in review.","Prefer TS type-only defineProps so types come from the signature itself."],"exampleFix":"// before\nexport default { props: ['foo', 'bar'] }\n\n// after\nexport default { props: { foo: String, bar: Number } }","handlingStrategy":"validation","validationCode":"// every prop must declare a type\nfunction everyPropTyped(defs) {\n  if (Array.isArray(defs)) {\n    throw new Error('array-syntax props carry no types: ' + defs.join(','));\n  }\n  for (const [name, def] of Object.entries(defs)) {\n    const t = typeof def === 'object' && def !== null ? def.type : def;\n    if (!t) throw new Error(`prop '${name}' lacks a type`);\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Ban `props: [...]` array syntax in code review.","Type each prop when it is created; retrofitting types across a large app is expensive.","Prefer TS type-only defineProps so types come from the signature."],"tags":["vue","oxlint","lint","props","types","validation"],"backgroundTag":"vue-prop-type-missing","analyzedSha":"36ec0ef2bae567d1a8413ada2fe795f1af1f2785","analyzedAt":"2026-08-20T07:01:07.079Z","contentChangedAt":"2026-08-20T07:01:07.079Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}