Skip to content

Commit d7a532c

Browse files
committed
Copying the depreciation reason to store.register_removed
1 parent 90edfd5 commit d7a532c

File tree

1 file changed

+34
-13
lines changed

1 file changed

+34
-13
lines changed

clippy_lints/src/lib.rs

Lines changed: 34 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -447,59 +447,80 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
447447
// begin deprecated lints, do not remove this comment, it’s used in `update_lints`
448448
store.register_removed(
449449
"clippy::should_assert_eq",
450-
"`assert!()` will be more flexible with RFC 2011",
450+
"This used to check for `assert!(a == b)` and recommend replacement with \
451+
`assert_eq!(a, b)`, but this is no longer needed after \
452+
[RFC 2011](https://rust-lang.github.io/rfcs/2011-generic-assert.html).",
451453
);
452454
store.register_removed(
453455
"clippy::extend_from_slice",
454-
"`.extend_from_slice(_)` is a faster way to extend a Vec by a slice",
456+
"This used to check for `Vec::extend`, which was slower than \
457+
`Vec::extend_from_slice`. Thanks to specialization, this is no longer true.",
455458
);
456459
store.register_removed(
457460
"clippy::range_step_by_zero",
458-
"`iterator.step_by(0)` panics nowadays",
461+
"`Range::step_by(0)` used to be linted since it's \
462+
an infinite iterator, which is better expressed by `iter::repeat`, \
463+
but the method has been removed for `Iterator::step_by` which panics \
464+
if given a zero",
459465
);
460466
store.register_removed(
461467
"clippy::unstable_as_slice",
462-
"`Vec::as_slice` has been stabilized in 1.7",
468+
"This used to check for `Vec::as_slice`, which was unstable with good \
469+
stable alternatives. `Vec::as_slice` has now been stabilized.",
463470
);
464471
store.register_removed(
465472
"clippy::unstable_as_mut_slice",
466-
"`Vec::as_mut_slice` has been stabilized in 1.7",
473+
"This used to check for `Vec::as_mut_slice`, which was unstable with good \
474+
stable alternatives. `Vec::as_mut_slice` has now been stabilized.",
467475
);
468476
store.register_removed(
469477
"clippy::misaligned_transmute",
470-
"this lint has been split into cast_ptr_alignment and transmute_ptr_to_ptr",
478+
"This lint should never have applied to non-pointer types, as transmuting \
479+
between non-pointer types of differing alignment is well-defined behavior \
480+
(it's semantically equivalent to a memcpy). This lint has thus been \
481+
refactored into two separate lints: `clippy::cast_ptr_alignment` and \
482+
`clippy::transmute_ptr_to_ptr`.",
471483
);
472484
store.register_removed(
473485
"clippy::assign_ops",
474-
"using compound assignment operators (e.g., `+=`) is harmless",
486+
"This lint is too subjective, not having a good reason for being in clippy. \
487+
Additionally, compound assignment operators may be overloaded separately \
488+
from their non-assigning counterparts, so this lint may suggest a change \
489+
in behavior or the code may not compile.",
475490
);
476491
store.register_removed(
477492
"clippy::if_let_redundant_pattern_matching",
478-
"this lint has been changed to redundant_pattern_matching",
493+
"The original rule will only lint for `if let`. After making it support \
494+
to lint `match`, naming as `if let` is not suitable for it. So, this lint \
495+
is deprecated.",
479496
);
480497
store.register_removed(
481498
"clippy::unsafe_vector_initialization",
482-
"the replacement suggested by this lint had substantially different behavior",
499+
"This lint used to suggest replacing \
500+
`let mut vec = Vec::with_capacity(n); vec.set_len(n);` with \
501+
`let vec = vec![0; n];`. The replacement has very different \
502+
performance characteristics so the lint is deprecated.",
483503
);
484504
store.register_removed(
485505
"clippy::unused_collect",
486-
"`collect` has been marked as #[must_use] in rustc and that covers all cases of this lint",
506+
"This lint has been superseded by #[must_use] in rustc.",
487507
);
488508
store.register_removed(
489509
"clippy::replace_consts",
490-
"associated-constants `MIN`/`MAX` of integers are preferred to `{min,max}_value()` and module constants",
510+
"associated-constants `MIN`/`MAX` of integers are preferred to \
511+
`{min,max}_value()` and module constants",
491512
);
492513
store.register_removed(
493514
"clippy::regex_macro",
494515
"the regex! macro has been removed from the regex crate in 2018",
495516
);
496517
store.register_removed(
497518
"clippy::find_map",
498-
"this lint has been replaced by `manual_find_map`, a more specific lint",
519+
"This lint has been replaced by `manual_find_map`, a more specific lint.",
499520
);
500521
store.register_removed(
501522
"clippy::filter_map",
502-
"this lint has been replaced by `manual_filter_map`, a more specific lint",
523+
"This lint has been replaced by `manual_filter_map`, a more specific lint.",
503524
);
504525
// end deprecated lints, do not remove this comment, it’s used in `update_lints`
505526

0 commit comments

Comments
 (0)