@@ -82,28 +82,31 @@ For example:
8282
8383``` bash
8484$ cat error.rs
85+ ```
86+
87+ ``` rust
8588fn main () {
8689 1 + ();
8790}
8891```
8992
9093``` bash
91- $ ./build/x86_64-unknown-linux-gnu/stage1/bin/ rustc error.rs
92- error[E0277]: the trait bound ` {integer}: std::ops::Add< () > ` is not satisfied
94+ $ rustc +stage1 error.rs
95+ error[E0277]: cannot add ` () ` to ` {integer} `
9396 --> error.rs:2:7
9497 |
95- 2 | 1 + ();
96- | ^ no implementation for ` {integer} + ()`
98+ 2 | 1 + ();
99+ | ^ no implementation for ` {integer} + ()`
97100 |
98- = help: the trait ` std::ops:: Add<( ) > ` is not implemented for ` {integer}`
101+ = help: the trait ` Add<( ) > ` is not implemented for ` {integer}`
99102
100103error: aborting due to previous error
104+ ` ` `
105+
106+ Now, where does the error above come from?
101107
102- $ # Now, where does the error above come from?
103- $ RUST_BACKTRACE=1 \
104- ./build/x86_64-unknown-linux-gnu/stage1/bin/rustc \
105- error.rs \
106- -Z treat-err-as-bug
108+ ` ` ` bash
109+ $ RUST_BACKTRACE=1 rustc +stage1 error.rs -Z treat-err-as-bug
107110error[E0277]: the trait bound ` {integer}: std::ops::Add< ()> ` is not satisfied
108111 --> error.rs:2:7
109112 |
@@ -140,9 +143,10 @@ stack backtrace:
140143 (~~~ IRRELEVANT PART OF BACKTRACE REMOVED BY ME ~ ~~)
141144 36: rustc_driver::run_compiler
142145 at /home/user/rust/compiler/rustc_driver/src/lib.rs:253
143- $ # Cool, now I have a backtrace for the error
144146` ` `
145147
148+ Cool, now I have a backtrace for the error!
149+
146150# # Getting logging output
147151[getting-logging-output]: # getting-logging-output
148152
@@ -180,16 +184,16 @@ So to put it together.
180184```bash
181185# This puts the output of all debug calls in `rustc_middle/src/traits` into
182186# standard error, which might fill your console backscroll.
183- $ RUSTC_LOG=rustc_middle::traits rustc +local my-file.rs
187+ $ RUSTC_LOG=rustc_middle::traits rustc +stage1 my-file.rs
184188
185189# This puts the output of all debug calls in `rustc_middle/src/traits` in
186190# `traits-log`, so you can then see it with a text editor.
187- $ RUSTC_LOG=rustc_middle::traits rustc +local my-file.rs 2>traits-log
191+ $ RUSTC_LOG=rustc_middle::traits rustc +stage1 my-file.rs 2>traits-log
188192
189193# Not recommended. This will show the output of all `debug!` calls
190194# in the Rust compiler, and there are a *lot* of them, so it will be
191195# hard to find anything.
192- $ RUSTC_LOG=debug rustc +local my-file.rs 2>all-log
196+ $ RUSTC_LOG=debug rustc +stage1 my-file.rs 2>all-log
193197
194198# This will show the output of all `info!` calls in `rustc_trans`.
195199#
@@ -198,13 +202,13 @@ $ RUSTC_LOG=debug rustc +local my-file.rs 2>all-log
198202# which function triggers an LLVM assertion, and this is an `info!`
199203# log rather than a `debug!` log so it will work on the official
200204# compilers.
201- $ RUSTC_LOG=rustc_trans=info rustc +local my-file.rs
205+ $ RUSTC_LOG=rustc_trans=info rustc +stage1 my-file.rs
202206
203207# This will show the output of all `info!` calls made by rustdoc or any rustc library it calls.
204- $ RUSTDOC_LOG=info rustdoc +local my-file.rs
208+ $ RUSTDOC_LOG=info rustdoc +stage1 my-file.rs
205209
206210# This will only show `debug!` calls made by rustdoc directly, not any `rustc*` crate.
207- $ RUSTDOC_LOG=rustdoc rustdoc +local my-file.rs
211+ $ RUSTDOC_LOG=rustdoc rustdoc +stage1 my-file.rs
208212` ` `
209213
210214# ## How to keep or remove `debug!` and `trace!` calls from the resulting binary
@@ -271,7 +275,7 @@ In addition to [graphviz output](#formatting-graphviz-output-dot-files), MIR deb
271275flags include an option to generate a MIR representation called `Spanview` that
272276uses HTML to highlight code regions in the original source code and display
273277compiler metadata associated with each region.
274- [`-Zdump -mir-spanview`](./mir/debugging.md), for example, highlights spans
278+ [`-Z dump -mir-spanview`](./mir/debugging.md), for example, highlights spans
275279associated with each MIR `Statement`, `Terminator`, and/or `BasicBlock`.
276280
277281These `.html` files use CSS features to dynamically expand spans obscured by
0 commit comments