]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/lib.rs
Merge branch 'macro-use' into HEAD
[rust.git] / clippy_lints / src / lib.rs
index 87781e4e5f7a6485a1beccc3e595c416eb34a9f7..8ff0e1852c3db51f6a1fe5f1120d47371ab3be74 100644 (file)
@@ -1,63 +1,22 @@
 // error-pattern:cargo-clippy
 
 #![feature(box_syntax)]
-#![feature(custom_attribute)]
 #![feature(rustc_private)]
 #![feature(slice_patterns)]
 #![feature(stmt_expr_attributes)]
-#![feature(conservative_impl_trait)]
 #![feature(range_contains)]
 #![feature(macro_vis_matcher)]
-#![allow(unknown_lints, indexing_slicing, shadow_reuse, missing_docs_in_private_items)]
+#![allow(unknown_lints, shadow_reuse, missing_docs_in_private_items)]
 #![recursion_limit = "256"]
-// FIXME(mark-i-m) remove after i128 stablization merges
 #![allow(stable_features)]
-#![feature(i128, i128_type)]
+#![feature(iterator_find_map)]
+#![feature(macro_at_most_once_rep)]
+#![feature(rust_2018_preview)]
+#![warn(rust_2018_idioms)]
 
-#[macro_use]
-extern crate rustc;
-extern crate rustc_typeck;
-extern crate syntax;
-extern crate syntax_pos;
-
-extern crate toml;
-
-// for unicode nfc normalization
-
-extern crate unicode_normalization;
-
-// for semver check in attrs.rs
-
-extern crate semver;
+use toml;
+use rustc_plugin;
 
-// for regex checking
-
-extern crate regex_syntax;
-
-// for finding minimal boolean expressions
-
-extern crate quine_mc_cluskey;
-
-extern crate rustc_const_math;
-extern crate rustc_errors;
-extern crate rustc_plugin;
-
-#[macro_use]
-extern crate matches as matches_macro;
-
-extern crate serde;
-#[macro_use]
-extern crate serde_derive;
-
-#[macro_use]
-extern crate lazy_static;
-
-extern crate itertools;
-extern crate pulldown_cmark;
-extern crate url;
-
-#[macro_use]
-extern crate if_chain;
 
 macro_rules! declare_clippy_lint {
     { pub $name:tt, style, $description:tt } => {
@@ -78,6 +37,9 @@ macro_rules! declare_clippy_lint {
     { pub $name:tt, restriction, $description:tt } => {
         declare_lint! { pub $name, Allow, $description }
     };
+    { pub $name:tt, cargo, $description:tt } => {
+        declare_lint! { pub $name, Allow, $description }
+    };
     { pub $name:tt, nursery, $description:tt } => {
         declare_lint! { pub $name, Allow, $description }
     };
@@ -96,7 +58,6 @@ macro_rules! declare_clippy_lint {
 // begin lints modules, do not remove this comment, it’s used in `update_lints`
 pub mod approx_const;
 pub mod arithmetic;
-pub mod array_indexing;
 pub mod assign_ops;
 pub mod attrs;
 pub mod bit_mask;
@@ -108,11 +69,13 @@ macro_rules! declare_clippy_lint {
 pub mod const_static_lifetime;
 pub mod copies;
 pub mod cyclomatic_complexity;
+pub mod default_trait_access;
 pub mod derive;
 pub mod doc;
 pub mod double_comparison;
 pub mod double_parens;
 pub mod drop_forget_ref;
+pub mod duration_subsec;
 pub mod else_if_without_else;
 pub mod empty_enum;
 pub mod entry;
@@ -124,6 +87,7 @@ macro_rules! declare_clippy_lint {
 pub mod escape;
 pub mod eta_reduction;
 pub mod eval_order_dependence;
+pub mod excessive_precision;
 pub mod explicit_write;
 pub mod fallible_impl_from;
 pub mod format;
@@ -133,7 +97,10 @@ macro_rules! declare_clippy_lint {
 pub mod identity_op;
 pub mod if_let_redundant_pattern_matching;
 pub mod if_not_else;
+pub mod indexing_slicing;
+pub mod infallible_destructuring_match;
 pub mod infinite_iter;
+pub mod inherent_impl;
 pub mod inline_fn_without_body;
 pub mod int_plus_one;
 pub mod invalid_ref;
@@ -145,7 +112,7 @@ macro_rules! declare_clippy_lint {
 pub mod literal_representation;
 pub mod loops;
 pub mod map_clone;
-pub mod option_map_unit_fn;
+pub mod map_unit_fn;
 pub mod matches;
 pub mod mem_forget;
 pub mod methods;
@@ -153,6 +120,8 @@ macro_rules! declare_clippy_lint {
 pub mod misc;
 pub mod misc_early;
 pub mod missing_doc;
+pub mod missing_inline;
+pub mod multiple_crate_versions;
 pub mod mut_mut;
 pub mod mut_reference;
 pub mod mutex_atomic;
@@ -162,14 +131,16 @@ macro_rules! declare_clippy_lint {
 pub mod needless_continue;
 pub mod needless_pass_by_value;
 pub mod needless_update;
+pub mod neg_cmp_op_on_partial_ord;
 pub mod neg_multiply;
 pub mod new_without_default;
 pub mod no_effect;
+pub mod non_copy_const;
 pub mod non_expressive_names;
 pub mod ok_if_let;
 pub mod open_options;
 pub mod overflow_check_conditional;
-pub mod panic;
+pub mod panic_unimplemented;
 pub mod partialeq_ne_impl;
 pub mod precedence;
 pub mod ptr;
@@ -187,11 +158,13 @@ macro_rules! declare_clippy_lint {
 pub mod swap;
 pub mod temporary_assignment;
 pub mod transmute;
+pub mod trivially_copy_pass_by_ref;
 pub mod types;
 pub mod unicode;
 pub mod unsafe_removed_from_name;
 pub mod unused_io_amount;
 pub mod unused_label;
+pub mod unwrap;
 pub mod use_self;
 pub mod vec;
 pub mod write;
@@ -199,7 +172,7 @@ macro_rules! declare_clippy_lint {
 // end lints modules, do not remove this comment, it’s used in `update_lints`
 
 mod reexport {
-    pub use syntax::ast::{Name, NodeId};
+    crate use syntax::ast::{Name, NodeId};
 }
 
 #[cfg_attr(rustfmt, rustfmt_skip)]
@@ -294,6 +267,7 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry) {
     reg.register_early_lint_pass(box enum_variants::EnumVariantNames::new(conf.enum_variant_name_threshold));
     reg.register_late_lint_pass(box enum_glob_use::EnumGlobUse);
     reg.register_late_lint_pass(box enum_clike::UnportableVariant);
+    reg.register_late_lint_pass(box excessive_precision::ExcessivePrecision);
     reg.register_late_lint_pass(box bit_mask::BitMask::new(conf.verbose_bit_mask_threshold));
     reg.register_late_lint_pass(box ptr::PointerPass);
     reg.register_late_lint_pass(box needless_bool::NeedlessBool);
@@ -342,8 +316,7 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry) {
     );
     reg.register_late_lint_pass(box escape::Pass{too_large_for_stack: conf.too_large_for_stack});
     reg.register_early_lint_pass(box misc_early::MiscEarly);
-    reg.register_late_lint_pass(box array_indexing::ArrayIndexing);
-    reg.register_late_lint_pass(box panic::Pass);
+    reg.register_late_lint_pass(box panic_unimplemented::Pass);
     reg.register_late_lint_pass(box strings::StringLitAsBytes);
     reg.register_late_lint_pass(box derive::Derive);
     reg.register_late_lint_pass(box types::CharLitAsU8);
@@ -378,15 +351,21 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry) {
     reg.register_late_lint_pass(box let_if_seq::LetIfSeq);
     reg.register_late_lint_pass(box eval_order_dependence::EvalOrderDependence);
     reg.register_late_lint_pass(box missing_doc::MissingDoc::new());
+    reg.register_late_lint_pass(box missing_inline::MissingInline);
     reg.register_late_lint_pass(box ok_if_let::Pass);
     reg.register_late_lint_pass(box if_let_redundant_pattern_matching::Pass);
     reg.register_late_lint_pass(box partialeq_ne_impl::Pass);
     reg.register_early_lint_pass(box reference::Pass);
+    reg.register_early_lint_pass(box reference::DerefPass);
     reg.register_early_lint_pass(box double_parens::DoubleParens);
     reg.register_late_lint_pass(box unused_io_amount::UnusedIoAmount);
     reg.register_late_lint_pass(box large_enum_variant::LargeEnumVariant::new(conf.enum_variant_size_threshold));
     reg.register_late_lint_pass(box explicit_write::Pass);
     reg.register_late_lint_pass(box needless_pass_by_value::NeedlessPassByValue);
+    reg.register_late_lint_pass(box trivially_copy_pass_by_ref::TriviallyCopyPassByRef::new(
+            conf.trivial_copy_size_limit,
+            &reg.sess.target,
+    ));
     reg.register_early_lint_pass(box literal_representation::LiteralDigitGrouping);
     reg.register_early_lint_pass(box literal_representation::LiteralRepresentation::new(
             conf.literal_representation_threshold
@@ -406,15 +385,23 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry) {
     reg.register_late_lint_pass(box question_mark::QuestionMarkPass);
     reg.register_late_lint_pass(box suspicious_trait_impl::SuspiciousImpl);
     reg.register_late_lint_pass(box redundant_field_names::RedundantFieldNames);
-    reg.register_late_lint_pass(box option_map_unit_fn::Pass);
-
+    reg.register_early_lint_pass(box multiple_crate_versions::Pass);
+    reg.register_late_lint_pass(box map_unit_fn::Pass);
+    reg.register_late_lint_pass(box infallible_destructuring_match::Pass);
+    reg.register_late_lint_pass(box inherent_impl::Pass::default());
+    reg.register_late_lint_pass(box neg_cmp_op_on_partial_ord::NoNegCompOpForPartialOrd);
+    reg.register_late_lint_pass(box unwrap::Pass);
+    reg.register_late_lint_pass(box duration_subsec::DurationSubsec);
+    reg.register_late_lint_pass(box default_trait_access::DefaultTraitAccess);
+    reg.register_late_lint_pass(box indexing_slicing::IndexingSlicing);
+    reg.register_late_lint_pass(box non_copy_const::NonCopyConst);
 
     reg.register_lint_group("clippy_restriction", vec![
         arithmetic::FLOAT_ARITHMETIC,
         arithmetic::INTEGER_ARITHMETIC,
-        array_indexing::INDEXING_SLICING,
         assign_ops::ASSIGN_OPS,
         else_if_without_else::ELSE_IF_WITHOUT_ELSE,
+        inherent_impl::MULTIPLE_INHERENT_IMPL,
         literal_representation::DECIMAL_LITERAL_REPRESENTATION,
         mem_forget::MEM_FORGET,
         methods::CLONE_ON_REF_PTR,
@@ -423,17 +410,20 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry) {
         methods::WRONG_PUB_SELF_CONVENTION,
         misc::FLOAT_CMP_CONST,
         missing_doc::MISSING_DOCS_IN_PRIVATE_ITEMS,
-        write::PRINT_STDOUT,
-        write::USE_DEBUG,
+        missing_inline::MISSING_INLINE_IN_PUBLIC_ITEMS,
+        panic_unimplemented::UNIMPLEMENTED,
         shadow::SHADOW_REUSE,
         shadow::SHADOW_SAME,
         shadow::SHADOW_UNRELATED,
         strings::STRING_ADD,
+        write::PRINT_STDOUT,
+        write::USE_DEBUG,
     ]);
 
     reg.register_lint_group("clippy_pedantic", vec![
         attrs::INLINE_ALWAYS,
         copies::MATCH_SAME_ARMS,
+        default_trait_access::DEFAULT_TRAIT_ACCESS,
         derive::EXPL_IMPL_CLONE_ON_COPY,
         doc::DOC_MARKDOWN,
         empty_enum::EMPTY_ENUM,
@@ -441,9 +431,9 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry) {
         enum_variants::PUB_ENUM_VARIANT_NAMES,
         enum_variants::STUTTER,
         if_not_else::IF_NOT_ELSE,
+        indexing_slicing::INDEXING_SLICING,
         infinite_iter::MAYBE_INFINITE_ITER,
         items_after_statements::ITEMS_AFTER_STATEMENTS,
-        option_map_unit_fn::OPTION_MAP_UNIT_FN,
         matches::SINGLE_MATCH_ELSE,
         methods::FILTER_MAP,
         methods::OPTION_MAP_UNWRAP_OR,
@@ -474,7 +464,6 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry) {
 
     reg.register_lint_group("clippy", vec![
         approx_const::APPROX_CONSTANT,
-        array_indexing::OUT_OF_BOUNDS_INDEXING,
         assign_ops::ASSIGN_OP_PATTERN,
         assign_ops::MISREFACTORED_ASSIGN_OP,
         attrs::DEPRECATED_SEMVER,
@@ -500,6 +489,7 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry) {
         drop_forget_ref::DROP_REF,
         drop_forget_ref::FORGET_COPY,
         drop_forget_ref::FORGET_REF,
+        duration_subsec::DURATION_SUBSEC,
         entry::MAP_ENTRY,
         enum_clike::ENUM_CLIKE_UNPORTABLE_VARIANT,
         enum_variants::ENUM_VARIANT_NAMES,
@@ -511,6 +501,7 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry) {
         eta_reduction::REDUNDANT_CLOSURE,
         eval_order_dependence::DIVERGING_SUB_EXPRESSION,
         eval_order_dependence::EVAL_ORDER_DEPENDENCE,
+        excessive_precision::EXCESSIVE_PRECISION,
         explicit_write::EXPLICIT_WRITE,
         format::USELESS_FORMAT,
         formatting::POSSIBLE_MISSING_COMMA,
@@ -521,6 +512,8 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry) {
         identity_conversion::IDENTITY_CONVERSION,
         identity_op::IDENTITY_OP,
         if_let_redundant_pattern_matching::IF_LET_REDUNDANT_PATTERN_MATCHING,
+        indexing_slicing::OUT_OF_BOUNDS_INDEXING,
+        infallible_destructuring_match::INFALLIBLE_DESTRUCTURING_MATCH,
         infinite_iter::INFINITE_ITER,
         inline_fn_without_body::INLINE_FN_WITHOUT_BODY,
         int_plus_one::INT_PLUS_ONE,
@@ -529,8 +522,8 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry) {
         len_zero::LEN_WITHOUT_IS_EMPTY,
         len_zero::LEN_ZERO,
         let_if_seq::USELESS_LET_IF_SEQ,
+        lifetimes::EXTRA_UNUSED_LIFETIMES,
         lifetimes::NEEDLESS_LIFETIMES,
-        lifetimes::UNUSED_LIFETIMES,
         literal_representation::INCONSISTENT_DIGIT_GROUPING,
         literal_representation::LARGE_DIGIT_GROUPS,
         literal_representation::UNREADABLE_LITERAL,
@@ -552,6 +545,8 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry) {
         loops::WHILE_LET_LOOP,
         loops::WHILE_LET_ON_ITERATOR,
         map_clone::MAP_CLONE,
+        map_unit_fn::OPTION_MAP_UNIT_FN,
+        map_unit_fn::RESULT_MAP_UNIT_FN,
         matches::MATCH_AS_REF,
         matches::MATCH_BOOL,
         matches::MATCH_OVERLAPPING_ARM,
@@ -562,6 +557,7 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry) {
         methods::CHARS_NEXT_CMP,
         methods::CLONE_DOUBLE_REF,
         methods::CLONE_ON_COPY,
+        methods::EXPECT_FUN_CALL,
         methods::FILTER_NEXT,
         methods::GET_UNWRAP,
         methods::ITER_CLONED_COLLECT,
@@ -602,22 +598,22 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry) {
         needless_borrowed_ref::NEEDLESS_BORROWED_REFERENCE,
         needless_pass_by_value::NEEDLESS_PASS_BY_VALUE,
         needless_update::NEEDLESS_UPDATE,
+        neg_cmp_op_on_partial_ord::NEG_CMP_OP_ON_PARTIAL_ORD,
         neg_multiply::NEG_MULTIPLY,
         new_without_default::NEW_WITHOUT_DEFAULT,
         new_without_default::NEW_WITHOUT_DEFAULT_DERIVE,
         no_effect::NO_EFFECT,
         no_effect::UNNECESSARY_OPERATION,
+        non_copy_const::BORROW_INTERIOR_MUTABLE_CONST,
+        non_copy_const::DECLARE_INTERIOR_MUTABLE_CONST,
         non_expressive_names::JUST_UNDERSCORES_AND_DIGITS,
         non_expressive_names::MANY_SINGLE_CHAR_NAMES,
         ok_if_let::IF_LET_SOME_RESULT,
         open_options::NONSENSICAL_OPEN_OPTIONS,
         overflow_check_conditional::OVERFLOW_CHECK_CONDITIONAL,
-        panic::PANIC_PARAMS,
+        panic_unimplemented::PANIC_PARAMS,
         partialeq_ne_impl::PARTIALEQ_NE_IMPL,
         precedence::PRECEDENCE,
-        write::PRINT_LITERAL,
-        write::PRINT_WITH_NEWLINE,
-        write::PRINTLN_EMPTY_STRING,
         ptr::CMP_NULL,
         ptr::MUT_FROM_REF,
         ptr::PTR_ARG,
@@ -627,6 +623,7 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry) {
         ranges::RANGE_ZIP_WITH_LEN,
         redundant_field_names::REDUNDANT_FIELD_NAMES,
         reference::DEREF_ADDROF,
+        reference::REF_IN_DEREF,
         regex::INVALID_REGEX,
         regex::REGEX_MACRO,
         regex::TRIVIAL_REGEX,
@@ -644,16 +641,19 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry) {
         transmute::TRANSMUTE_INT_TO_BOOL,
         transmute::TRANSMUTE_INT_TO_CHAR,
         transmute::TRANSMUTE_INT_TO_FLOAT,
-        transmute::TRANSMUTE_PTR_TO_REF,
         transmute::TRANSMUTE_PTR_TO_PTR,
+        transmute::TRANSMUTE_PTR_TO_REF,
         transmute::USELESS_TRANSMUTE,
         transmute::WRONG_TRANSMUTE,
+        trivially_copy_pass_by_ref::TRIVIALLY_COPY_PASS_BY_REF,
         types::ABSURD_EXTREME_COMPARISONS,
         types::BORROWED_BOX,
         types::BOX_VEC,
         types::CAST_LOSSLESS,
         types::CAST_PTR_ALIGNMENT,
         types::CHAR_LIT_AS_U8,
+        types::FN_TO_NUMERIC_CAST,
+        types::FN_TO_NUMERIC_CAST_WITH_TRUNCATION,
         types::IMPLICIT_HASHER,
         types::LET_UNIT_VALUE,
         types::OPTION_OPTION,
@@ -666,6 +666,12 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry) {
         unused_io_amount::UNUSED_IO_AMOUNT,
         unused_label::UNUSED_LABEL,
         vec::USELESS_VEC,
+        write::PRINT_LITERAL,
+        write::PRINT_WITH_NEWLINE,
+        write::PRINTLN_EMPTY_STRING,
+        write::WRITE_LITERAL,
+        write::WRITE_WITH_NEWLINE,
+        write::WRITELN_EMPTY_STRING,
         zero_div_zero::ZERO_DIVIDED_BY_ZERO,
     ]);
 
@@ -681,9 +687,11 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry) {
         enum_variants::MODULE_INCEPTION,
         eq_op::OP_REF,
         eta_reduction::REDUNDANT_CLOSURE,
+        excessive_precision::EXCESSIVE_PRECISION,
         formatting::SUSPICIOUS_ASSIGNMENT_FORMATTING,
         formatting::SUSPICIOUS_ELSE_FORMATTING,
         if_let_redundant_pattern_matching::IF_LET_REDUNDANT_PATTERN_MATCHING,
+        infallible_destructuring_match::INFALLIBLE_DESTRUCTURING_MATCH,
         len_zero::LEN_WITHOUT_IS_EMPTY,
         len_zero::LEN_ZERO,
         let_if_seq::USELESS_LET_IF_SEQ,
@@ -729,10 +737,7 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry) {
         non_expressive_names::JUST_UNDERSCORES_AND_DIGITS,
         non_expressive_names::MANY_SINGLE_CHAR_NAMES,
         ok_if_let::IF_LET_SOME_RESULT,
-        panic::PANIC_PARAMS,
-        write::PRINT_LITERAL,
-        write::PRINT_WITH_NEWLINE,
-        write::PRINTLN_EMPTY_STRING,
+        panic_unimplemented::PANIC_PARAMS,
         ptr::CMP_NULL,
         ptr::PTR_ARG,
         question_mark::QUESTION_MARK,
@@ -743,9 +748,16 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry) {
         returns::LET_AND_RETURN,
         returns::NEEDLESS_RETURN,
         strings::STRING_LIT_AS_BYTES,
+        types::FN_TO_NUMERIC_CAST,
         types::IMPLICIT_HASHER,
         types::LET_UNIT_VALUE,
         unsafe_removed_from_name::UNSAFE_REMOVED_FROM_NAME,
+        write::PRINT_LITERAL,
+        write::PRINT_WITH_NEWLINE,
+        write::PRINTLN_EMPTY_STRING,
+        write::WRITE_LITERAL,
+        write::WRITE_WITH_NEWLINE,
+        write::WRITELN_EMPTY_STRING,
     ]);
 
     reg.register_lint_group("clippy_complexity", vec![
@@ -754,6 +766,7 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry) {
         cyclomatic_complexity::CYCLOMATIC_COMPLEXITY,
         double_comparison::DOUBLE_COMPARISONS,
         double_parens::DOUBLE_PARENS,
+        duration_subsec::DURATION_SUBSEC,
         eval_order_dependence::DIVERGING_SUB_EXPRESSION,
         eval_order_dependence::EVAL_ORDER_DEPENDENCE,
         explicit_write::EXPLICIT_WRITE,
@@ -762,11 +775,13 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry) {
         identity_conversion::IDENTITY_CONVERSION,
         identity_op::IDENTITY_OP,
         int_plus_one::INT_PLUS_ONE,
+        lifetimes::EXTRA_UNUSED_LIFETIMES,
         lifetimes::NEEDLESS_LIFETIMES,
-        lifetimes::UNUSED_LIFETIMES,
         loops::EXPLICIT_COUNTER_LOOP,
         loops::MUT_RANGE_BOUND,
         loops::WHILE_LET_LOOP,
+        map_unit_fn::OPTION_MAP_UNIT_FN,
+        map_unit_fn::RESULT_MAP_UNIT_FN,
         matches::MATCH_AS_REF,
         methods::CHARS_NEXT_CMP,
         methods::CLONE_ON_COPY,
@@ -780,6 +795,7 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry) {
         needless_bool::NEEDLESS_BOOL,
         needless_borrowed_ref::NEEDLESS_BORROWED_REFERENCE,
         needless_update::NEEDLESS_UPDATE,
+        neg_cmp_op_on_partial_ord::NEG_CMP_OP_ON_PARTIAL_ORD,
         no_effect::NO_EFFECT,
         no_effect::UNNECESSARY_OPERATION,
         overflow_check_conditional::OVERFLOW_CHECK_CONDITIONAL,
@@ -787,6 +803,7 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry) {
         precedence::PRECEDENCE,
         ranges::RANGE_ZIP_WITH_LEN,
         reference::DEREF_ADDROF,
+        reference::REF_IN_DEREF,
         swap::MANUAL_SWAP,
         temporary_assignment::TEMPORARY_ASSIGNMENT,
         transmute::CROSSPOINTER_TRANSMUTE,
@@ -794,8 +811,8 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry) {
         transmute::TRANSMUTE_INT_TO_BOOL,
         transmute::TRANSMUTE_INT_TO_CHAR,
         transmute::TRANSMUTE_INT_TO_FLOAT,
-        transmute::TRANSMUTE_PTR_TO_REF,
         transmute::TRANSMUTE_PTR_TO_PTR,
+        transmute::TRANSMUTE_PTR_TO_REF,
         transmute::USELESS_TRANSMUTE,
         types::BORROWED_BOX,
         types::CAST_LOSSLESS,
@@ -810,7 +827,6 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry) {
 
     reg.register_lint_group("clippy_correctness", vec![
         approx_const::APPROX_CONSTANT,
-        array_indexing::OUT_OF_BOUNDS_INDEXING,
         attrs::DEPRECATED_SEMVER,
         attrs::USELESS_ATTRIBUTE,
         bit_mask::BAD_BIT_MASK,
@@ -828,6 +844,7 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry) {
         erasing_op::ERASING_OP,
         formatting::POSSIBLE_MISSING_COMMA,
         functions::NOT_UNSAFE_PTR_ARG_DEREF,
+        indexing_slicing::OUT_OF_BOUNDS_INDEXING,
         infinite_iter::INFINITE_ITER,
         inline_fn_without_body::INLINE_FN_WITHOUT_BODY,
         invalid_ref::INVALID_REF,
@@ -843,6 +860,8 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry) {
         misc::CMP_NAN,
         misc::FLOAT_CMP,
         misc::MODULO_ONE,
+        non_copy_const::BORROW_INTERIOR_MUTABLE_CONST,
+        non_copy_const::DECLARE_INTERIOR_MUTABLE_CONST,
         open_options::NONSENSICAL_OPEN_OPTIONS,
         ptr::MUT_FROM_REF,
         ranges::ITERATOR_STEP_BY_ZERO,
@@ -854,6 +873,7 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry) {
         transmute::WRONG_TRANSMUTE,
         types::ABSURD_EXTREME_COMPARISONS,
         types::CAST_PTR_ALIGNMENT,
+        types::FN_TO_NUMERIC_CAST_WITH_TRUNCATION,
         types::UNIT_CMP,
         unicode::ZERO_WIDTH_SPACE,
         unused_io_amount::UNUSED_IO_AMOUNT,
@@ -866,21 +886,29 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry) {
         large_enum_variant::LARGE_ENUM_VARIANT,
         loops::MANUAL_MEMCPY,
         loops::UNUSED_COLLECT,
+        methods::EXPECT_FUN_CALL,
         methods::ITER_NTH,
         methods::OR_FUN_CALL,
         methods::SINGLE_CHAR_PATTERN,
         misc::CMP_OWNED,
         mutex_atomic::MUTEX_ATOMIC,
+        trivially_copy_pass_by_ref::TRIVIALLY_COPY_PASS_BY_REF,
         types::BOX_VEC,
         vec::USELESS_VEC,
     ]);
 
+    reg.register_lint_group("clippy_cargo", vec![
+        multiple_crate_versions::MULTIPLE_CRATE_VERSIONS,
+    ]);
+
     reg.register_lint_group("clippy_nursery", vec![
         attrs::EMPTY_LINE_AFTER_OUTER_ATTR,
         fallible_impl_from::FALLIBLE_IMPL_FROM,
         mutex_atomic::MUTEX_INTEGER,
         needless_borrow::NEEDLESS_BORROW,
         ranges::RANGE_PLUS_ONE,
+        unwrap::PANICKING_UNWRAP,
+        unwrap::UNNECESSARY_UNWRAP,
     ]);
 }