// error-pattern:cargo-clippy
+#![feature(bind_by_move_pattern_guards)] // proposed to be stabilized in Rust v1.39
#![feature(box_syntax)]
#![feature(box_patterns)]
#![feature(never_type)]
#[allow(unused_extern_crates)]
extern crate rustc_data_structures;
#[allow(unused_extern_crates)]
+extern crate rustc_driver;
+#[allow(unused_extern_crates)]
extern crate rustc_errors;
#[allow(unused_extern_crates)]
extern crate rustc_mir;
#[allow(unused_extern_crates)]
-extern crate rustc_plugin;
-#[allow(unused_extern_crates)]
extern crate rustc_target;
#[allow(unused_extern_crates)]
extern crate rustc_typeck;
}
#[doc(hidden)]
-pub fn read_conf(reg: &rustc_plugin::Registry<'_>) -> Conf {
+pub fn read_conf(reg: &rustc_driver::plugin::Registry<'_>) -> Conf {
match utils::conf::file_from_args(reg.args()) {
Ok(file_name) => {
// if the user specified a file, it must exist, otherwise default to `clippy.toml` but
/// Used in `./src/driver.rs`.
#[allow(clippy::too_many_lines)]
#[rustfmt::skip]
-pub fn register_plugins(reg: &mut rustc_plugin::Registry<'_>, conf: &Conf) {
+pub fn register_plugins(reg: &mut rustc_driver::plugin::Registry<'_>, conf: &Conf) {
let mut store = reg.sess.lint_store.borrow_mut();
register_removed_non_tool_lints(&mut store);
replace_consts::REPLACE_CONSTS,
shadow::SHADOW_UNRELATED,
strings::STRING_ADD_ASSIGN,
+ trait_bounds::TYPE_REPETITION_IN_BOUNDS,
types::CAST_POSSIBLE_TRUNCATION,
types::CAST_POSSIBLE_WRAP,
types::CAST_PRECISION_LOSS,
methods::ITER_CLONED_COLLECT,
methods::ITER_NTH,
methods::ITER_SKIP_NEXT,
+ methods::MANUAL_SATURATING_ARITHMETIC,
methods::NEW_RET_NO_SELF,
methods::OK_EXPECT,
+ methods::OPTION_AND_THEN_SOME,
methods::OPTION_MAP_OR_NONE,
methods::OR_FUN_CALL,
methods::SEARCH_IS_SOME,
methods::SHOULD_IMPLEMENT_TRAIT,
methods::SINGLE_CHAR_PATTERN,
methods::STRING_EXTEND_CHARS,
+ methods::SUSPICIOUS_MAP,
methods::TEMPORARY_CSTRING_AS_PTR,
+ methods::UNINIT_ASSUMED_INIT,
methods::UNNECESSARY_FILTER_MAP,
methods::UNNECESSARY_FOLD,
methods::USELESS_ASREF,
misc::CMP_OWNED,
misc::FLOAT_CMP,
misc::MODULO_ONE,
- misc::REDUNDANT_PATTERN,
misc::SHORT_CIRCUIT_STATEMENT,
misc::TOPLEVEL_REF_ARG,
misc::ZERO_PTR,
misc_early::DUPLICATE_UNDERSCORE_ARGUMENT,
misc_early::MIXED_CASE_HEX_LITERALS,
misc_early::REDUNDANT_CLOSURE_CALL,
+ misc_early::REDUNDANT_PATTERN,
misc_early::UNNEEDED_FIELD_PATTERN,
misc_early::ZERO_PREFIXED_LITERAL,
mut_reference::UNNECESSARY_MUT_PASSED,
swap::ALMOST_SWAPPED,
swap::MANUAL_SWAP,
temporary_assignment::TEMPORARY_ASSIGNMENT,
- trait_bounds::TYPE_REPETITION_IN_BOUNDS,
transmute::CROSSPOINTER_TRANSMUTE,
transmute::TRANSMUTE_BYTES_TO_STR,
transmute::TRANSMUTE_INT_TO_BOOL,
methods::INTO_ITER_ON_REF,
methods::ITER_CLONED_COLLECT,
methods::ITER_SKIP_NEXT,
+ methods::MANUAL_SATURATING_ARITHMETIC,
methods::NEW_RET_NO_SELF,
methods::OK_EXPECT,
methods::OPTION_MAP_OR_NONE,
methods::STRING_EXTEND_CHARS,
methods::UNNECESSARY_FOLD,
methods::WRONG_SELF_CONVENTION,
- misc::REDUNDANT_PATTERN,
misc::TOPLEVEL_REF_ARG,
misc::ZERO_PTR,
misc_early::BUILTIN_TYPE_SHADOW,
misc_early::DOUBLE_NEG,
misc_early::DUPLICATE_UNDERSCORE_ARGUMENT,
misc_early::MIXED_CASE_HEX_LITERALS,
+ misc_early::REDUNDANT_PATTERN,
misc_early::UNNEEDED_FIELD_PATTERN,
mut_reference::UNNECESSARY_MUT_PASSED,
neg_multiply::NEG_MULTIPLY,
methods::CLONE_ON_COPY,
methods::FILTER_NEXT,
methods::FLAT_MAP_IDENTITY,
+ methods::OPTION_AND_THEN_SOME,
methods::SEARCH_IS_SOME,
+ methods::SUSPICIOUS_MAP,
methods::UNNECESSARY_FILTER_MAP,
methods::USELESS_ASREF,
misc::SHORT_CIRCUIT_STATEMENT,
reference::REF_IN_DEREF,
swap::MANUAL_SWAP,
temporary_assignment::TEMPORARY_ASSIGNMENT,
- trait_bounds::TYPE_REPETITION_IN_BOUNDS,
transmute::CROSSPOINTER_TRANSMUTE,
transmute::TRANSMUTE_BYTES_TO_STR,
transmute::TRANSMUTE_INT_TO_BOOL,
methods::CLONE_DOUBLE_REF,
methods::INTO_ITER_ON_ARRAY,
methods::TEMPORARY_CSTRING_AS_PTR,
+ methods::UNINIT_ASSUMED_INIT,
minmax::MIN_MAX,
misc::CMP_NAN,
misc::FLOAT_CMP,