This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree 2 files changed +4
-4
lines changed
src/doc/rustc-dev-guide/src 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -128,7 +128,7 @@ fn main() {
128
128
}
129
129
```
130
130
131
- ``` bash
131
+ ```
132
132
$ rustc +stage1 error.rs
133
133
error[E0277]: cannot add `()` to `{integer}`
134
134
--> error.rs:2:7
@@ -143,7 +143,7 @@ error: aborting due to previous error
143
143
144
144
Now, where does the error above come from?
145
145
146
- ` ` ` bash
146
+ ```
147
147
$ RUST_BACKTRACE=1 rustc +stage1 error.rs -Z treat-err-as-bug
148
148
error[E0277]: the trait bound `{integer}: std::ops::Add<()>` is not satisfied
149
149
--> error.rs:2:7
@@ -190,7 +190,7 @@ Cool, now I have a backtrace for the error!
190
190
` -Z track-diagnostics ` can help figure out where errors are emitted. It uses ` #[track_caller] `
191
191
for this and prints its location alongside the error:
192
192
193
- ` ` ` bash
193
+ ```
194
194
$ RUST_BACKTRACE=1 rustc +stage1 error.rs -Z track-diagnostics
195
195
error[E0277]: cannot add `()` to `{integer}`
196
196
--> 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:
287
287
- The _ construction_ of the error is far away from where it is _ emitted_ ,
288
288
a problem similar to the one we faced with the ` grep ` approach.
289
289
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
291
291
locations alongside the error.
292
292
293
293
The regular development practices apply: judicious use of ` debug!() ` statements
You can’t perform that action at this time.
0 commit comments