]> git.lizzy.rs Git - rust.git/commitdiff
Remove a now-unnecessary paragraph.
authorMasaki Hara <ackie.h.gmai@gmail.com>
Thu, 12 Jul 2018 11:27:10 +0000 (20:27 +0900)
committerMasaki Hara <ackie.h.gmai@gmail.com>
Sat, 18 Aug 2018 23:07:33 +0000 (08:07 +0900)
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.

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

index f779edc89e7d25ab5f133a715b076b6171d342eb..7a5fe5b7f28cdfc153c7f961389e7c9e4438daf4 100644 (file)
@@ -178,22 +178,3 @@ fn main() {
 ```
 
 will unnecessarily extend the stack frame.
-
-Allocation will be improved in the future, but there are still examples that are difficult to optimize:
-
-```rust
-#![feature(unsized_locals)]
-
-fn main() {
-    let mut counter = 10;
-    let x = loop {
-        let x: Box<[i32]> = Box::new([1, 2, 3, 4, 5]);
-        let x = *x;
-        if counter > 0 {
-            counter -= 1;
-        } else {
-            break x;
-        }
-    };
-}
-```