From 942ddd9716f761a6dc006d6c85fb4129819a460d Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Thu, 25 May 2017 16:09:13 -0700 Subject: [PATCH] Add forwards compat with `VsVers` --- src/windows_registry.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/windows_registry.rs b/src/windows_registry.rs index 11656d2..d05fc1d 100644 --- a/src/windows_registry.rs +++ b/src/windows_registry.rs @@ -93,7 +93,13 @@ pub enum VsVers { /// Visual Studio 14 (2015) Vs14, /// Visual Studio 15 (2017) - Vs15 + Vs15, + + /// Hidden variant that should not be matched on. Callers that want to + /// handle an enumeration of `VsVers` instances should always have a default + /// case meaning that it's a VS version they don't understand. + #[doc(hidden)] + __Nonexhaustive_do_not_match_this_or_your_code_will_break, } /// Find the most recent installed version of Visual Studio @@ -109,7 +115,7 @@ pub fn find_vs_version() -> Result { #[cfg(windows)] pub fn find_vs_version() -> Result { use std::env; - + match env::var("VisualStudioVersion") { Ok(version) => { match &version[..] {