From 68439614bad206570f0958fc672a3e11cccebf53 Mon Sep 17 00:00:00 2001 From: Austin Bonander Date: Mon, 16 Jan 2017 17:59:11 -0800 Subject: [PATCH] Fix `feature_gate::find_lang_feature_issue()` to not use `unwrap()` --- src/libsyntax/feature_gate.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index 2478ed169cd..66c66ad8940 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -896,9 +896,10 @@ fn find_lang_feature_issue(feature: &str) -> Option { issue } else { // search in Accepted or Removed features - ACCEPTED_FEATURES.iter().chain(REMOVED_FEATURES.iter()) - .find(|t| t.0 == feature) - .unwrap().2 + match ACCEPTED_FEATURES.iter().chain(REMOVED_FEATURES).find(|t| t.0 == feature) { + Some(&(_, _, issue)) => issue, + None => panic!("Feature `{}` is not declared anywhere", feature), + } } }