diff --git a/clippy_lints/src/lib.rs b/clippy_lints/src/lib.rs index 1e75d42dd61..07f66f84b18 100644 --- a/clippy_lints/src/lib.rs +++ b/clippy_lints/src/lib.rs @@ -11,6 +11,7 @@ #![allow(stable_features)] #![feature(iterator_find_map)] #![feature(macro_at_most_once_rep)] +#![feature(rust_2018_preview)] extern crate cargo_metadata; #[macro_use] diff --git a/clippy_lints/src/new_without_default.rs b/clippy_lints/src/new_without_default.rs index 54b00081973..a6a63e6aa05 100644 --- a/clippy_lints/src/new_without_default.rs +++ b/clippy_lints/src/new_without_default.rs @@ -153,7 +153,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NewWithoutDefault { } fn create_new_without_default_suggest_msg(ty: Ty) -> String { - #[rustfmt_skip] + #[cfg_attr(rustfmt, rustfmt_skip)] format!( "impl Default for {} {{ fn default() -> Self {{ diff --git a/src/lib.rs b/src/lib.rs index 193be97161f..61e5c104bef 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,5 +1,6 @@ // error-pattern:cargo-clippy #![feature(plugin_registrar)] +#![feature(rust_2018_preview)] #![feature(rustc_private)] #![feature(macro_vis_matcher)] #![allow(unknown_lints)]