Commit 8a4f8e6
authored
Rollup merge of rust-lang#58381 - davidtwco:issue-42944, r=estebank
Only suggest imports if not imported.
Fixes rust-lang#42944 and fixes rust-lang#53430.
This commit modifies name resolution error reporting so that if a name
is in scope and has been imported then we do not suggest importing it.
This can occur when we add a label about constructors not being visible
due to private fields. In these cases, we know that the struct/variant
has been imported and we should silence any suggestions to import the
struct/variant.
r? @estebankFile tree
5 files changed
+63
-17
lines changed- src
- librustc_resolve
- test/ui
- resolve
5 files changed
+63
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
109 | | - | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
110 | 118 | | |
111 | 119 | | |
112 | 120 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
| 95 | + | |
95 | 96 | | |
96 | 97 | | |
97 | 98 | | |
| |||
4391 | 4392 | | |
4392 | 4393 | | |
4393 | 4394 | | |
4394 | | - | |
| 4395 | + | |
| 4396 | + | |
4395 | 4397 | | |
4396 | 4398 | | |
4397 | 4399 | | |
| |||
4415 | 4417 | | |
4416 | 4418 | | |
4417 | 4419 | | |
4418 | | - | |
| 4420 | + | |
| 4421 | + | |
| 4422 | + | |
| 4423 | + | |
| 4424 | + | |
| 4425 | + | |
4419 | 4426 | | |
4420 | 4427 | | |
4421 | 4428 | | |
| |||
4512 | 4519 | | |
4513 | 4520 | | |
4514 | 4521 | | |
4515 | | - | |
| 4522 | + | |
| 4523 | + | |
4516 | 4524 | | |
4517 | 4525 | | |
4518 | 4526 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | 5 | | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
14 | 9 | | |
15 | 10 | | |
16 | 11 | | |
17 | 12 | | |
18 | 13 | | |
19 | 14 | | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | 15 | | |
25 | 16 | | |
26 | 17 | | |
| |||
0 commit comments