Skip to content

Commit c4c9fe2

Browse files
authoredSep 8, 2023
Update index.md
1 parent 6a4420a commit c4c9fe2

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed
 

‎src/mir/index.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,13 @@ 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 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.
65+
MIR shown by above link is optimized.
66+
Some statements like `StorageLive` are removed in optimization.
67+
This happens because compiler notices the value is never acessed in the code.
68+
We can use `rustc [filename].rs -Z mir-opt-level=0 --emit mir` to view unoptimized MIR.
69+
This requires the nightly toolchain.
70+
6671

67-
```
6872
```rust
6973
fn main() {
7074
let mut vec = Vec::new();

0 commit comments

Comments
 (0)