about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/ArchiveWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-11-02 11:03:30 +0000
committerbors <bors@rust-lang.org>2024-11-02 11:03:30 +0000
commit5c6fe68c006b83eeef0f7f0213cf04c7865f7585 (patch)
treea7f162f6ff281063233fc4dc2cd8fe824e7c6d81 /compiler/rustc_llvm/llvm-wrapper/ArchiveWrapper.cpp
parente8b78e2f665247a7814c24dd776f8a75021e4e85 (diff)
parentf7ab2c990889b5f0b539cadbb808763d992b790e (diff)
downloadrust-5c6fe68c006b83eeef0f7f0213cf04c7865f7585.tar.gz
rust-5c6fe68c006b83eeef0f7f0213cf04c7865f7585.zip
Auto merge of #13376 - decryphe:source-ordering, r=llogiq
new lint: `source_item_ordering`

changelog: [`source_item_ordering`]: Introduced a new restriction lint that checks the ordering of items in Modules, Enums, Structs, Impls and Traits.

From the written documentation:

> Why restrict this?
> Keeping a consistent ordering throughout the codebase helps with working as a team, and possibly improves maintainability of the codebase. The idea is that by defining a consistent and enforceable rule for how source files are structured, less time will be wasted during reviews on a topic that is (under most circumstances) not relevant to the logic implemented in the code. Sometimes this will be referred to as "bike-shedding".
>
> Keep in mind, that ordering source code alphabetically can lead to reduced performance in cases where the most commonly used enum variant isn't the first entry anymore, and similar optimizations that can reduce branch misses, cache locality and such. Either don't use this lint if that's relevant, or disable the lint in modules or items specifically where it matters. Other solutions can be to use profile guided optimization (PGO), or other advanced optimization methods.

I tried to build it as configurable as possible, as such a highly opinionated lint should be adjustable to personal opinions.

I'm open to any input and will be available both here and on the zulip for communication. In the meantime I'll be testing this lint against my own code-bases, which I've (manually) kept ordered with the default config, to see how well it works in practice.

And lastly, a big thanks to the community for making clippy the best linter there is!
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/ArchiveWrapper.cpp')
0 files changed, 0 insertions, 0 deletions