This repository was archived by the owner on May 28, 2025. It is now read-only.
Commit 5fa94f3
committed
Auto merge of rust-lang#88368 - jyn514:metadata-error, r=petrochenkov
Improve error when an .rlib can't be parsed
This usually describes either an error in the compiler itself or some
sort of IO error. Either way, we should report it to the user rather
than just saying "crate not found".
This only gives an error if the crate couldn't be loaded at all - if the
compiler finds another .rlib or .rmeta file which was valid, it will
continue to compile the crate.
Example output:
```
error[E0785]: found invalid metadata files for crate `foo`
--> bar.rs:3:24
|
3 | println!("{}", foo::FOO_11_49[0]);
| ^^^
|
= warning: failed to parse rlib '/home/joshua/test-rustdoc/libfoo.rlib': Invalid archive extended name offset
```
cc `@ehuss`File tree
9 files changed
+118
-16
lines changed- compiler
- rustc_error_codes/src
- error_codes
- rustc_metadata/src
- src/test
- run-make-fulldeps/invalid-library
- run-make/invalid-so
- ui/crate-loading
- auxiliary
9 files changed
+118
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
484 | 484 | | |
485 | 485 | | |
486 | 486 | | |
| 487 | + | |
487 | 488 | | |
488 | 489 | | |
489 | 490 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
350 | 350 | | |
351 | 351 | | |
352 | 352 | | |
| 353 | + | |
353 | 354 | | |
354 | 355 | | |
355 | 356 | | |
| |||
548 | 549 | | |
549 | 550 | | |
550 | 551 | | |
551 | | - | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
552 | 563 | | |
553 | 564 | | |
554 | 565 | | |
| |||
726 | 737 | | |
727 | 738 | | |
728 | 739 | | |
729 | | - | |
| 740 | + | |
730 | 741 | | |
731 | | - | |
| 742 | + | |
732 | 743 | | |
733 | | - | |
| 744 | + | |
734 | 745 | | |
735 | 746 | | |
736 | | - | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
737 | 750 | | |
738 | | - | |
| 751 | + | |
| 752 | + | |
739 | 753 | | |
740 | 754 | | |
741 | 755 | | |
742 | 756 | | |
743 | 757 | | |
744 | | - | |
745 | | - | |
| 758 | + | |
| 759 | + | |
746 | 760 | | |
747 | | - | |
| 761 | + | |
748 | 762 | | |
749 | 763 | | |
750 | 764 | | |
| |||
756 | 770 | | |
757 | 771 | | |
758 | 772 | | |
759 | | - | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
760 | 777 | | |
761 | 778 | | |
762 | 779 | | |
763 | 780 | | |
764 | 781 | | |
765 | | - | |
766 | | - | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
767 | 788 | | |
768 | | - | |
769 | | - | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
770 | 795 | | |
771 | 796 | | |
772 | 797 | | |
| |||
775 | 800 | | |
776 | 801 | | |
777 | 802 | | |
778 | | - | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
779 | 807 | | |
780 | 808 | | |
781 | 809 | | |
| |||
854 | 882 | | |
855 | 883 | | |
856 | 884 | | |
| 885 | + | |
857 | 886 | | |
858 | 887 | | |
859 | 888 | | |
| |||
883 | 912 | | |
884 | 913 | | |
885 | 914 | | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
886 | 933 | | |
887 | 934 | | |
888 | 935 | | |
| |||
1064 | 1111 | | |
1065 | 1112 | | |
1066 | 1113 | | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
1067 | 1127 | | |
1068 | 1128 | | |
1069 | 1129 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
Whitespace-only changes.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
0 commit comments