This repository was archived by the owner on May 28, 2025. It is now read-only.
Commit 56a59ea
authored
Unrolled build for rust-lang#126040
Rollup merge of rust-lang#126040 - Urgau:unreachable_pub-fields-less, r=petrochenkov
Don't warn on fields in the `unreachable_pub` lint
This PR restrict the `unreachable_pub` lint by not linting on `pub` fields of `pub(restricted)` structs and unions. This is done because that can quickly clutter the code for an uncertain value, in particular since the "real" visibility is defined by the parent (the struct it-self).
This is meant to address one of the last concern of the `unreachable_pub` lint.
r? ``@petrochenkov``File tree
3 files changed
+34
-29
lines changed- compiler/rustc_lint/src
- tests/ui/lint
3 files changed
+34
-29
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
| 54 | + | |
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| |||
1423 | 1423 | | |
1424 | 1424 | | |
1425 | 1425 | | |
1426 | | - | |
1427 | | - | |
1428 | | - | |
1429 | | - | |
1430 | | - | |
| 1426 | + | |
| 1427 | + | |
| 1428 | + | |
| 1429 | + | |
| 1430 | + | |
| 1431 | + | |
| 1432 | + | |
| 1433 | + | |
| 1434 | + | |
| 1435 | + | |
| 1436 | + | |
| 1437 | + | |
| 1438 | + | |
| 1439 | + | |
1431 | 1440 | | |
1432 | 1441 | | |
1433 | 1442 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | | - | |
14 | | - | |
15 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
18 | 22 | | |
19 | 23 | | |
20 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | 36 | | |
45 | | - | |
| 37 | + | |
46 | 38 | | |
47 | 39 | | |
48 | 40 | | |
49 | 41 | | |
50 | 42 | | |
51 | 43 | | |
52 | 44 | | |
53 | | - | |
| 45 | + | |
54 | 46 | | |
55 | 47 | | |
56 | 48 | | |
| |||
60 | 52 | | |
61 | 53 | | |
62 | 54 | | |
63 | | - | |
| 55 | + | |
64 | 56 | | |
65 | 57 | | |
66 | 58 | | |
| |||
70 | 62 | | |
71 | 63 | | |
72 | 64 | | |
73 | | - | |
| 65 | + | |
74 | 66 | | |
75 | 67 | | |
76 | 68 | | |
| |||
80 | 72 | | |
81 | 73 | | |
82 | 74 | | |
83 | | - | |
| 75 | + | |
84 | 76 | | |
85 | 77 | | |
86 | 78 | | |
| |||
90 | 82 | | |
91 | 83 | | |
92 | 84 | | |
93 | | - | |
| 85 | + | |
94 | 86 | | |
95 | 87 | | |
96 | 88 | | |
| |||
100 | 92 | | |
101 | 93 | | |
102 | 94 | | |
103 | | - | |
| 95 | + | |
104 | 96 | | |
105 | 97 | | |
106 | 98 | | |
| |||
110 | 102 | | |
111 | 103 | | |
112 | 104 | | |
113 | | - | |
| 105 | + | |
114 | 106 | | |
115 | 107 | | |
116 | 108 | | |
| |||
120 | 112 | | |
121 | 113 | | |
122 | 114 | | |
123 | | - | |
| 115 | + | |
124 | 116 | | |
125 | 117 | | |
126 | 118 | | |
| |||
135 | 127 | | |
136 | 128 | | |
137 | 129 | | |
138 | | - | |
| 130 | + | |
139 | 131 | | |
140 | 132 | | |
141 | 133 | | |
| |||
144 | 136 | | |
145 | 137 | | |
146 | 138 | | |
147 | | - | |
| 139 | + | |
148 | 140 | | |
0 commit comments