]> git.lizzy.rs Git - rust.git/blobdiff - clippy_dev/src/lib.rs
rustc: Parameterize `ty::Visibility` over used ID
[rust.git] / clippy_dev / src / lib.rs
index 59fde447547145f3093b5054112bd58dd6ec8b7e..82574a8e64b0ae028eb64769914837fd8c148553 100644 (file)
@@ -1,11 +1,17 @@
+#![feature(let_chains)]
+#![feature(let_else)]
 #![feature(once_cell)]
+#![feature(rustc_private)]
 #![cfg_attr(feature = "deny-warnings", deny(warnings))]
 // warn on lints, that are included in `rust-lang/rust`s bootstrap
 #![warn(rust_2018_idioms, unused_lifetimes)]
 
+extern crate rustc_lexer;
+
 use std::path::PathBuf;
 
 pub mod bless;
+pub mod dogfood;
 pub mod fmt;
 pub mod lint;
 pub mod new_lint;
 pub mod setup;
 pub mod update_lints;
 
+#[cfg(not(windows))]
+static CARGO_CLIPPY_EXE: &str = "cargo-clippy";
+#[cfg(windows)]
+static CARGO_CLIPPY_EXE: &str = "cargo-clippy.exe";
+
+/// Returns the path to the `cargo-clippy` binary
+#[must_use]
+pub fn cargo_clippy_path() -> PathBuf {
+    let mut path = std::env::current_exe().expect("failed to get current executable name");
+    path.set_file_name(CARGO_CLIPPY_EXE);
+    path
+}
+
 /// Returns the path to the Clippy project directory
 ///
 /// # Panics