Commit 7fd331e
committed
Auto merge of #32328 - jseyfried:coherence, r=nikomatsakis
resolve: Improve import failure detection and lay groundwork for RFC 1422
This PR improves import failure detection and lays some groundwork for RFC 1422.
More specifically, it
- Avoids recomputing the resolution of an import directive's module path.
- Refactors code in `resolve_imports` that does not scale to the arbitrarily many levels of visibility that will be required by RFC 1422.
- Replaces `ModuleS`'s fields `public_glob_count`, `private_glob_count`, and `resolved_globs` with a list of glob import directives `globs`.
- Replaces `NameResolution`'s fields `pub_outstanding_references` and `outstanding_references` with a field `single_imports` of a newly defined type `SingleImports`.
- Improves import failure detection by detecting cycles that include single imports (currently, only cycles of globs are detected). This fixes #32119.
r? @nikomatsakisFile tree
4 files changed
+207
-207
lines changed- src
- librustc_resolve
- test/compile-fail
4 files changed
+207
-207
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | | - | |
| 17 | + | |
19 | 18 | | |
20 | 19 | | |
21 | 20 | | |
| |||
28 | 27 | | |
29 | 28 | | |
30 | 29 | | |
31 | | - | |
| 30 | + | |
32 | 31 | | |
33 | 32 | | |
34 | 33 | | |
| |||
152 | 151 | | |
153 | 152 | | |
154 | 153 | | |
155 | | - | |
156 | | - | |
| 154 | + | |
| 155 | + | |
157 | 156 | | |
158 | 157 | | |
159 | 158 | | |
| |||
203 | 202 | | |
204 | 203 | | |
205 | 204 | | |
206 | | - | |
207 | | - | |
| 205 | + | |
| 206 | + | |
208 | 207 | | |
209 | 208 | | |
210 | 209 | | |
| |||
213 | 212 | | |
214 | 213 | | |
215 | 214 | | |
216 | | - | |
217 | | - | |
| 215 | + | |
| 216 | + | |
218 | 217 | | |
219 | 218 | | |
220 | 219 | | |
| |||
521 | 520 | | |
522 | 521 | | |
523 | 522 | | |
524 | | - | |
525 | | - | |
526 | | - | |
527 | | - | |
528 | | - | |
529 | | - | |
530 | | - | |
531 | | - | |
532 | | - | |
533 | | - | |
534 | | - | |
535 | | - | |
536 | | - | |
537 | | - | |
538 | | - | |
539 | | - | |
540 | | - | |
541 | | - | |
542 | | - | |
543 | | - | |
544 | | - | |
545 | | - | |
546 | | - | |
547 | | - | |
548 | | - | |
549 | | - | |
550 | | - | |
551 | | - | |
552 | | - | |
553 | | - | |
554 | | - | |
555 | | - | |
556 | | - | |
557 | 523 | | |
558 | 524 | | |
559 | 525 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
828 | 828 | | |
829 | 829 | | |
830 | 830 | | |
831 | | - | |
832 | | - | |
| 831 | + | |
| 832 | + | |
833 | 833 | | |
834 | 834 | | |
835 | 835 | | |
| |||
849 | 849 | | |
850 | 850 | | |
851 | 851 | | |
852 | | - | |
853 | | - | |
854 | | - | |
855 | | - | |
856 | | - | |
857 | | - | |
858 | | - | |
859 | | - | |
| 852 | + | |
| 853 | + | |
860 | 854 | | |
861 | 855 | | |
862 | 856 | | |
| |||
884 | 878 | | |
885 | 879 | | |
886 | 880 | | |
887 | | - | |
888 | | - | |
889 | | - | |
| 881 | + | |
890 | 882 | | |
891 | 883 | | |
892 | 884 | | |
893 | 885 | | |
894 | 886 | | |
895 | | - | |
896 | | - | |
897 | | - | |
898 | | - | |
899 | | - | |
900 | 887 | | |
901 | 888 | | |
902 | | - | |
| 889 | + | |
903 | 890 | | |
904 | 891 | | |
905 | 892 | | |
| |||
929 | 916 | | |
930 | 917 | | |
931 | 918 | | |
932 | | - | |
933 | | - | |
934 | | - | |
935 | | - | |
936 | | - | |
937 | 919 | | |
938 | 920 | | |
939 | 921 | | |
| |||
1135 | 1117 | | |
1136 | 1118 | | |
1137 | 1119 | | |
1138 | | - | |
| 1120 | + | |
| 1121 | + | |
1139 | 1122 | | |
1140 | 1123 | | |
1141 | 1124 | | |
| |||
1145 | 1128 | | |
1146 | 1129 | | |
1147 | 1130 | | |
1148 | | - | |
| 1131 | + | |
| 1132 | + | |
1149 | 1133 | | |
1150 | 1134 | | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
1151 | 1138 | | |
1152 | 1139 | | |
1153 | 1140 | | |
| |||
1216 | 1203 | | |
1217 | 1204 | | |
1218 | 1205 | | |
| 1206 | + | |
1219 | 1207 | | |
1220 | 1208 | | |
1221 | 1209 | | |
| |||
0 commit comments