File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -128,7 +128,7 @@ fn main() {
128128}
129129```
130130
131- ``` bash
131+ ```
132132$ rustc +stage1 error.rs
133133error[E0277]: cannot add `()` to `{integer}`
134134 --> error.rs:2:7
@@ -143,7 +143,7 @@ error: aborting due to previous error
143143
144144Now, where does the error above come from?
145145
146- ` ` ` bash
146+ ```
147147$ RUST_BACKTRACE=1 rustc +stage1 error.rs -Z treat-err-as-bug
148148error[E0277]: the trait bound `{integer}: std::ops::Add<()>` is not satisfied
149149 --> error.rs:2:7
@@ -190,7 +190,7 @@ Cool, now I have a backtrace for the error!
190190` -Z track-diagnostics ` can help figure out where errors are emitted. It uses ` #[track_caller] `
191191for this and prints its location alongside the error:
192192
193- ` ` ` bash
193+ ```
194194$ RUST_BACKTRACE=1 rustc +stage1 error.rs -Z track-diagnostics
195195error[E0277]: cannot add `()` to `{integer}`
196196 --> src\error.rs:2:7
Original file line number Diff line number Diff line change @@ -287,7 +287,7 @@ There are three main ways to find where a given error is emitted:
287287 - The _ construction_ of the error is far away from where it is _ emitted_ ,
288288 a problem similar to the one we faced with the ` grep ` approach.
289289 In some cases, we buffer multiple errors in order to emit them in order.
290- - Invoking ` rustc ` with the nightly-only flag ` -Z track-diagnostics ` will print error creation
290+ - Invoking ` rustc ` with ` -Z track-diagnostics ` will print error creation
291291 locations alongside the error.
292292
293293The regular development practices apply: judicious use of ` debug!() ` statements
You can’t perform that action at this time.
0 commit comments