From a8db10fcd9069c3116db04c392f012e8fe655a24 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Wed, 17 May 2023 04:42:16 -0700 Subject: [PATCH] If version detection fails, build with modernest stable features --- build.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/build.rs b/build.rs index 3ee8a9fc..fd856d4b 100644 --- a/build.rs +++ b/build.rs @@ -43,14 +43,15 @@ use std::env; use std::process::{self, Command}; use std::str; +use std::u32; fn main() { println!("cargo:rerun-if-changed=build.rs"); - let version = match rustc_version() { - Some(version) => version, - None => return, - }; + let version = rustc_version().unwrap_or(RustcVersion { + minor: u32::MAX, + nightly: false, + }); if version.minor < 31 { eprintln!("Minimum supported rustc version is 1.31");