diff options
| author | bors <bors@rust-lang.org> | 2019-01-29 19:58:13 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2019-01-29 19:58:13 +0000 |
| commit | 6b1a2a9c3e1c8443d30247aa0d02f64d9f44e107 (patch) | |
| tree | 27b8bfa101f7b15065f8e0ebf0528ad43741bcb5 /clippy_lints/src/lib.rs | |
| parent | f55d521e6bad60568aeb89d3d86eb15ad0ed5642 (diff) | |
| parent | d0d7c5e92271c40b74e796bcf71758348a748553 (diff) | |
Auto merge of #3648 - phansch:const_fn_lint, r=oli-obk
Add initial version of const_fn lint This adds an initial version of a lint that can tell if a function could be `const`. TODO: - [x] Finish up the docs - [x] Fix the ICE cc #2440
Diffstat (limited to 'clippy_lints/src/lib.rs')
| -rw-r--r-- | clippy_lints/src/lib.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clippy_lints/src/lib.rs b/clippy_lints/src/lib.rs index 4683d353ccf..3483aae0ca3 100644 --- a/clippy_lints/src/lib.rs +++ b/clippy_lints/src/lib.rs @@ -23,6 +23,8 @@ extern crate rustc_data_structures; #[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; @@ -144,6 +146,7 @@ pub mod methods; pub mod minmax; pub mod misc; pub mod misc_early; +pub mod missing_const_for_fn; pub mod missing_doc; pub mod missing_inline; pub mod multiple_crate_versions; @@ -486,6 +489,7 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry<'_>, conf: &Conf) { reg.register_late_lint_pass(box slow_vector_initialization::Pass); reg.register_late_lint_pass(box types::RefToMut); reg.register_late_lint_pass(box assertions_on_constants::AssertionsOnConstants); + reg.register_late_lint_pass(box missing_const_for_fn::MissingConstForFn); reg.register_lint_group("clippy::restriction", Some("clippy_restriction"), vec