This commit is contained in:
Tshepang Mbambo 2023-09-08 12:57:33 +02:00
parent a5e35dd106
commit c8113266c7
1 changed files with 1 additions and 1 deletions

View File

@ -64,7 +64,7 @@ button on the top:
[sample-play]: https://play.rust-lang.org/?gist=30074856e62e74e91f06abd19bd72ece&version=stable [sample-play]: https://play.rust-lang.org/?gist=30074856e62e74e91f06abd19bd72ece&version=stable
MIR shown by above link is optimized. MIR shown by above link is optimized.
Some statements like `StorageLive` are removed in optimization. Some statements like `StorageLive` are removed in optimization.
This happens because compiler notices the value is never acessed in the code. This happens because compiler notices the value is never accessed in the code.
We can use `rustc [filename].rs -Z mir-opt-level=0 --emit mir` to view unoptimized MIR. We can use `rustc [filename].rs -Z mir-opt-level=0 --emit mir` to view unoptimized MIR.
This requires the nightly toolchain. This requires the nightly toolchain.