]> git.lizzy.rs Git - rust.git/commit - src/tools/miri
Auto merge of #87489 - bdalrhm:rustdoc-line-num, r=CraftSpider
authorbors <bors@rust-lang.org>
Wed, 8 Sep 2021 12:55:15 +0000 (12:55 +0000)
committerbors <bors@rust-lang.org>
Wed, 8 Sep 2021 12:55:15 +0000 (12:55 +0000)
commitc9db3e0fbc84d8409285698486375f080d361ef3
treeb44b6179fe3798d2e3c12fd6de2fb3a43869884d
parent434cb437b55d61bcb54a01921de7ac752e6dee13
parente66dafcd247d542198b31bd413f65906facd4fd4
Auto merge of #87489 - bdalrhm:rustdoc-line-num, r=CraftSpider

`rustdoc`: compute correct line number for indented rust code blocks.

This PR fixes a bug in `rustdoc` where it computes the wrong line number for indented rust code blocks (and subsequent blocks) it finds in markdown strings. To fix this issue, we decrement the line number if we find characters between the code block and the preceding line ending. I noticed this issue as I was trying to use `rustdoc` to extract examples from The Rust Reference and run them through the [Rust Model Checker](https://github.com/model-checking/rmc).
src/librustdoc/html/markdown.rs
src/librustdoc/html/markdown/tests.rs