Skip to content

Commit a0c422a

Browse files
committed
Remove a now-unnecessary paragraph.
The paragraph described a case where we can't optimize away repetitive dynamic stack allocation. However, as arielb1 pointed out, it can actually optimizable by dynamically delaying the stack unwinding.
1 parent 438edc3 commit a0c422a

File tree

1 file changed

+0
-19
lines changed

1 file changed

+0
-19
lines changed

src/doc/unstable-book/src/language-features/unsized-locals.md

-19
Original file line numberDiff line numberDiff line change
@@ -178,22 +178,3 @@ fn main() {
178178
```
179179

180180
will unnecessarily extend the stack frame.
181-
182-
Allocation will be improved in the future, but there are still examples that are difficult to optimize:
183-
184-
```rust
185-
#![feature(unsized_locals)]
186-
187-
fn main() {
188-
let mut counter = 10;
189-
let x = loop {
190-
let x: Box<[i32]> = Box::new([1, 2, 3, 4, 5]);
191-
let x = *x;
192-
if counter > 0 {
193-
counter -= 1;
194-
} else {
195-
break x;
196-
}
197-
};
198-
}
199-
```

0 commit comments

Comments
 (0)