Repository navigation
alloc: Unstably add Vec::repeat and Vec::repeat_in - #164043
Conversation
This comment has been minimized.
This comment has been minimized.
|
r? ChrisDenton Offloading a few PRs, Chris should have enough context to handle this. |
This comment has been minimized.
This comment has been minimized.
|
I wouldn't be willing to support this without an accepted ACP that details the motivation. It is basically a new specialization wrapper (while it existed before, it was only for internal use). So I'll pass on review. r? libs |
|
Yup, this is major enough to need discussion as an ACP. @Gelbpunkt could you file one? |
This comment has been minimized.
This comment has been minimized.
|
per ACP, these should be renamed @rustbot author |
|
Reminder, once the PR becomes ready for a review, use |
|
We can also remove rust/library/alloc/src/vec/mod.rs Lines 3959 to 3965 in 495625e |
We also forward the existing `std::vec::from_elem_global` and `std::vec::from_elem_in` to these new associated methods on `Vec`. The module-level methods could potentially be removed in a follow-up.
Wouldn't that then make clippy think that any call to |
|
It's an unstable function so it seems fine for clippy to fix any problems this causes them after the fact? Otherwise the problem is basically hidden. Unless of course fixing it without using a separate wrapper function is not feasible. |
alloc: Unstably add `Vec::repeat` and `Vec::repeat_in` Tracking issue: rust-lang#164215 We also forward the existing `std::vec::from_elem_global` to `Vec::repeat`. The old module-level method `std::vec::from_elem_in` was unstable and unused, so I've removed it as per reviewer's request. [Zulip thread](https://rust-lang.zulipchat.com/#narrow/channel/197181-t-libs.2Fwg-allocators/topic/Custom.20allocators.20with.20vec.21.20and.20fallible.20allocations/with/630260935) r? @clarfonthey
alloc: Unstably add `Vec::repeat` and `Vec::repeat_in` Tracking issue: rust-lang#164215 We also forward the existing `std::vec::from_elem_global` to `Vec::repeat`. The old module-level method `std::vec::from_elem_in` was unstable and unused, so I've removed it as per reviewer's request. [Zulip thread](https://rust-lang.zulipchat.com/#narrow/channel/197181-t-libs.2Fwg-allocators/topic/Custom.20allocators.20with.20vec.21.20and.20fallible.20allocations/with/630260935) r? @clarfonthey
alloc: Unstably add `Vec::repeat` and `Vec::repeat_in` Tracking issue: rust-lang#164215 We also forward the existing `std::vec::from_elem_global` to `Vec::repeat`. The old module-level method `std::vec::from_elem_in` was unstable and unused, so I've removed it as per reviewer's request. [Zulip thread](https://rust-lang.zulipchat.com/#narrow/channel/197181-t-libs.2Fwg-allocators/topic/Custom.20allocators.20with.20vec.21.20and.20fallible.20allocations/with/630260935) r? @clarfonthey
…uwer Rollup of 14 pull requests Successful merges: - #160618 (require a consistent codegen backend when -Zllvm-target-feature is present) - #164043 (alloc: Unstably add `Vec::repeat` and `Vec::repeat_in`) - #164823 (Use `DerefMut` and `IndexMut` before `&raw mut` autoborrow) - #165568 (rustdoc: Suggest corrections for reference label typos) - #165924 (rustc_codegen_gcc subtree update 2026-11-13) - #165927 (Remove `const_struct` from `rustc_codegen_ssa`) - #165928 (Replace most uses of `type_array` with `type_byte_array` in `rustc_codegen_llvm`) - #164362 (Emit note for `non_exhaustive` within defining crate for `unreachable_patterns`) - #164997 (Fix as str suggestion in subpattern) - #165868 (Small changes to dyn compatibility) - #165879 (Add `#[rustc_test_entrypoint_marker]` back !) - #165903 (Fix borrowck ICE when a borrow outlives a local in a const block) - #165914 (Use `trim_prefix` in bootstrap) - #165919 (tests: accept better behavior on underaligned accesses)
alloc: Unstably add `Vec::repeat` and `Vec::repeat_in` Tracking issue: rust-lang#164215 We also forward the existing `std::vec::from_elem_global` to `Vec::repeat`. The old module-level method `std::vec::from_elem_in` was unstable and unused, so I've removed it as per reviewer's request. [Zulip thread](https://rust-lang.zulipchat.com/#narrow/channel/197181-t-libs.2Fwg-allocators/topic/Custom.20allocators.20with.20vec.21.20and.20fallible.20allocations/with/630260935) r? @clarfonthey
Rollup of 17 pull requests Successful merges: - #160618 (require a consistent codegen backend when -Zllvm-target-feature is present) - #164043 (alloc: Unstably add `Vec::repeat` and `Vec::repeat_in`) - #164808 (asm const ptr: move name generation to asm-specific logic) - #164823 (Use `DerefMut` and `IndexMut` before `&raw mut` autoborrow) - #165475 (Add a `!type` annotation to a vtable for every supertrait that is a prefix of the vtable) - #165568 (rustdoc: Suggest corrections for reference label typos) - #165924 (rustc_codegen_gcc subtree update 2026-11-13) - #165927 (Remove `const_struct` from `rustc_codegen_ssa`) - #164362 (Emit note for `non_exhaustive` within defining crate for `unreachable_patterns`) - #164997 (Fix as str suggestion in subpattern) - #165825 (make `Complex<x87_f80>` ABI-compatible with C) - #165868 (Small changes to dyn compatibility) - #165879 (Add `#[rustc_test_entrypoint_marker]` back !) - #165903 (Fix borrowck ICE when a borrow outlives a local in a const block) - #165914 (Use `trim_prefix` in bootstrap) - #165919 (tests: accept better behavior on underaligned accesses) - #165936 (Enhance documentation for try_clone File implementation)
alloc: Unstably add `Vec::repeat` and `Vec::repeat_in` Tracking issue: rust-lang#164215 We also forward the existing `std::vec::from_elem_global` to `Vec::repeat`. The old module-level method `std::vec::from_elem_in` was unstable and unused, so I've removed it as per reviewer's request. [Zulip thread](https://rust-lang.zulipchat.com/#narrow/channel/197181-t-libs.2Fwg-allocators/topic/Custom.20allocators.20with.20vec.21.20and.20fallible.20allocations/with/630260935) r? @clarfonthey
Rollup of 16 pull requests Successful merges: - #160618 (require a consistent codegen backend when -Zllvm-target-feature is present) - #164043 (alloc: Unstably add `Vec::repeat` and `Vec::repeat_in`) - #164823 (Use `DerefMut` and `IndexMut` before `&raw mut` autoborrow) - #165475 (Add a `!type` annotation to a vtable for every supertrait that is a prefix of the vtable) - #165568 (rustdoc: Suggest corrections for reference label typos) - #165924 (rustc_codegen_gcc subtree update 2026-11-13) - #165927 (Remove `const_struct` from `rustc_codegen_ssa`) - #164362 (Emit note for `non_exhaustive` within defining crate for `unreachable_patterns`) - #164997 (Fix as str suggestion in subpattern) - #165825 (make `Complex<x87_f80>` ABI-compatible with C) - #165868 (Small changes to dyn compatibility) - #165879 (Add `#[rustc_test_entrypoint_marker]` back !) - #165903 (Fix borrowck ICE when a borrow outlives a local in a const block) - #165914 (Use `trim_prefix` in bootstrap) - #165919 (tests: accept better behavior on underaligned accesses) - #165936 (Enhance documentation for try_clone File implementation)
|
⌛ Testing commit 7b57c43 with merge 8045d90... Workflow: https://github.com/rust-lang/rust/actions/runs/43546382632 |
alloc: Unstably add `Vec::repeat` and `Vec::repeat_in` Tracking issue: #164215 We also forward the existing `std::vec::from_elem_global` to `Vec::repeat`. The old module-level method `std::vec::from_elem_in` was unstable and unused, so I've removed it as per reviewer's request. [Zulip thread](https://rust-lang.zulipchat.com/#narrow/channel/197181-t-libs.2Fwg-allocators/topic/Custom.20allocators.20with.20vec.21.20and.20fallible.20allocations/with/630260935) r? @clarfonthey
|
@bors yield (treeclosed) |
|
Auto build was cancelled. Cancelled workflows: The next pull request likely to be tested is #164043. |
alloc: Unstably add `Vec::repeat` and `Vec::repeat_in` Tracking issue: rust-lang#164215 We also forward the existing `std::vec::from_elem_global` to `Vec::repeat`. The old module-level method `std::vec::from_elem_in` was unstable and unused, so I've removed it as per reviewer's request. [Zulip thread](https://rust-lang.zulipchat.com/#narrow/channel/197181-t-libs.2Fwg-allocators/topic/Custom.20allocators.20with.20vec.21.20and.20fallible.20allocations/with/630260935) r? @clarfonthey
alloc: Unstably add `Vec::repeat` and `Vec::repeat_in` Tracking issue: rust-lang#164215 We also forward the existing `std::vec::from_elem_global` to `Vec::repeat`. The old module-level method `std::vec::from_elem_in` was unstable and unused, so I've removed it as per reviewer's request. [Zulip thread](https://rust-lang.zulipchat.com/#narrow/channel/197181-t-libs.2Fwg-allocators/topic/Custom.20allocators.20with.20vec.21.20and.20fallible.20allocations/with/630260935) r? @clarfonthey
…uwer Rollup of 23 pull requests Successful merges: - #165928 (Replace most uses of `type_array` with `type_byte_array` in `rustc_codegen_llvm`) - #160618 (require a consistent codegen backend when -Zllvm-target-feature is present) - #161950 (Ensure floats are returned losslessly by the C ABI on 32-bit x86) - #162267 (Fix an edge within `std::fs::create_dir_all` for certain platforms that views trailing cur dir components as a separate missing directory components) - #164043 (alloc: Unstably add `Vec::repeat` and `Vec::repeat_in`) - #164808 (asm const ptr: move name generation to asm-specific logic) - #164823 (Use `DerefMut` and `IndexMut` before `&raw mut` autoborrow) - #165568 (rustdoc: Suggest corrections for reference label typos) - #165641 (Treat all proc macro dependencies as host dependencies in bootstrap) - #165924 (rustc_codegen_gcc subtree update 2026-11-13) - #165927 (Remove `const_struct` from `rustc_codegen_ssa`) - #163696 (Stabilize `int_from_ascii`) - #163882 (docs(vec): clarify into_boxed_slice allocation guarantee) - #164362 (Emit note for `non_exhaustive` within defining crate for `unreachable_patterns`) - #164465 (Under `guard_patterns` allow parenthesized guarded patterns in match arms) - #164997 (Fix as str suggestion in subpattern) - #165825 (make `Complex<x87_f80>` ABI-compatible with C) - #165868 (Small changes to dyn compatibility) - #165879 (Add `#[rustc_test_entrypoint_marker]` back !) - #165902 (Add allocator() to vec_deque::IntoIter and vec_deque::Drain) - #165903 (Fix borrowck ICE when a borrow outlives a local in a const block) - #165914 (Use `trim_prefix` in bootstrap) - #165919 (tests: accept better behavior on underaligned accesses) Failed merges: - #165893 (Prune un/under used methods of `ast::Attribute`)
…uwer Rollup of 23 pull requests Successful merges: - #165928 (Replace most uses of `type_array` with `type_byte_array` in `rustc_codegen_llvm`) - #160618 (require a consistent codegen backend when -Zllvm-target-feature is present) - #161950 (Ensure floats are returned losslessly by the C ABI on 32-bit x86) - #162267 (Fix an edge within `std::fs::create_dir_all` for certain platforms that views trailing cur dir components as a separate missing directory components) - #164043 (alloc: Unstably add `Vec::repeat` and `Vec::repeat_in`) - #164808 (asm const ptr: move name generation to asm-specific logic) - #164823 (Use `DerefMut` and `IndexMut` before `&raw mut` autoborrow) - #165568 (rustdoc: Suggest corrections for reference label typos) - #165641 (Treat all proc macro dependencies as host dependencies in bootstrap) - #165924 (rustc_codegen_gcc subtree update 2026-11-13) - #165927 (Remove `const_struct` from `rustc_codegen_ssa`) - #163696 (Stabilize `int_from_ascii`) - #163882 (docs(vec): clarify into_boxed_slice allocation guarantee) - #164362 (Emit note for `non_exhaustive` within defining crate for `unreachable_patterns`) - #164465 (Under `guard_patterns` allow parenthesized guarded patterns in match arms) - #164997 (Fix as str suggestion in subpattern) - #165825 (make `Complex<x87_f80>` ABI-compatible with C) - #165868 (Small changes to dyn compatibility) - #165879 (Add `#[rustc_test_entrypoint_marker]` back !) - #165902 (Add allocator() to vec_deque::IntoIter and vec_deque::Drain) - #165903 (Fix borrowck ICE when a borrow outlives a local in a const block) - #165914 (Use `trim_prefix` in bootstrap) - #165919 (tests: accept better behavior on underaligned accesses) Failed merges: - #165893 (Prune un/under used methods of `ast::Attribute`)
Rollup merge of #164043 - Gelbpunkt:from-elem-in, r=nia-e alloc: Unstably add `Vec::repeat` and `Vec::repeat_in` Tracking issue: #164215 We also forward the existing `std::vec::from_elem_global` to `Vec::repeat`. The old module-level method `std::vec::from_elem_in` was unstable and unused, so I've removed it as per reviewer's request. [Zulip thread](https://rust-lang.zulipchat.com/#narrow/channel/197181-t-libs.2Fwg-allocators/topic/Custom.20allocators.20with.20vec.21.20and.20fallible.20allocations/with/630260935) r? @clarfonthey
…uwer Rollup of 23 pull requests Successful merges: - rust-lang/rust#165928 (Replace most uses of `type_array` with `type_byte_array` in `rustc_codegen_llvm`) - rust-lang/rust#160618 (require a consistent codegen backend when -Zllvm-target-feature is present) - rust-lang/rust#161950 (Ensure floats are returned losslessly by the C ABI on 32-bit x86) - rust-lang/rust#162267 (Fix an edge within `std::fs::create_dir_all` for certain platforms that views trailing cur dir components as a separate missing directory components) - rust-lang/rust#164043 (alloc: Unstably add `Vec::repeat` and `Vec::repeat_in`) - rust-lang/rust#164808 (asm const ptr: move name generation to asm-specific logic) - rust-lang/rust#164823 (Use `DerefMut` and `IndexMut` before `&raw mut` autoborrow) - rust-lang/rust#165568 (rustdoc: Suggest corrections for reference label typos) - rust-lang/rust#165641 (Treat all proc macro dependencies as host dependencies in bootstrap) - rust-lang/rust#165924 (rustc_codegen_gcc subtree update 2026-11-13) - rust-lang/rust#165927 (Remove `const_struct` from `rustc_codegen_ssa`) - rust-lang/rust#163696 (Stabilize `int_from_ascii`) - rust-lang/rust#163882 (docs(vec): clarify into_boxed_slice allocation guarantee) - rust-lang/rust#164362 (Emit note for `non_exhaustive` within defining crate for `unreachable_patterns`) - rust-lang/rust#164465 (Under `guard_patterns` allow parenthesized guarded patterns in match arms) - rust-lang/rust#164997 (Fix as str suggestion in subpattern) - rust-lang/rust#165825 (make `Complex<x87_f80>` ABI-compatible with C) - rust-lang/rust#165868 (Small changes to dyn compatibility) - rust-lang/rust#165879 (Add `#[rustc_test_entrypoint_marker]` back !) - rust-lang/rust#165902 (Add allocator() to vec_deque::IntoIter and vec_deque::Drain) - rust-lang/rust#165903 (Fix borrowck ICE when a borrow outlives a local in a const block) - rust-lang/rust#165914 (Use `trim_prefix` in bootstrap) - rust-lang/rust#165919 (tests: accept better behavior on underaligned accesses) Failed merges: - rust-lang/rust#165893 (Prune un/under used methods of `ast::Attribute`)
View all comments
Tracking issue: #164215
We also forward the existing
std::vec::from_elem_globaltoVec::repeat. The old module-level methodstd::vec::from_elem_inwas unstable and unused, so I've removed it as per reviewer's request.Zulip thread
r? @clarfonthey