Commit ee5d8d3
committed
Auto merge of rust-lang#90986 - camsteffen:nested-filter, r=cjgillot
Replace `NestedVisitorMap` with generic `NestedFilter`
This is an attempt to make the `intravisit::Visitor` API simpler and "more const" with regard to nested visiting.
With this change, `intravisit::Visitor` does not visit nested things by default, unless you specify `type NestedFilter = nested_filter::OnlyBodies` (or `All`). `nested_visit_map` returns `Self::Map` instead of `NestedVisitorMap<Self::Map>`. It panics by default (unreachable if `type NestedFilter` is omitted).
One somewhat trixty thing here is that `nested_filter::{OnlyBodies, All}` live in `rustc_middle` so that they may have `type Map = map::Map` and so that `impl Visitor`s never need to specify `type Map` - it has a default of `Self::NestedFilter::Map`.File tree
110 files changed
+387
-946
lines changed- compiler
- rustc_ast_lowering/src
- rustc_hir/src
- rustc_incremental/src
- persist
- rustc_infer/src/infer/error_reporting
- nice_region_error
- rustc_lint/src
- rustc_metadata/src/rmeta
- rustc_middle/src
- hir
- map
- ty
- rustc_mir_build/src/thir/pattern
- rustc_mir_transform/src
- rustc_passes/src
- rustc_privacy/src
- rustc_resolve/src/late
- rustc_save_analysis/src
- rustc_trait_selection/src/traits/error_reporting
- rustc_typeck/src
- check
- collect
- src
- librustdoc
- html/render
- tools/clippy
- clippy_lints/src
- functions
- loops
- methods
- types
- utils
- internal_lints
- clippy_utils/src
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
110 files changed
+387
-946
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
104 | | - | |
105 | | - | |
106 | 104 | | |
107 | 105 | | |
108 | 106 | | |
109 | 107 | | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | 108 | | |
115 | 109 | | |
116 | 110 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2436 | 2436 | | |
2437 | 2437 | | |
2438 | 2438 | | |
2439 | | - | |
2440 | | - | |
2441 | | - | |
2442 | | - | |
2443 | | - | |
2444 | | - | |
2445 | 2439 | | |
2446 | 2440 | | |
2447 | 2441 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
163 | | - | |
164 | | - | |
165 | | - | |
| 163 | + | |
| 164 | + | |
166 | 165 | | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
185 | 182 | | |
186 | | - | |
187 | 183 | | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | 184 | | |
197 | 185 | | |
198 | 186 | | |
199 | 187 | | |
200 | 188 | | |
201 | 189 | | |
202 | 190 | | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
241 | 196 | | |
242 | 197 | | |
243 | 198 | | |
| 199 | + | |
| 200 | + | |
244 | 201 | | |
245 | 202 | | |
246 | 203 | | |
| |||
258 | 215 | | |
259 | 216 | | |
260 | 217 | | |
261 | | - | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
262 | 221 | | |
263 | 222 | | |
264 | 223 | | |
| |||
279 | 238 | | |
280 | 239 | | |
281 | 240 | | |
282 | | - | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
283 | 247 | | |
284 | 248 | | |
285 | 249 | | |
| |||
290 | 254 | | |
291 | 255 | | |
292 | 256 | | |
293 | | - | |
294 | | - | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
295 | 261 | | |
296 | 262 | | |
297 | 263 | | |
298 | 264 | | |
299 | 265 | | |
300 | 266 | | |
301 | | - | |
302 | | - | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
303 | 271 | | |
304 | 272 | | |
305 | 273 | | |
306 | 274 | | |
307 | 275 | | |
308 | 276 | | |
309 | | - | |
310 | | - | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
311 | 281 | | |
312 | 282 | | |
313 | 283 | | |
314 | 284 | | |
315 | 285 | | |
316 | 286 | | |
317 | | - | |
318 | | - | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
319 | 291 | | |
320 | 292 | | |
321 | 293 | | |
322 | 294 | | |
323 | 295 | | |
324 | 296 | | |
325 | 297 | | |
326 | | - | |
327 | | - | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
328 | 302 | | |
329 | 303 | | |
330 | 304 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| |||
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
176 | | - | |
| 176 | + | |
177 | 177 | | |
178 | | - | |
179 | | - | |
| 178 | + | |
| 179 | + | |
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
472 | 472 | | |
473 | 473 | | |
474 | 474 | | |
475 | | - | |
| 475 | + | |
476 | 476 | | |
477 | | - | |
478 | | - | |
| 477 | + | |
| 478 | + | |
479 | 479 | | |
480 | 480 | | |
481 | 481 | | |
| |||
Lines changed: 5 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
| 86 | + | |
87 | 87 | | |
88 | | - | |
89 | | - | |
| 88 | + | |
| 89 | + | |
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| |||
Lines changed: 8 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
84 | 85 | | |
85 | 86 | | |
86 | 87 | | |
87 | | - | |
| 88 | + | |
88 | 89 | | |
89 | | - | |
90 | | - | |
| 90 | + | |
| 91 | + | |
91 | 92 | | |
92 | 93 | | |
93 | 94 | | |
| |||
208 | 209 | | |
209 | 210 | | |
210 | 211 | | |
211 | | - | |
| 212 | + | |
212 | 213 | | |
213 | | - | |
214 | | - | |
| 214 | + | |
| 215 | + | |
215 | 216 | | |
216 | 217 | | |
217 | 218 | | |
| |||
Lines changed: 1 addition & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
575 | 575 | | |
576 | 576 | | |
577 | 577 | | |
578 | | - | |
579 | | - | |
580 | | - | |
581 | | - | |
582 | | - | |
583 | | - | |
584 | 578 | | |
585 | 579 | | |
586 | 580 | | |
| |||
0 commit comments