oxc/crates
overlookmotel eb25bc0ec6 fix(allocator): fix lifetimes on IntoIterator for Vec (#8388)
Lifetime on our impl of `IntoIterator` for `&Vec` was wrong.

Previously:

```rs
impl<'alloc, T> IntoIterator for &'alloc Vec<'alloc, T> {
    type IntoIter = std::slice::Iter<'alloc, T>;
    type Item = &'alloc T;
    fn into_iter(self) -> Self::IntoIter { self.0.iter() }
}
```

This means that the iterator borrows the `Vec` for the lifetime of the allocator, which is way too long. It should only borrow it for the lifetime of the reference `&Vec`. Insisting we borrow the `Vec` for so long to iterate over it was unnecessarily restrictive.

Instead:

```rs
impl<'i, T> IntoIterator for &'i Vec<'_, T> {
    type IntoIter = std::slice::Iter<'i, T>;
    type Item = &'i T;
    fn into_iter(self) -> Self::IntoIter { self.0.iter() }
}
```

This matches the lifetimes on [`allocator_api2::vec::Vec`'s implementation](63cd7fcc2f/src/stable/vec/mod.rs (L2682-L2690)).
2025-01-09 15:32:15 +00:00
..
oxc release(crates): v0.44.0 (#8110) 2024-12-25 21:03:09 +08:00
oxc_allocator fix(allocator): fix lifetimes on IntoIterator for Vec (#8388) 2025-01-09 15:32:15 +00:00
oxc_ast feat(minifier): merge assign expression in conditional expression (#8345) 2025-01-08 13:34:12 +00:00
oxc_ast_macros release(crates): v0.44.0 (#8110) 2024-12-25 21:03:09 +08:00
oxc_cfg release(crates): v0.44.0 (#8110) 2024-12-25 21:03:09 +08:00
oxc_codegen fix(codegen): fix incorrect minified return 1n output (#8374) 2025-01-09 05:01:41 +00:00
oxc_data_structures docs(data_structures): improve docs for stack types (#8356) 2025-01-08 20:49:28 +00:00
oxc_diagnostics release(crates): v0.44.0 (#8110) 2024-12-25 21:03:09 +08:00
oxc_ecmascript fix(minifier): instanceof has error throwing side effect (#8378) 2025-01-09 06:49:27 +00:00
oxc_estree release(crates): v0.44.0 (#8110) 2024-12-25 21:03:09 +08:00
oxc_isolated_declarations refactor(ast): simplify get_identifier_reference of TSType and TSTypeName (#8273) 2025-01-06 08:23:53 +00:00
oxc_language_server refactor(linter): refactor LintBuilder to prep for nested configs (#8034) 2025-01-05 04:08:26 +00:00
oxc_linter refactor(linter): split unicorn/prefer-spread and eslint/prefer-spread into own rules (#8329) 2025-01-09 14:28:36 +00:00
oxc_macros test(linter): use plugin name instead of category for finding rule (#8353) 2025-01-09 10:48:11 +08:00
oxc_mangler release(crates): v0.44.0 (#8110) 2024-12-25 21:03:09 +08:00
oxc_minifier feat(minifier): a != null ? a : b -> a ?? b (#8352) 2025-01-09 10:12:52 +00:00
oxc_napi release(crates): v0.44.0 (#8110) 2024-12-25 21:03:09 +08:00
oxc_parser fix(lexer): Source is not Clone (#8294) 2025-01-07 06:58:26 +00:00
oxc_prettier refactor(prettier): Make hardline! to return Doc (#8379) 2025-01-09 14:48:52 +08:00
oxc_regular_expression release(crates): v0.44.0 (#8110) 2024-12-25 21:03:09 +08:00
oxc_semantic refactor(semantic): check super usage based on scope (#8377) 2025-01-09 06:38:09 +00:00
oxc_span style(span): reformat code (#8296) 2025-01-06 13:57:58 +00:00
oxc_syntax fix(minifier): instanceof has error throwing side effect (#8378) 2025-01-09 06:49:27 +00:00
oxc_transformer refactor(transformer/arrow-functions): reorder assertions (#8386) 2025-01-09 12:23:54 +00:00
oxc_traverse release(crates): v0.44.0 (#8110) 2024-12-25 21:03:09 +08:00
oxc_wasm refactor(linter): refactor LintBuilder to prep for nested configs (#8034) 2025-01-05 04:08:26 +00:00