Commit 7f97aea
committed
Auto merge of #107679 - est31:less_import_overhead, r=compiler-errors
Less import overhead for errors
This removes huge (3+ lines) import lists found in files that had their error reporting migrated. These lists are bad for developer workflows as adding, removing, or editing a single error's name might cause a chain reaction that bloats the git diff. As the error struct names are long, the likelihood of such chain reactions is high.
Follows the suggestion by `@Nilstrieb` in the [zulip thread](https://rust-lang.zulipchat.com/#narrow/stream/147480-t-compiler.2Fwg-diagnostics/topic/massive.20use.20statements) to replace the `use errors::{FooErr, BarErr};` with `use errors;` and then changing to `errors::FooErr` on the usage sites.
I have used sed to do most of the changes, i.e. something like:
```
sed -i -E 's/(create_err|create_feature_err|emit_err|create_note|emit_fatal|emit_warning)\(([[:alnum:]]+|[A-Z][[:alnum:]:]*)( \{|\))/\1(errors::\2\3/' path/to/file.rs
```
& then I manually fixed the errors that occured. Most manual changes were required in `compiler/rustc_parse/src/parser/expr.rs`.
r? `@compiler-errors`File tree
11 files changed
+356
-376
lines changed- compiler
- rustc_const_eval/src/transform/check_consts
- rustc_expand/src
- rustc_interface/src
- rustc_metadata/src
- rustc_parse/src/parser
- rustc_passes/src
- rustc_session/src
11 files changed
+356
-376
lines changedLines changed: 35 additions & 37 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
| 25 | + | |
32 | 26 | | |
33 | 27 | | |
34 | 28 | | |
| |||
99 | 93 | | |
100 | 94 | | |
101 | 95 | | |
102 | | - | |
| 96 | + | |
103 | 97 | | |
104 | 98 | | |
105 | 99 | | |
| |||
303 | 297 | | |
304 | 298 | | |
305 | 299 | | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
310 | 305 | | |
311 | 306 | | |
312 | 307 | | |
| |||
351 | 346 | | |
352 | 347 | | |
353 | 348 | | |
354 | | - | |
| 349 | + | |
355 | 350 | | |
356 | 351 | | |
357 | 352 | | |
| |||
387 | 382 | | |
388 | 383 | | |
389 | 384 | | |
390 | | - | |
| 385 | + | |
391 | 386 | | |
392 | 387 | | |
393 | 388 | | |
394 | | - | |
| 389 | + | |
395 | 390 | | |
396 | 391 | | |
397 | 392 | | |
| |||
404 | 399 | | |
405 | 400 | | |
406 | 401 | | |
407 | | - | |
| 402 | + | |
408 | 403 | | |
409 | 404 | | |
410 | 405 | | |
| |||
420 | 415 | | |
421 | 416 | | |
422 | 417 | | |
423 | | - | |
| 418 | + | |
424 | 419 | | |
425 | 420 | | |
426 | 421 | | |
| |||
471 | 466 | | |
472 | 467 | | |
473 | 468 | | |
474 | | - | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
475 | 472 | | |
476 | 473 | | |
477 | 474 | | |
| |||
488 | 485 | | |
489 | 486 | | |
490 | 487 | | |
491 | | - | |
| 488 | + | |
492 | 489 | | |
493 | 490 | | |
494 | 491 | | |
495 | 492 | | |
496 | 493 | | |
497 | 494 | | |
498 | | - | |
| 495 | + | |
499 | 496 | | |
500 | 497 | | |
501 | 498 | | |
| |||
528 | 525 | | |
529 | 526 | | |
530 | 527 | | |
531 | | - | |
| 528 | + | |
532 | 529 | | |
533 | 530 | | |
534 | 531 | | |
535 | 532 | | |
536 | | - | |
| 533 | + | |
537 | 534 | | |
538 | 535 | | |
539 | 536 | | |
| |||
557 | 554 | | |
558 | 555 | | |
559 | 556 | | |
560 | | - | |
561 | | - | |
562 | | - | |
563 | | - | |
564 | | - | |
565 | | - | |
566 | | - | |
567 | | - | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
568 | 565 | | |
569 | 566 | | |
570 | 567 | | |
| |||
586 | 583 | | |
587 | 584 | | |
588 | 585 | | |
589 | | - | |
590 | | - | |
591 | | - | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
592 | 590 | | |
593 | 591 | | |
594 | 592 | | |
| |||
601 | 599 | | |
602 | 600 | | |
603 | 601 | | |
604 | | - | |
| 602 | + | |
605 | 603 | | |
606 | 604 | | |
607 | 605 | | |
| |||
652 | 650 | | |
653 | 651 | | |
654 | 652 | | |
655 | | - | |
| 653 | + | |
656 | 654 | | |
657 | 655 | | |
658 | 656 | | |
| |||
673 | 671 | | |
674 | 672 | | |
675 | 673 | | |
676 | | - | |
| 674 | + | |
677 | 675 | | |
678 | 676 | | |
679 | 677 | | |
| |||
690 | 688 | | |
691 | 689 | | |
692 | 690 | | |
693 | | - | |
| 691 | + | |
694 | 692 | | |
695 | 693 | | |
696 | 694 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
| 3 | + | |
9 | 4 | | |
10 | 5 | | |
11 | 6 | | |
| |||
796 | 791 | | |
797 | 792 | | |
798 | 793 | | |
799 | | - | |
| 794 | + | |
800 | 795 | | |
801 | 796 | | |
802 | 797 | | |
803 | 798 | | |
804 | 799 | | |
805 | | - | |
| 800 | + | |
806 | 801 | | |
807 | 802 | | |
808 | 803 | | |
| |||
1143 | 1138 | | |
1144 | 1139 | | |
1145 | 1140 | | |
1146 | | - | |
| 1141 | + | |
1147 | 1142 | | |
1148 | 1143 | | |
1149 | 1144 | | |
| |||
1197 | 1192 | | |
1198 | 1193 | | |
1199 | 1194 | | |
1200 | | - | |
| 1195 | + | |
1201 | 1196 | | |
1202 | 1197 | | |
1203 | 1198 | | |
| |||
1279 | 1274 | | |
1280 | 1275 | | |
1281 | 1276 | | |
1282 | | - | |
| 1277 | + | |
1283 | 1278 | | |
1284 | 1279 | | |
1285 | 1280 | | |
| |||
1307 | 1302 | | |
1308 | 1303 | | |
1309 | 1304 | | |
1310 | | - | |
| 1305 | + | |
1311 | 1306 | | |
1312 | 1307 | | |
1313 | 1308 | | |
1314 | 1309 | | |
1315 | 1310 | | |
1316 | 1311 | | |
1317 | | - | |
| 1312 | + | |
1318 | 1313 | | |
1319 | 1314 | | |
1320 | 1315 | | |
| |||
1336 | 1331 | | |
1337 | 1332 | | |
1338 | 1333 | | |
1339 | | - | |
| 1334 | + | |
1340 | 1335 | | |
1341 | 1336 | | |
1342 | 1337 | | |
| |||
1353 | 1348 | | |
1354 | 1349 | | |
1355 | 1350 | | |
1356 | | - | |
| 1351 | + | |
1357 | 1352 | | |
1358 | 1353 | | |
1359 | 1354 | | |
1360 | | - | |
| 1355 | + | |
1361 | 1356 | | |
1362 | 1357 | | |
1363 | 1358 | | |
1364 | 1359 | | |
1365 | 1360 | | |
1366 | | - | |
| 1361 | + | |
1367 | 1362 | | |
1368 | 1363 | | |
1369 | 1364 | | |
1370 | 1365 | | |
1371 | 1366 | | |
1372 | | - | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
| 1371 | + | |
1373 | 1372 | | |
1374 | 1373 | | |
1375 | 1374 | | |
1376 | 1375 | | |
1377 | 1376 | | |
1378 | | - | |
| 1377 | + | |
1379 | 1378 | | |
1380 | 1379 | | |
1381 | 1380 | | |
1382 | | - | |
| 1381 | + | |
1383 | 1382 | | |
1384 | 1383 | | |
1385 | 1384 | | |
1386 | 1385 | | |
1387 | 1386 | | |
1388 | | - | |
| 1387 | + | |
1389 | 1388 | | |
1390 | 1389 | | |
1391 | 1390 | | |
1392 | 1391 | | |
1393 | 1392 | | |
1394 | 1393 | | |
1395 | | - | |
| 1394 | + | |
1396 | 1395 | | |
1397 | 1396 | | |
1398 | 1397 | | |
1399 | 1398 | | |
1400 | | - | |
| 1399 | + | |
| 1400 | + | |
| 1401 | + | |
| 1402 | + | |
1401 | 1403 | | |
1402 | 1404 | | |
1403 | 1405 | | |
| |||
0 commit comments