-
Notifications
You must be signed in to change notification settings - Fork 13.8k
Commit 3944c8c
authored
Rollup merge of #143264 - Muscraft:fix-suggestion-filename, r=compiler-errors
fix: Emit suggestion filename if primary diagnostic span is dummy
While working on using `annotate-snippets` as `rustc`'s emitter, I came across [`tests/ui/resolve/resolve-conflict-extern-crate-vs-extern-crate.stderr`](https://github.com/rust-lang/rust/blob/b03b3a7ec92682be2917540b679478d41c95a30c/tests/ui/resolve/resolve-conflict-extern-crate-vs-extern-crate.stderr), which lacked a filename for both the annotation and the suggestion, which seemed like a bug to me. After some investigation, I found that this is happening because the primary span is a dummy, so its filename doesn't get output, and its filename matches the one for the suggestion, so the suggestion's filename doesn't get output. To fix this issue, I made it so that the filename for a suggestion will get output if the primary span is a dummy.File tree
2 files changed
+4
-1
lines changed- compiler/rustc_errors/src
- tests/ui/resolve
2 files changed
+4
-1
lines changedOriginal file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2078 | 2078 |
| |
2079 | 2079 |
| |
2080 | 2080 |
| |
2081 | - | ||
2081 | + | ||
2082 | + | ||
2083 | + | ||
2082 | 2084 |
| |
2083 | 2085 |
| |
2084 | 2086 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2 | 2 |
| |
3 | 3 |
| |
4 | 4 |
| |
5 | + | ||
5 | 6 |
| |
6 | 7 |
| |
7 | 8 |
| |
|
0 commit comments