add xtask doctest#2255
Conversation
Add a new `xtask`` command `doctest` that runs `mdbook test`. This ensures that `rustdoc`, when run from `mdbook`, will use the toolchain override. fixes rust-lang#2251
There was a problem hiding this comment.
If we add this, then I think we should also update the documentation to guide users towards the preferred command/workflow. So for example:
reference/dev-guide/src/examples.md
Line 32 in e6b3010
reference/dev-guide/src/tests.md
Line 6 in e6b3010
reference/dev-guide/src/tests.md
Lines 22 to 28 in e6b3010
|
Thanks for the review! Oops, I had some edits in progress before I saw your comments. Will incorporate them soon. |
Rename the xtask command to `mdbook-test`. Adjust documentation accordingly. Adjust `OPTIONS`` in xtask.
|
I think the latest revision addresses your comments. Please let me know what you think! |
|
@rustbot label Meta "Authoring guide" |
|
Error: Label Meta can only be set by Rust team members Please file an issue on GitHub at triagebot if there's a problem with this bot, or reach out on #triagebot on Zulip. |
|
@rustbot label "Authoring guide" |
|
Error: Label Authoring guide can only be set by Rust team members Please file an issue on GitHub at triagebot if there's a problem with this bot, or reach out on #triagebot on Zulip. |
|
I think the commit messages and PR title should be adjusted to reflect the changed command name. Please let me know if you're OK with me squashing and rewording accordingly. |
Update books ## rust-lang/reference 10 commits in ad35aca481751a06afeb23820a672b0f3b11a476..01b0ee707f4571e803c8b2c471d8335a448f5d60 2026-05-31 18:52:24 UTC to 2026-05-20 14:06:08 UTC - Update `naked` to use the attribute template (rust-lang/reference#1908) - Update link_name for updated restrictions (rust-lang/reference#2268) - parens are not optional in guard chains that have || operators (rust-lang/reference#2224) - Document `target_has_atomic_primitive_alignment` (rust-lang/reference#2273) - Fix grammar rules pertaining to obsolete range patterns (rust-lang/reference#2259) - Unwrap a few remaining chapters (rust-lang/reference#2276) - Guarantee alignment of `repr(C)` structs with no fields (rust-lang/reference#2264) - avoid using 'place projection' for only some of the projections (rust-lang/reference#2253) - add xtask doctest (rust-lang/reference#2255) - Grammar: Don't allow inner attrs in certain block expressions (rust-lang/reference#2269) ## rust-lang/rust-by-example 7 commits in 898f0ac1479223d332309e0fce88d44b39927d28..d3117f6c873acbbf331c1d510371d061dfcc975c 2026-06-01 14:19:19 UTC to 2026-05-25 13:19:23 UTC - Fix Spanish translation typos in es.po (rust-lang/rust-by-example#2018) - Match comment module & file order (rust-lang/rust-by-example#2009) - Fix Spanish translation typos in es.po (rust-lang/rust-by-example#2011) - Update expression.md: renamed variable x_cube to x_cubed (rust-lang/rust-by-example#2012) - Update comment.md - Fixed comments related to asterisk column (rust-lang/rust-by-example#2013) - Minor typo in meta.md (rust-lang/rust-by-example#2016) - Fix erroroneous implication (rust-lang/rust-by-example#2017)
Update books ## rust-lang/reference 10 commits in ad35aca481751a06afeb23820a672b0f3b11a476..01b0ee707f4571e803c8b2c471d8335a448f5d60 2026-05-31 18:52:24 UTC to 2026-05-20 14:06:08 UTC - Update `naked` to use the attribute template (rust-lang/reference#1908) - Update link_name for updated restrictions (rust-lang/reference#2268) - parens are not optional in guard chains that have || operators (rust-lang/reference#2224) - Document `target_has_atomic_primitive_alignment` (rust-lang/reference#2273) - Fix grammar rules pertaining to obsolete range patterns (rust-lang/reference#2259) - Unwrap a few remaining chapters (rust-lang/reference#2276) - Guarantee alignment of `repr(C)` structs with no fields (rust-lang/reference#2264) - avoid using 'place projection' for only some of the projections (rust-lang/reference#2253) - add xtask doctest (rust-lang/reference#2255) - Grammar: Don't allow inner attrs in certain block expressions (rust-lang/reference#2269) ## rust-lang/rust-by-example 7 commits in 898f0ac1479223d332309e0fce88d44b39927d28..d3117f6c873acbbf331c1d510371d061dfcc975c 2026-06-01 14:19:19 UTC to 2026-05-25 13:19:23 UTC - Fix Spanish translation typos in es.po (rust-lang/rust-by-example#2018) - Match comment module & file order (rust-lang/rust-by-example#2009) - Fix Spanish translation typos in es.po (rust-lang/rust-by-example#2011) - Update expression.md: renamed variable x_cube to x_cubed (rust-lang/rust-by-example#2012) - Update comment.md - Fixed comments related to asterisk column (rust-lang/rust-by-example#2013) - Minor typo in meta.md (rust-lang/rust-by-example#2016) - Fix erroroneous implication (rust-lang/rust-by-example#2017)
Update books ## rust-lang/reference 10 commits in ad35aca481751a06afeb23820a672b0f3b11a476..01b0ee707f4571e803c8b2c471d8335a448f5d60 2026-05-31 18:52:24 UTC to 2026-05-20 14:06:08 UTC - Update `naked` to use the attribute template (rust-lang/reference#1908) - Update link_name for updated restrictions (rust-lang/reference#2268) - parens are not optional in guard chains that have || operators (rust-lang/reference#2224) - Document `target_has_atomic_primitive_alignment` (rust-lang/reference#2273) - Fix grammar rules pertaining to obsolete range patterns (rust-lang/reference#2259) - Unwrap a few remaining chapters (rust-lang/reference#2276) - Guarantee alignment of `repr(C)` structs with no fields (rust-lang/reference#2264) - avoid using 'place projection' for only some of the projections (rust-lang/reference#2253) - add xtask doctest (rust-lang/reference#2255) - Grammar: Don't allow inner attrs in certain block expressions (rust-lang/reference#2269) ## rust-lang/rust-by-example 7 commits in 898f0ac1479223d332309e0fce88d44b39927d28..d3117f6c873acbbf331c1d510371d061dfcc975c 2026-06-01 14:19:19 UTC to 2026-05-25 13:19:23 UTC - Fix Spanish translation typos in es.po (rust-lang/rust-by-example#2018) - Match comment module & file order (rust-lang/rust-by-example#2009) - Fix Spanish translation typos in es.po (rust-lang/rust-by-example#2011) - Update expression.md: renamed variable x_cube to x_cubed (rust-lang/rust-by-example#2012) - Update comment.md - Fixed comments related to asterisk column (rust-lang/rust-by-example#2013) - Minor typo in meta.md (rust-lang/rust-by-example#2016) - Fix erroroneous implication (rust-lang/rust-by-example#2017)
Rollup merge of #157265 - rustbot:docs-update, r=ehuss Update books ## rust-lang/reference 10 commits in ad35aca481751a06afeb23820a672b0f3b11a476..01b0ee707f4571e803c8b2c471d8335a448f5d60 2026-05-31 18:52:24 UTC to 2026-05-20 14:06:08 UTC - Update `naked` to use the attribute template (rust-lang/reference#1908) - Update link_name for updated restrictions (rust-lang/reference#2268) - parens are not optional in guard chains that have || operators (rust-lang/reference#2224) - Document `target_has_atomic_primitive_alignment` (rust-lang/reference#2273) - Fix grammar rules pertaining to obsolete range patterns (rust-lang/reference#2259) - Unwrap a few remaining chapters (rust-lang/reference#2276) - Guarantee alignment of `repr(C)` structs with no fields (rust-lang/reference#2264) - avoid using 'place projection' for only some of the projections (rust-lang/reference#2253) - add xtask doctest (rust-lang/reference#2255) - Grammar: Don't allow inner attrs in certain block expressions (rust-lang/reference#2269) ## rust-lang/rust-by-example 7 commits in 898f0ac1479223d332309e0fce88d44b39927d28..d3117f6c873acbbf331c1d510371d061dfcc975c 2026-06-01 14:19:19 UTC to 2026-05-25 13:19:23 UTC - Fix Spanish translation typos in es.po (rust-lang/rust-by-example#2018) - Match comment module & file order (rust-lang/rust-by-example#2009) - Fix Spanish translation typos in es.po (rust-lang/rust-by-example#2011) - Update expression.md: renamed variable x_cube to x_cubed (rust-lang/rust-by-example#2012) - Update comment.md - Fixed comments related to asterisk column (rust-lang/rust-by-example#2013) - Minor typo in meta.md (rust-lang/rust-by-example#2016) - Fix erroroneous implication (rust-lang/rust-by-example#2017)
Add a new
xtask`` commanddoctestthat runsmdbook test. This ensures thatrustdoc, when run frommdbook`, will use the toolchain override.fixes #2251