Samuel Tardieu
fc4b3fa3f9
Rollup merge of #132748 - lolbinarycat:rustdoc-intra-doc-link-warn-more-54191, r=GuillaumeGomez
...
get rid of some false negatives in rustdoc::broken_intra_doc_links
rustdoc will not try to do intra-doc linking if the "path" of a link looks too much like a "real url".
however, only inline links (`[text](url)`) can actually contain a url, other types of links (reference links, shortcut links) contain a *reference* which is later resolved to an actual url.
the "path" in this case cannot be a url, and therefore it should not be skipped due to looking like a url.
fixes https://github.com/rust-lang/rust/issues/54191
to minimize the number of false positives that will be introduced, the following heuristic is used:
If there's no backticks, be lenient revert to old behavior.
This is to prevent churn by linting on stuff that isn't meant to be a link.
only shortcut links have simple enough syntax that they
are likely to be written accidentlly, collapsed and reference links
need 4 metachars, and reference links will not usually use
backticks in the reference name.
therefore, only shortcut syntax gets the lenient behavior.
here's a truth table for how link kinds that cannot be urls are handled:
| | is shortcut link | not shortcut link |
|--------------|--------------------|-------------------|
| has backtick | never ignore | never ignore |
| no backtick | ignore if url-like | never ignore |
2025-08-02 11:24:20 +02:00
..
2024-12-27 19:58:16 +11:00
2025-02-27 13:22:46 +00:00
2025-03-25 17:33:09 +03:00
2025-07-30 19:49:02 +02:00
2024-12-27 19:58:16 +11:00
2025-03-25 17:33:09 +03:00
2025-07-24 11:17:14 -05:00
2025-05-29 21:50:14 +02:00
2025-07-24 11:17:13 -05:00
2025-03-25 17:33:09 +03:00
2024-02-22 16:04:04 +00:00
2024-12-07 21:37:15 +00:00
2025-07-24 11:06:28 +02:00
2025-07-24 11:06:28 +02:00
2025-07-24 11:06:28 +02:00
2025-07-24 11:06:28 +02:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2024-09-12 13:47:51 -07:00
2024-09-12 13:48:51 -07:00
2023-12-21 10:17:11 +08:00
2023-12-21 10:17:11 +08:00
2025-04-03 18:10:48 +00:00
2024-04-15 21:49:55 +02:00
2024-04-15 21:49:56 +02:00
2023-01-11 09:32:08 +00:00
2025-07-17 22:21:21 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2024-02-22 16:04:04 +00:00
2023-03-30 14:55:03 +02:00
2023-11-24 19:15:52 +01:00
2025-06-02 15:37:15 +00:00
2025-06-07 13:42:30 +02:00
2024-02-22 16:04:04 +00:00
2025-06-16 23:04:36 +00:00
2025-06-16 23:04:36 +00:00
2025-04-13 21:48:53 +03:00
2025-04-13 21:48:53 +03:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2025-03-07 17:55:08 +00:00
2025-07-24 11:17:13 -05:00
2025-07-24 11:17:13 -05:00
2024-06-28 08:01:07 +08:00
2024-06-28 08:01:07 +08:00
2023-01-11 09:32:08 +00:00
2023-11-24 19:15:52 +01:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-11-24 19:15:52 +01:00
2025-05-29 21:50:14 +02:00
2025-05-29 21:50:14 +02:00
2025-04-03 18:10:48 +00:00
2025-04-03 18:10:48 +00:00
2025-05-26 21:52:21 +02:00
2025-05-29 21:50:14 +02:00
2024-02-29 14:43:43 +01:00
2024-02-29 14:43:43 +01:00
2025-03-25 17:33:09 +03:00
2025-01-29 15:18:14 +01:00
2025-06-10 13:54:47 +02:00
2025-06-10 13:54:47 +02:00
2025-01-29 13:57:27 +01:00
2025-06-10 13:54:46 +02:00
2023-01-11 09:32:08 +00:00
2024-01-13 12:46:58 -05:00
2025-02-12 19:46:07 +01:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2024-07-12 18:18:30 -07:00
2024-02-22 16:04:04 +00:00
2024-04-15 15:11:49 -07:00
2024-06-03 03:50:15 +02:00
2024-02-22 16:04:04 +00:00
2025-05-04 18:27:45 +03:00
2025-05-04 18:27:45 +03:00
2024-04-15 15:11:49 -07:00
2024-07-12 18:18:30 -07:00
2024-07-12 18:18:30 -07:00
2025-01-24 01:19:50 +00:00
2024-02-22 16:04:04 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-02-20 15:28:59 +00:00
2025-03-25 17:33:09 +03:00
2024-07-04 00:40:04 +00:00
2023-01-11 09:32:08 +00:00
2023-11-24 19:15:52 +01:00
2024-02-22 16:04:04 +00:00
2024-05-30 22:52:33 +02:00
2024-07-17 21:30:40 +00:00
2025-01-22 09:20:57 -08:00
2025-01-26 21:20:31 +01:00
2023-03-30 14:55:03 +02:00
2025-06-30 20:36:16 +02:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2024-12-17 13:56:10 +11:00
2024-03-28 11:09:08 +01:00
2025-04-08 23:06:31 +03:00
2024-12-13 18:48:33 +00:00
2025-04-13 21:48:53 +03:00
2023-01-11 09:32:08 +00:00
2024-02-22 16:04:04 +00:00
2023-01-11 09:32:08 +00:00
2023-03-30 14:55:03 +02:00
2024-07-22 22:51:53 +00:00
2025-04-09 13:04:57 -04:00
2025-04-09 13:04:57 -04:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2024-03-07 06:27:09 +00:00
2024-03-07 06:27:09 +00:00
2024-02-22 16:04:04 +00:00
2024-09-12 13:47:51 -07:00
2024-09-12 13:47:51 -07:00
2024-09-12 13:48:51 -07:00
2023-02-23 09:00:33 +00:00
2023-11-24 19:15:52 +01:00
2024-09-09 22:35:10 +02:00
2024-09-09 22:35:10 +02:00
2024-05-21 21:21:26 -07:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2024-09-09 22:35:10 +02:00
2024-04-13 19:32:39 -07:00
2024-12-27 19:58:16 +11:00
2025-01-01 15:58:29 +01:00
2024-12-27 19:58:16 +11:00
2025-03-27 11:18:43 +01:00
2025-03-25 17:33:09 +03:00
2024-08-06 16:56:48 +02:00
2025-03-16 23:37:09 +01:00
2024-12-27 19:58:16 +11:00
2024-06-09 10:34:54 -07:00
2023-01-11 09:32:08 +00:00
2024-10-22 07:37:54 +01:00
2024-02-22 16:04:04 +00:00
2024-11-04 14:46:04 +01:00
2024-11-28 21:22:06 +01:00
2024-11-04 14:46:04 +01:00
2024-11-28 21:22:06 +01:00
2024-02-22 16:04:04 +00:00
2025-06-16 23:04:36 +00:00
2025-07-03 07:19:25 -06:00
2025-07-03 07:19:25 -06:00
2023-01-11 09:32:08 +00:00
2023-11-24 19:15:52 +01:00
2024-11-23 23:31:30 +00:00
2024-11-23 23:31:30 +00:00
2024-11-29 17:23:34 +11:00
2025-05-22 12:31:28 -05:00
2025-03-25 17:33:09 +03:00
2023-01-11 09:32:08 +00:00
2024-02-22 16:04:04 +00:00