]> git.lizzy.rs Git - rust.git/blob - src/lib.rs
Merge pull request #2804 from utaal/expr-call-author
[rust.git] / src / lib.rs
1 // error-pattern:cargo-clippy
2 #![feature(plugin_registrar)]
3 #![feature(rust_2018_preview)]
4 #![feature(rustc_private)]
5 #![feature(macro_vis_matcher)]
6 #![allow(unknown_lints)]
7 #![allow(missing_docs_in_private_items)]
8
9 extern crate rustc_plugin;
10 use rustc_plugin::Registry;
11
12 extern crate clippy_lints;
13
14 #[plugin_registrar]
15 pub fn plugin_registrar(reg: &mut Registry) {
16     reg.sess.lint_store.with_read_lock(|lint_store| {
17         for (lint, _, _) in lint_store.get_lint_groups() {
18             reg.sess
19                 .struct_warn(
20                     "the clippy plugin is being deprecated, please use cargo clippy or rls with the clippy feature",
21                 )
22                 .emit();
23             if lint == "clippy" {
24                 // cargo clippy run on a crate that also uses the plugin
25                 return;
26             }
27         }
28     });
29
30     clippy_lints::register_plugins(reg);
31 }
32
33 // only exists to let the dogfood integration test works.
34 // Don't run clippy as an executable directly
35 #[allow(dead_code)]
36 fn main() {
37     panic!("Please use the cargo-clippy executable");
38 }