Move example code block to paragraph referencing it
Noticed by Mario Carneiro.
This commit is contained in:
parent
cb22326fae
commit
23bf5eca80
|
|
@ -62,12 +62,6 @@ show you the MIR for your program. Try putting this program into play
|
||||||
button on the top:
|
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.
|
|
||||||
Some statements like `StorageLive` are removed in optimization.
|
|
||||||
This happens because the 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.
|
|
||||||
This requires the nightly toolchain.
|
|
||||||
|
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
fn main() {
|
fn main() {
|
||||||
|
|
@ -88,6 +82,12 @@ fn main() -> () {
|
||||||
```
|
```
|
||||||
|
|
||||||
This is the MIR format for the `main` function.
|
This is the MIR format for the `main` function.
|
||||||
|
MIR shown by above link is optimized.
|
||||||
|
Some statements like `StorageLive` are removed in optimization.
|
||||||
|
This happens because the 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.
|
||||||
|
This requires the nightly toolchain.
|
||||||
|
|
||||||
|
|
||||||
**Variable declarations.** If we drill in a bit, we'll see it begins
|
**Variable declarations.** If we drill in a bit, we'll see it begins
|
||||||
with a bunch of variable declarations. They look like this:
|
with a bunch of variable declarations. They look like this:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue