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
..
2024-02-29 14:43:43 +01:00
2024-02-29 14:43:43 +01:00
2024-12-31 15:11:18 +08:00