about summary refs log tree commit diff
path: root/compiler/rustc_mir_transform/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-05-22 08:40:58 +0000
committerbors <bors@rust-lang.org>2025-05-22 08:40:58 +0000
commit1d679446b01e65f9bc9ae609d0ae1e4a9c0ccaa3 (patch)
tree99e7223e4264ae071bf3e6fac30b7f12278965af /compiler/rustc_mir_transform/src
parent2cd37831b0706c9f2d6e7e20eb556dc7548bf732 (diff)
parentf4d41a5cbd00ee3490beb3a6fff9bd909c137153 (diff)
downloadrust-1d679446b01e65f9bc9ae609d0ae1e4a9c0ccaa3.tar.gz
rust-1d679446b01e65f9bc9ae609d0ae1e4a9c0ccaa3.zip
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`
Diffstat (limited to 'compiler/rustc_mir_transform/src')
0 files changed, 0 insertions, 0 deletions