Skip to content

Commit 94e3551

Browse files
committed
Fix #4748 - Deprecated lints don't expand
- Move doc comments inside of declare_deprecated_lint macros so that they are picked up by lintlib.py
1 parent 000c3ff commit 94e3551

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

clippy_lints/src/deprecated_lints.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,85 +4,85 @@ macro_rules! declare_deprecated_lint {
44
}
55
}
66

7+
declare_deprecated_lint! {
78
/// **What it does:** Nothing. This lint has been deprecated.
89
///
910
/// **Deprecation reason:** This used to check for `assert!(a == b)` and recommend
1011
/// replacement with `assert_eq!(a, b)`, but this is no longer needed after RFC 2011.
11-
declare_deprecated_lint! {
1212
pub SHOULD_ASSERT_EQ,
1313
"`assert!()` will be more flexible with RFC 2011"
1414
}
1515

16+
declare_deprecated_lint! {
1617
/// **What it does:** Nothing. This lint has been deprecated.
1718
///
1819
/// **Deprecation reason:** This used to check for `Vec::extend`, which was slower than
1920
/// `Vec::extend_from_slice`. Thanks to specialization, this is no longer true.
20-
declare_deprecated_lint! {
2121
pub EXTEND_FROM_SLICE,
2222
"`.extend_from_slice(_)` is a faster way to extend a Vec by a slice"
2323
}
2424

25+
declare_deprecated_lint! {
2526
/// **What it does:** Nothing. This lint has been deprecated.
2627
///
2728
/// **Deprecation reason:** `Range::step_by(0)` used to be linted since it's
2829
/// an infinite iterator, which is better expressed by `iter::repeat`,
2930
/// but the method has been removed for `Iterator::step_by` which panics
3031
/// if given a zero
31-
declare_deprecated_lint! {
3232
pub RANGE_STEP_BY_ZERO,
3333
"`iterator.step_by(0)` panics nowadays"
3434
}
3535

36+
declare_deprecated_lint! {
3637
/// **What it does:** Nothing. This lint has been deprecated.
3738
///
3839
/// **Deprecation reason:** This used to check for `Vec::as_slice`, which was unstable with good
3940
/// stable alternatives. `Vec::as_slice` has now been stabilized.
40-
declare_deprecated_lint! {
4141
pub UNSTABLE_AS_SLICE,
4242
"`Vec::as_slice` has been stabilized in 1.7"
4343
}
4444

45-
45+
declare_deprecated_lint! {
4646
/// **What it does:** Nothing. This lint has been deprecated.
4747
///
4848
/// **Deprecation reason:** This used to check for `Vec::as_mut_slice`, which was unstable with good
4949
/// stable alternatives. `Vec::as_mut_slice` has now been stabilized.
50-
declare_deprecated_lint! {
5150
pub UNSTABLE_AS_MUT_SLICE,
5251
"`Vec::as_mut_slice` has been stabilized in 1.7"
5352
}
5453

54+
declare_deprecated_lint! {
5555
/// **What it does:** Nothing. This lint has been deprecated.
5656
///
5757
/// **Deprecation reason:** This used to check for `.to_string()` method calls on values
5858
/// of type `&str`. This is not unidiomatic and with specialization coming, `to_string` could be
5959
/// specialized to be as efficient as `to_owned`.
60-
declare_deprecated_lint! {
6160
pub STR_TO_STRING,
6261
"using `str::to_string` is common even today and specialization will likely happen soon"
6362
}
6463

64+
declare_deprecated_lint! {
6565
/// **What it does:** Nothing. This lint has been deprecated.
6666
///
6767
/// **Deprecation reason:** This used to check for `.to_string()` method calls on values
6868
/// of type `String`. This is not unidiomatic and with specialization coming, `to_string` could be
6969
/// specialized to be as efficient as `clone`.
70-
declare_deprecated_lint! {
7170
pub STRING_TO_STRING,
7271
"using `string::to_string` is common even today and specialization will likely happen soon"
7372
}
7473

74+
declare_deprecated_lint! {
7575
/// **What it does:** Nothing. This lint has been deprecated.
7676
///
7777
/// **Deprecation reason:** This lint should never have applied to non-pointer types, as transmuting
7878
/// between non-pointer types of differing alignment is well-defined behavior (it's semantically
7979
/// equivalent to a memcpy). This lint has thus been refactored into two separate lints:
8080
/// cast_ptr_alignment and transmute_ptr_to_ptr.
81-
declare_deprecated_lint! {
8281
pub MISALIGNED_TRANSMUTE,
8382
"this lint has been split into cast_ptr_alignment and transmute_ptr_to_ptr"
8483
}
8584

85+
declare_deprecated_lint! {
8686
/// **What it does:** Nothing. This lint has been deprecated.
8787
///
8888
/// **Deprecation reason:** This lint is too subjective, not having a good reason for being in clippy.
@@ -93,40 +93,40 @@ declare_deprecated_lint! {
9393
"using compound assignment operators (e.g., `+=`) is harmless"
9494
}
9595

96+
declare_deprecated_lint! {
9697
/// **What it does:** Nothing. This lint has been deprecated.
9798
///
9899
/// **Deprecation reason:** The original rule will only lint for `if let`. After
99100
/// making it support to lint `match`, naming as `if let` is not suitable for it.
100101
/// So, this lint is deprecated.
101-
declare_deprecated_lint! {
102102
pub IF_LET_REDUNDANT_PATTERN_MATCHING,
103103
"this lint has been changed to redundant_pattern_matching"
104104
}
105105

106+
declare_deprecated_lint! {
106107
/// **What it does:** Nothing. This lint has been deprecated.
107108
///
108109
/// **Deprecation reason:** This lint used to suggest replacing `let mut vec =
109110
/// Vec::with_capacity(n); vec.set_len(n);` with `let vec = vec![0; n];`. The
110111
/// replacement has very different performance characteristics so the lint is
111112
/// deprecated.
112-
declare_deprecated_lint! {
113113
pub UNSAFE_VECTOR_INITIALIZATION,
114114
"the replacement suggested by this lint had substantially different behavior"
115115
}
116116

117+
declare_deprecated_lint! {
117118
/// **What it does:** Nothing. This lint has been deprecated.
118119
///
119120
/// **Deprecation reason:** This lint has been superseded by the warn-by-default
120121
/// `invalid_value` rustc lint.
121-
declare_deprecated_lint! {
122122
pub INVALID_REF,
123123
"superseded by rustc lint `invalid_value`"
124124
}
125125

126+
declare_deprecated_lint! {
126127
/// **What it does:** Nothing. This lint has been deprecated.
127128
///
128129
/// **Deprecation reason:** This lint has been superseded by #[must_use] in rustc.
129-
declare_deprecated_lint! {
130130
pub UNUSED_COLLECT,
131131
"`collect` has been marked as #[must_use] in rustc and that covers all cases of this lint"
132132
}

0 commit comments

Comments
 (0)