Skip to content

Commit 6a4420a

Browse files
Update index.md
1 parent 54da525 commit 6a4420a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/mir/index.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ show you the MIR for your program. Try putting this program into play
6262
button on the top:
6363

6464
[sample-play]: https://play.rust-lang.org/?gist=30074856e62e74e91f06abd19bd72ece&version=stable
65-
MIR shown by link is missing some statements for unoptimized MIR use `-Z mir-opt-level=0 --emit mir`
65+
MIR shown by above link is optimized. The compiler removes some statements in optimization like `StorageLive`. This happens because compiler notices the value is never acessed in the code. We can use `rustc [filename].rs -Z mir-opt-level=0 --emit mir` to view unoptimized MIR. This requires nightly toolchain.
66+
67+
```
6668
```rust
6769
fn main() {
6870
let mut vec = Vec::new();

0 commit comments

Comments
 (0)