Skip to content

Commit b46da06

Browse files
committed
fixup! new lint: source_item_ordering
1 parent c3d7e2b commit b46da06

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

clippy_lints/src/arbitrary_source_item_ordering.rs

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,6 @@ declare_clippy_lint! {
2626
/// implemented in the code. Sometimes this will be referred to as
2727
/// "bikeshedding".
2828
///
29-
/// Keep in mind, that ordering source code alphabetically can lead to
30-
/// reduced performance in cases where the most commonly used enum variant
31-
/// isn't the first entry anymore, and similar optimizations that can reduce
32-
/// branch misses, cache locality and such. Either don't use this lint if
33-
/// that's relevant, or disable the lint in modules or items specifically
34-
/// where it matters. Other solutions can be to use profile guided
35-
/// optimization (PGO), or other advanced optimization methods.
36-
///
3729
/// ### Default Ordering and Configuration
3830
///
3931
/// As there is no generally applicable rule, and each project may have
@@ -68,7 +60,19 @@ declare_clippy_lint! {
6860
/// All item kinds must be accounted for to create an enforceable linting
6961
/// rule set.
7062
///
71-
/// ### Known Issues and Limitations
63+
/// ### Known Problems
64+
///
65+
/// #### Performance Impact
66+
///
67+
/// Keep in mind, that ordering source code alphabetically can lead to
68+
/// reduced performance in cases where the most commonly used enum variant
69+
/// isn't the first entry anymore, and similar optimizations that can reduce
70+
/// branch misses, cache locality and such. Either don't use this lint if
71+
/// that's relevant, or disable the lint in modules or items specifically
72+
/// where it matters. Other solutions can be to use profile guided
73+
/// optimization (PGO), post-link optimization (e.g. using BOLT for LLVM),
74+
/// or other advanced optimization methods. A good starting point to dig
75+
/// into optimization is [cargo-pgo].
7276
///
7377
/// #### Lints on a Contains basis
7478
///
@@ -119,6 +123,8 @@ declare_clippy_lint! {
119123
/// }
120124
/// ```
121125
///
126+
/// [cargo-pgo]: https://github.com/Kobzol/cargo-pgo/blob/main/README.md
127+
///
122128
#[clippy::version = "1.81.0"]
123129
pub ARBITRARY_SOURCE_ITEM_ORDERING,
124130
restriction,

0 commit comments

Comments
 (0)