Allow merging all libcore/alloc doctests into a single binary#153072
Allow merging all libcore/alloc doctests into a single binary#153072jyn514 wants to merge 6 commits intorust-lang:mainfrom
Conversation
|
rustbot has assigned @jdonszelmann. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
16227c8 to
d567da2
Compare
This comment has been minimized.
This comment has been minimized.
|
Merging doctest would mean that we did no longer test that the set of features in doc tests are accurate, right? Those are visible to the user. |
This comment has been minimized.
This comment has been minimized.
|
Yes. That’s why this doesn’t actually switch on merging, as mentioned in the description. |
d567da2 to
4254825
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
| /// Enabling a feature more than once is a no-op. | ||
| /// To avoid this warning, remove the second `feature()` attribute. | ||
| pub DUPLICATE_FEATURES, | ||
| Warn, |
There was a problem hiding this comment.
could you make this deny-by-default?
|
|
||
| #![feature(rustdoc_internals)] | ||
| #![feature(rustdoc_internals)] //~ ERROR | ||
| #![feature(rustdoc_internals)] //~ WARN duplicate |
|
☔ The latest upstream changes (presumably #153278) made this pull request unmergeable. Please resolve the merge conflicts. |
This is only the changes needed to allow merging the tests. This doesn't actually turn doctest merging on in bootstrap. I think that might be a useful follow-up, since it makes them much faster to run, but it's not without downsides because it means we'll no longer be testing that doctests have all necessary
feature()attributes.The motivation for this change is to run the tests with
-C instrument-coverageand then generate a coverage report from the output. Currently, this is very expensive because it requires parsing DWARF for each doctest binary. Merging the binaries decreases the time taken from several hours to ~30 seconds.There are several parts to this change, most of which are independent and I'm happy to split out into other PRs.
-C panic=abort. Ferrocene needs this downstream for complicated reasons; it's a one-line change so I figured it's not a big deal.allow(incomplete_features)as a crate-level attribute, just likeinternal_features. Without this, it's possible to get hard errors if rustdoc lifts features to the crate level but notallows.--merge-doctests=yes. In particular, I removed a few$crateusages and explicitly marked a few doctests asstandalone_crate.