Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do
Right now
cargo fmt
is broken, CI admits it calling format on each individual file:cargo fmt --all -- --check **/*.rs
. Second commit shows that CI was not actually enforcing formatting across all the files. This breaks workflow of writing code as is and letting your editor to deal with formatting on save or hotkey.The problem is caused by the
feature!
macro.rustfmt
does not perform any macro expansion and ignores everything inside of any unknown macro, in fact nothing inside of thefeature!
macro blocks is formatted. This includes scanning for child modules.feature!
macro is used to lock some parts of the library behind features as well as explicitly document that in rustdoc using nightly featuredoc_cfg
.This PR proposes a potential alternative - I replaced some of the
feature!
macro invocation with plain#[cfg(feature ...)]
invocation and implicit feature documentation using a different nightly feature:doc_auto_cfg
. Downside (or an upside) is that documentation will contain the actual combination of feature flags and target platforms, for example features fordir
fromdir
becomesNon-Redox and dir
.If we agree that this is a way forward - I'll remove all the remaining uses of
feature!
macro and remove it. It might cause some merge conflicts.Checklist:
CONTRIBUTING.md