@@ -9,15 +9,25 @@ use rustc_session::{declare_lint_pass, declare_tool_lint};
9
9
declare_clippy_lint ! {
10
10
/// ### What it does
11
11
/// When sorting primitive values (integers, bools, chars, as well
12
- /// as arrays, slices, and tuples of such items), it is better to
12
+ /// as arrays, slices, and tuples of such items), it is typically better to
13
13
/// use an unstable sort than a stable sort.
14
14
///
15
15
/// ### Why is this bad?
16
- /// Using a stable sort consumes more memory and cpu cycles. Because
17
- /// values which compare equal are identical, preserving their
16
+ /// Typically, using a stable sort consumes more memory and cpu cycles.
17
+ /// Because values which compare equal are identical, preserving their
18
18
/// relative order (the guarantee that a stable sort provides) means
19
19
/// nothing, while the extra costs still apply.
20
20
///
21
+ /// ### Known problems
22
+ ///
23
+ /// As pointed out in
24
+ /// [issue #8241](https://github.com/rust-lang/rust-clippy/issues/8241),
25
+ /// a stable sort can instead be significantly faster for certain scenarios
26
+ /// (eg. when a sorted vector is extended with new data and resorted).
27
+ ///
28
+ /// For more information and benchmarking results, please refer to the
29
+ /// issue linked above.
30
+ ///
21
31
/// ### Example
22
32
/// ```rust
23
33
/// let mut vec = vec![2, 1, 3];
0 commit comments