Skip to content
Myr

Check minimal rustc version on the build process

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Adit Cahya Ramadhan · committed by David Peter · parent 26f71dd · Browse files · 3 files+21 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+21 added−0 removed

  • other:+21 added−0 removed

3 files+21 added−0 removed

modified:build.rs+13 added
6 unmodified lines
7// according to those terms.89#[macro_use]10extern crate clap;11extern crate version_check;1213use clap::Shell;14use std::io::{self, Write};15use std::process::exit;1617include!("src/app.rs");1819fn main() {20 match version_check::is_min_version("1.19") {21 // rustc >= 1.1922 Some((true, _)) => {}23 // rustc < 1.19 or can't figure it out24 _ => {25 writeln!(&mut io::stderr(), "This crate requires rustc >= 1.19").unwrap();26 exit(1);27 }28 }2930 let var = std::env::var_os("SHELL_COMPLETIONS_DIR").or(std::env::var_os("OUT_DIR"));31 let outdir = match var {32 None => return,33 Some(outdir) => outdir,
8 unmodified lines
modified:Cargo.lock+7 added
13 unmodified lines
14 "regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",15 "regex-syntax 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",16 "shell-escape 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",17 "tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",18 "version_check 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",19 "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",20]2122[[package]]
284 unmodified lines
307version = "0.8.0"308source = "registry+https://github.com/rust-lang/crates.io-index"309310[[package]]311name = "version_check"312version = "0.1.3"313source = "registry+https://github.com/rust-lang/crates.io-index"314315[[package]]316name = "void"317version = "1.0.2"318source = "registry+https://github.com/rust-lang/crates.io-index"319
55 unmodified lines
375"checksum unicode-width 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "bf3a113775714a22dcb774d8ea3655c53a32debae63a063acc00a91cc586245f"376"checksum unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56"377"checksum utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "662fab6525a98beff2921d7f61a39e7d59e0b425ebc7d0d9e66d316e55124122"378"checksum vec_map 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "887b5b631c2ad01628bbbaa7dd4c869f80d3186688f8d0b6f58774fbe324988c"379"checksum version_check 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6b772017e347561807c1aa192438c5fd74242a670a6cffacc40f2defd1dc069d"380"checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d"381"checksum walkdir 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)" = "bb08f9e670fab86099470b97cd2b252d6527f0b3cc1401acdb595ffc9dd288ff"382"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a"383"checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc"
modified:Cargo.toml+1 added