Commit dd1ba42
authored
Rollup merge of #154453 - chenyukang:yukang-fix-154383, r=notriddle
Fix ice in rustdoc of private reexport
Fixes #154383
The root cause is rustdoc could still try to resolve links for source docs that resolver did not cache in `ResolveDocLinks::Exported` mode. The test case will not crash with `--document-private-items` option, which will use `ResolveDocLinks::All`.
The fix makes rustdoc skip link resolution based on the source `DefId` of each doc fragment, so its behavior stays aligned with resolver's logic here: https://github.com/chenyukang/rust/blob/dc5cb1719eed6ac9275fe93d914d32141606b2ac/compiler/rustc_resolve/src/late.rs#L6852 files changed
Lines changed: 28 additions & 8 deletions
File tree
- src/librustdoc/passes
- tests/rustdoc-ui/intra-doc
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1067 | 1067 | | |
1068 | 1068 | | |
1069 | 1069 | | |
1070 | | - | |
1071 | | - | |
1072 | | - | |
1073 | | - | |
1074 | | - | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
1075 | 1082 | | |
1076 | 1083 | | |
1077 | 1084 | | |
1078 | 1085 | | |
1079 | 1086 | | |
1080 | | - | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
1081 | 1091 | | |
1082 | 1092 | | |
1083 | 1093 | | |
| |||
1108 | 1118 | | |
1109 | 1119 | | |
1110 | 1120 | | |
1111 | | - | |
| 1121 | + | |
1112 | 1122 | | |
1113 | 1123 | | |
1114 | 1124 | | |
| |||
1137 | 1147 | | |
1138 | 1148 | | |
1139 | 1149 | | |
1140 | | - | |
| 1150 | + | |
1141 | 1151 | | |
1142 | 1152 | | |
1143 | 1153 | | |
| |||
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
0 commit comments