This repository was archived by the owner on May 28, 2025. It is now read-only.
Commit 949b98c
committed
Auto merge of rust-lang#95337 - petrochenkov:doclink3, r=camelid
rustdoc: Fix resolution of `crate`-relative paths in doc links
Resolve `crate::foo` paths transparently to rustdoc, so their resolution no longer affects diagnostics and modules used for determining traits in scope.
The proper solution is to account for the current `module_id`/`parent_scope` in `fn resolve_crate_root`, but it's a slightly larger compiler changes. This PR moves the code closer to it, but keeps it rustdoc-specific.
Fixes rust-lang#78696
Fixes rust-lang#94924File tree
6 files changed
+53
-43
lines changed- compiler/rustc_resolve/src
- src
- librustdoc/passes
- collect_intra_doc_links
- test
- rustdoc-ui/intra-doc
- rustdoc/intra-doc
6 files changed
+53
-43
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3270 | 3270 | | |
3271 | 3271 | | |
3272 | 3272 | | |
3273 | | - | |
| 3273 | + | |
3274 | 3274 | | |
3275 | 3275 | | |
3276 | 3276 | | |
3277 | | - | |
3278 | | - | |
| 3277 | + | |
| 3278 | + | |
| 3279 | + | |
| 3280 | + | |
| 3281 | + | |
| 3282 | + | |
| 3283 | + | |
| 3284 | + | |
| 3285 | + | |
| 3286 | + | |
| 3287 | + | |
3279 | 3288 | | |
3280 | 3289 | | |
3281 | 3290 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
1043 | 1043 | | |
1044 | 1044 | | |
1045 | 1045 | | |
1046 | | - | |
1047 | | - | |
1048 | | - | |
1049 | | - | |
1050 | | - | |
1051 | | - | |
1052 | 1046 | | |
1053 | 1047 | | |
| 1048 | + | |
1054 | 1049 | | |
1055 | | - | |
| 1050 | + | |
1056 | 1051 | | |
1057 | 1052 | | |
1058 | 1053 | | |
| |||
1187 | 1182 | | |
1188 | 1183 | | |
1189 | 1184 | | |
1190 | | - | |
1191 | 1185 | | |
1192 | 1186 | | |
1193 | 1187 | | |
| |||
1199 | 1193 | | |
1200 | 1194 | | |
1201 | 1195 | | |
1202 | | - | |
| 1196 | + | |
1203 | 1197 | | |
1204 | 1198 | | |
1205 | 1199 | | |
| |||
1221 | 1215 | | |
1222 | 1216 | | |
1223 | 1217 | | |
1224 | | - | |
1225 | 1218 | | |
1226 | 1219 | | |
1227 | 1220 | | |
| |||
1239 | 1232 | | |
1240 | 1233 | | |
1241 | 1234 | | |
1242 | | - | |
| 1235 | + | |
1243 | 1236 | | |
1244 | 1237 | | |
1245 | 1238 | | |
| |||
1252 | 1245 | | |
1253 | 1246 | | |
1254 | 1247 | | |
1255 | | - | |
1256 | | - | |
1257 | | - | |
1258 | | - | |
1259 | | - | |
1260 | | - | |
1261 | | - | |
1262 | | - | |
1263 | | - | |
1264 | | - | |
1265 | | - | |
1266 | | - | |
1267 | | - | |
1268 | | - | |
1269 | | - | |
1270 | | - | |
1271 | | - | |
1272 | | - | |
1273 | | - | |
1274 | | - | |
1275 | 1248 | | |
1276 | 1249 | | |
1277 | 1250 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | 35 | | |
41 | 36 | | |
42 | 37 | | |
| |||
105 | 100 | | |
106 | 101 | | |
107 | 102 | | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | 103 | | |
112 | 104 | | |
113 | 105 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 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 | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
0 commit comments