Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 8b42eb5

Browse files
mejrstshepang
mejrs
authored andcommittedDec 17, 2022
Apply feedback
1 parent a213de4 commit 8b42eb5

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed
 

‎src/compiler-debugging.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ fn main() {
128128
}
129129
```
130130

131-
```bash
131+
```
132132
$ rustc +stage1 error.rs
133133
error[E0277]: cannot add `()` to `{integer}`
134134
--> error.rs:2:7
@@ -143,7 +143,7 @@ error: aborting due to previous error
143143

144144
Now, where does the error above come from?
145145

146-
```bash
146+
```
147147
$ RUST_BACKTRACE=1 rustc +stage1 error.rs -Z treat-err-as-bug
148148
error[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]`
191191
for this and prints its location alongside the error:
192192

193-
```bash
193+
```
194194
$ RUST_BACKTRACE=1 rustc +stage1 error.rs -Z track-diagnostics
195195
error[E0277]: cannot add `()` to `{integer}`
196196
--> src\error.rs:2:7

‎src/diagnostics.md

+1-1
Original file line numberDiff line numberDiff 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

293293
The regular development practices apply: judicious use of `debug!()` statements

0 commit comments

Comments
 (0)
Please sign in to comment.