about summary refs log tree commit diff
path: root/library/alloc/src/lib.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-11-28 12:22:16 +0000
committerbors <bors@rust-lang.org>2023-11-28 12:22:16 +0000
commitdf0295f07175acc7325ce3ca4152eb05752af1f2 (patch)
tree664b294535398b82283c0edcf032b7f46c11b950 /library/alloc/src/lib.rs
parent46a24ed2f4b4bdfccca36fb20b1574a6164893d8 (diff)
parent072b51cbb5b4ee39ae433b5f92a5952054e6caf3 (diff)
downloadrust-df0295f07175acc7325ce3ca4152eb05752af1f2.tar.gz
rust-df0295f07175acc7325ce3ca4152eb05752af1f2.zip
Auto merge of #110353 - the8472:in-place-flatten-chunks, r=cuviper
Expand in-place iteration specialization to Flatten, FlatMap and ArrayChunks

This enables the following cases to collect in-place:

```rust
let v = vec![[0u8; 4]; 1024]
let v: Vec<_> = v.into_iter().flatten().collect();

let v: Vec<Option<NonZeroUsize>> = vec![NonZeroUsize::new(0); 1024];
let v: Vec<_> = v.into_iter().flatten().collect();

let v = vec![u8; 4096];
let v: Vec<_> = v.into_iter().array_chunks::<4>().collect();
```

Especially the nicheful-option-flattening should be useful in real code.
Diffstat (limited to 'library/alloc/src/lib.rs')
-rw-r--r--library/alloc/src/lib.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/library/alloc/src/lib.rs b/library/alloc/src/lib.rs
index 59b2433ca74..0af3ac38ee5 100644
--- a/library/alloc/src/lib.rs
+++ b/library/alloc/src/lib.rs
@@ -154,6 +154,7 @@
 #![feature(std_internals)]
 #![feature(str_internals)]
 #![feature(strict_provenance)]
+#![feature(trusted_fused)]
 #![feature(trusted_len)]
 #![feature(trusted_random_access)]
 #![feature(try_trait_v2)]