-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Commit 65a846a
Rollup merge of #145967 - Enselic:big-enum-debuginfo-span, r=wesleywiser
compiler: Include span of too huge enum with `-Cdebuginfo=2`
We have the ui test `tests/ui/limits/huge-enum.rs` to ensure we emit an error if we encounter too big enums. Before this fix, compiling the test with `-Cdebuginfo=2` would not include the span of the instantiation site, because the error is then emitted from a different code path that does not include the span.
Propagate the span to the error also in the debuginfo case, so the test passes regardless of debuginfo level. I'm sure we can propagate spans in more places, but let's start small.
## Test failure without the fix
Here is what the failure looks like if you run the test without the fix:
```
[ui] tests/ui/limits/huge-enum.rs#full-debuginfo ... F
.
failures:
---- [ui] tests/ui/limits/huge-enum.rs#full-debuginfo stdout ----
Saved the actual stderr to `/home/martin/src/rust/build/x86_64-unknown-linux-gnu/test/ui/limits/huge-enum.full-debuginfo/huge-enum.full-debuginfo.stderr`
diff of stderr:
1 error: values of the type `Option<TYPE>` are too big for the target architecture
- --> $DIR/huge-enum.rs:17:9
- |
- LL | let big: BIG = None;
- | ^^^
6
7 error: aborting due to 1 previous error
8
The actual stderr differed from the expected stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args limits/huge-enum.rs`
```
as can be seen, the `span` used to be missing with `debuginfo=2`.
## See also
This is one small step towards resolving #61117.
cc #144499 which began running UI tests with `rust.debuginfo-level-tests=1`. This PR is part of preparing for increasing that to debuglevel 2.File tree
6 files changed
+33
-10
lines changed- compiler/rustc_codegen_llvm/src/debuginfo
- metadata/enums
- tests/ui/limits
6 files changed
+33
-10
lines changedLines changed: 12 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
19 | 19 |
| |
20 | 20 |
| |
21 | 21 |
| |
22 | - | ||
22 | + | ||
23 | + | ||
24 | + | ||
23 | 25 |
| |
24 | 26 |
| |
25 | 27 |
| |
| |||
423 | 425 |
| |
424 | 426 |
| |
425 | 427 |
| |
428 | + | ||
429 | + | ||
430 | + | ||
431 | + | ||
432 | + | ||
433 | + | ||
434 | + | ||
435 | + | ||
426 | 436 |
| |
427 | 437 |
| |
428 | 438 |
| |
| |||
460 | 470 |
| |
461 | 471 |
| |
462 | 472 |
| |
463 | - | ||
473 | + | ||
464 | 474 |
| |
465 | 475 |
| |
466 | 476 |
| |
|
Lines changed: 3 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
10 | 10 |
| |
11 | 11 |
| |
12 | 12 |
| |
13 | - | ||
13 | + | ||
14 | 14 |
| |
15 | 15 |
| |
16 | 16 |
| |
| |||
30 | 30 |
| |
31 | 31 |
| |
32 | 32 |
| |
33 | + | ||
33 | 34 |
| |
34 | 35 |
| |
35 | 36 |
| |
36 | 37 |
| |
37 | 38 |
| |
38 | 39 |
| |
39 | - | ||
40 | + | ||
40 | 41 |
| |
41 | 42 |
| |
42 | 43 |
| |
|
Lines changed: 4 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
28 | 28 |
| |
29 | 29 |
| |
30 | 30 |
| |
31 | - | ||
31 | + | ||
32 | + | ||
33 | + | ||
32 | 34 |
| |
33 | 35 |
| |
34 | 36 |
| |
| |||
626 | 628 |
| |
627 | 629 |
| |
628 | 630 |
| |
629 | - | ||
631 | + | ||
630 | 632 |
| |
631 | 633 |
| |
632 | 634 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 | - | ||
2 | + | ||
3 | 3 |
| |
4 | 4 |
| |
5 | 5 |
| |
|
Lines changed: 8 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | + | ||
2 | + | ||
3 | + | ||
4 | + | ||
5 | + | ||
6 | + | ||
7 | + | ||
8 | + |
Lines changed: 5 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | + | ||
2 | + | ||
3 | + | ||
1 | 4 |
| |
2 | 5 |
| |
3 | 6 |
| |
4 | - | ||
5 | - | ||
6 | - | ||
7 | + | ||
8 | + | ||
7 | 9 |
| |
8 | 10 |
| |
9 | 11 |
| |
|
0 commit comments