]> git.lizzy.rs Git - rust.git/blob - build.rs
Adapt ui-tests to the tool_lints
[rust.git] / build.rs
1 //! This build script ensures that Clippy is not compiled with an
2 //! incompatible version of rust. It will panic with a descriptive
3 //! error message instead.
4 //!
5 //! We specifially want to ensure that Clippy is only built with a
6 //! rustc version that is newer or equal to the one specified in the
7 //! `min_version.txt` file.
8 //!
9 //! `min_version.txt` is in the repo but also in the `.gitignore` to
10 //! make sure that it is not updated manually by accident. Only CI
11 //! should update that file.
12 //!
13 //! This build script was originally taken from the Rocket web framework:
14 //! https://github.com/SergioBenitez/Rocket
15
16 use std::env;
17
18 fn main() {
19     // Forward the profile to the main compilation
20     println!("cargo:rustc-env=PROFILE={}", env::var("PROFILE").unwrap());
21     // Don't rebuild even if nothing changed
22     println!("cargo:rerun-if-changed=build.rs");
23 }