diff options
| author | Noah Lev <camelidcamel@gmail.com> | 2024-05-29 11:40:50 -0700 |
|---|---|---|
| committer | nora <48135649+Noratrieb@users.noreply.github.com> | 2024-09-24 20:15:12 +0200 |
| commit | e16f3f9af0121ef331aea93e029186dd75d262eb (patch) | |
| tree | 6529e18997e5bfe7bc8ecc1cc1d2a7f128a10320 /src/doc/rustc-dev-guide | |
| parent | df325c188f4769acc57e4f5f030d7905a4dbcfba (diff) | |
| download | rust-e16f3f9af0121ef331aea93e029186dd75d262eb.tar.gz rust-e16f3f9af0121ef331aea93e029186dd75d262eb.zip | |
Move example code block to paragraph referencing it
Noticed by Mario Carneiro.
Diffstat (limited to 'src/doc/rustc-dev-guide')
| -rw-r--r-- | src/doc/rustc-dev-guide/src/mir/index.md | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/doc/rustc-dev-guide/src/mir/index.md b/src/doc/rustc-dev-guide/src/mir/index.md index 19b1412c531..44f675391e8 100644 --- a/src/doc/rustc-dev-guide/src/mir/index.md +++ b/src/doc/rustc-dev-guide/src/mir/index.md @@ -62,12 +62,6 @@ show you the MIR for your program. Try putting this program into play button on the top: [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 fn main() { @@ -88,6 +82,12 @@ fn main() -> () { ``` 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 with a bunch of variable declarations. They look like this: |
