Commit ba2e892
authored
Auto merge of #37447 - estebank:non-duplicate-definition-error, r=nrc
Show one error for duplicated type definitions
For the following code:
``` rustc
struct Bar;
struct Bar;
fn main () {
}
```
show
``` nocode
error[E0428]: a type named `Bar` has already been defined in this module
--> src/test/compile-fail/E0428.rs:12:1
|
11 | struct Bar;
| ----------- previous definition of `Bar` here
12 | struct Bar;
| ^^^^^^^^^^^
error: aborting due to previous error
```
instead of
``` nocode
error[E0428]: a type named `Bar` has already been defined in this module
--> src/test/compile-fail/E0428.rs:12:1
|
11 | struct Bar;
| ----------- previous definition of `Bar` here
12 | struct Bar;
| ^^^^^^^^^^^
error[E0428]: a value named `Bar` has already been defined in this module
--> src/test/compile-fail/E0428.rs:12:1
|
11 | struct Bar;
| ----------- previous definition of `Bar` here
12 | struct Bar;
| ^^^^^^^^^^^
error: aborting due to 2 previous errors
```
Fixes #35767.File tree
5 files changed
+14
-13
lines changed- src
- librustc_resolve
- test/compile-fail
5 files changed
+14
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1118 | 1118 | | |
1119 | 1119 | | |
1120 | 1120 | | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
1121 | 1124 | | |
1122 | 1125 | | |
1123 | 1126 | | |
| |||
1310 | 1313 | | |
1311 | 1314 | | |
1312 | 1315 | | |
| 1316 | + | |
1313 | 1317 | | |
1314 | 1318 | | |
1315 | 1319 | | |
| |||
3396 | 3400 | | |
3397 | 3401 | | |
3398 | 3402 | | |
3399 | | - | |
| 3403 | + | |
3400 | 3404 | | |
3401 | 3405 | | |
3402 | 3406 | | |
| |||
3420 | 3424 | | |
3421 | 3425 | | |
3422 | 3426 | | |
| 3427 | + | |
| 3428 | + | |
| 3429 | + | |
| 3430 | + | |
| 3431 | + | |
| 3432 | + | |
| 3433 | + | |
3423 | 3434 | | |
3424 | 3435 | | |
3425 | 3436 | | |
| |||
3472 | 3483 | | |
3473 | 3484 | | |
3474 | 3485 | | |
| 3486 | + | |
3475 | 3487 | | |
3476 | 3488 | | |
3477 | 3489 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | 12 | | |
14 | 13 | | |
15 | | - | |
16 | | - | |
17 | 14 | | |
18 | 15 | | |
19 | 16 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | | - | |
| 17 | + | |
19 | 18 | | |
20 | 19 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | 15 | | |
17 | 16 | | |
18 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
37 | 36 | | |
38 | | - | |
39 | | - | |
40 | 37 | | |
41 | 38 | | |
42 | 39 | | |
43 | | - | |
44 | 40 | | |
45 | | - | |
46 | | - | |
47 | 41 | | |
48 | 42 | | |
49 | 43 | | |
0 commit comments