bors
1d679446b0
Auto merge of #140527 - GuillaumeGomez:doctest-main-fn, r=notriddle
...
Emit a warning if the doctest `main` function will not be run
Fixes #140310 .
I think we could try to go much further like adding a "link" (ie UI annotations) on the `main` function in the doctest. However that will require some more computation, not sure if it's worth it or not. Can still be done in a follow-up if we want it.
For now, this PR does two things:
1. Pass the `DiagCtxt` to the doctest parser to emit the warning.
2. Correctly generate the `Span` to where the doctest is starting (I hope the way I did it isn't too bad either...).
cc `@fmease`
r? `@notriddle`
2025-05-22 08:40:58 +00:00
..
2025-05-01 11:56:11 +02:00
2024-12-27 19:58:16 +11:00
2024-12-27 19:58:16 +11:00
2024-02-22 16:04:04 +00:00
2024-09-28 18:38:11 +02:00
2024-12-27 19:58:16 +11:00
2024-04-15 21:49:56 +02:00
2024-12-27 19:58:16 +11:00
2024-12-16 17:59:07 +01:00
2024-12-27 19:58:16 +11:00
2024-12-16 13:59:41 +01:00
2024-12-27 19:58:16 +11:00
2024-11-22 11:12:15 -08:00
2024-12-27 19:58:16 +11:00
2024-10-01 17:08:01 +02:00
2024-12-27 19:58:16 +11:00
2025-03-27 11:18:43 +01:00
2024-12-27 19:58:16 +11:00
2024-12-27 19:58:16 +11:00
2024-02-22 16:04:04 +00:00
2024-02-29 14:43:43 +01:00
2024-02-29 14:43:43 +01:00
2024-12-27 19:58:16 +11:00
2024-12-27 19:58:16 +11:00
2024-02-22 16:04:04 +00:00
2024-12-27 19:58:16 +11:00
2025-01-19 18:41:11 +01:00
2025-01-19 18:41:11 +01:00
2024-09-19 13:57:44 -07:00
2024-12-27 19:58:16 +11:00
2024-09-19 13:57:44 -07:00
2024-10-26 17:56:38 -07:00
2024-10-26 17:56:38 -07:00
2025-03-10 01:47:36 +01:00
2025-04-03 19:37:18 +02:00
2025-04-25 14:13:24 +02:00
2025-03-27 11:18:43 +01:00
2025-03-27 11:18:43 +01:00
2024-12-27 19:58:16 +11:00
2025-04-25 22:04:50 +02:00
2025-05-02 13:57:53 +02:00
2025-04-25 22:04:50 +02:00
2024-12-27 19:58:16 +11: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-01-01 15:58:29 +01:00
2025-04-10 09:56:37 +02:00
2025-04-10 09:56:37 +02:00
2024-12-27 19:58:16 +11:00
2025-04-14 10:36:11 +08:00
2025-03-10 01:47:36 +01:00
2025-03-10 01:47:36 +01:00
2025-03-10 01:47:36 +01:00
2025-05-01 11:56:11 +02:00
2025-05-01 11:56:11 +02:00
2025-05-01 11:56:11 +02:00
2025-05-01 11:56:11 +02:00
2025-05-02 13:57:53 +02:00
2025-05-01 11:56:11 +02:00
2024-12-27 19:58:16 +11:00
2024-11-22 11:12:15 -08:00
2024-12-27 19:58:16 +11:00
2024-10-24 21:35:15 +02:00
2025-04-03 11:08:55 +03:00
2024-12-27 19:58:16 +11:00
2024-12-27 19:58:16 +11:00
2024-12-27 19:58:16 +11:00
2024-12-27 19:58:16 +11:00
2024-10-11 21:21:32 +02:00
2024-09-23 09:23:04 +02:00
2024-12-31 15:11:18 +08:00
2024-10-11 21:21:32 +02:00
2025-03-25 15:39:41 +09:00
2025-03-25 15:39:41 +09:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2025-03-14 19:50:03 +00:00
2024-10-26 17:56:38 -07:00
2025-02-16 10:40:04 +00:00
2024-12-27 19:58:16 +11:00
2025-04-15 15:44:45 +02:00
2025-04-15 15:44:45 +02:00
2025-04-15 15:44:45 +02:00
2024-12-20 15:17:47 +01:00
2024-12-27 19:58:16 +11:00
2024-11-22 11:12:15 -08:00
2024-09-29 13:01:41 +02:00
2025-04-25 15:55:54 +02:00
2025-04-25 15:55:54 +02: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-07-18 20:08:38 +00:00
2025-05-02 13:57:53 +02:00
2024-12-27 19:58:16 +11:00
2024-12-27 19:58:16 +11:00
2024-12-27 19:58:16 +11:00
2025-05-02 13:57:53 +02:00
2025-05-02 13:57:53 +02:00
2025-05-02 13:57:53 +02:00
2024-12-27 19:58:16 +11:00
2024-11-22 11:12:15 -08:00
2024-12-27 19:58:16 +11:00
2024-08-13 20:14:56 +02:00