about summary refs log tree commit diff
path: root/src/tools/tidy
diff options
context:
space:
mode:
authorDan Robertson <dan@dlrobertson.com>2019-02-26 17:02:28 +0000
committerDan Robertson <dan@dlrobertson.com>2019-02-27 10:21:28 -0500
commitcd56472cc47981e62c684ceada7922ac3731b785 (patch)
tree6f84b112e61c3c16e04380ae1ce71d38c60c33ee /src/tools/tidy
parent485537074062d6310178101b198606573527723c (diff)
downloadrust-cd56472cc47981e62c684ceada7922ac3731b785.tar.gz
rust-cd56472cc47981e62c684ceada7922ac3731b785.zip
Fix tidy check for language and library features
Diffstat (limited to 'src/tools/tidy')
-rw-r--r--src/tools/tidy/src/unstable_book.rs22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/tools/tidy/src/unstable_book.rs b/src/tools/tidy/src/unstable_book.rs
index 63196eda7cc..cd60f36b1d2 100644
--- a/src/tools/tidy/src/unstable_book.rs
+++ b/src/tools/tidy/src/unstable_book.rs
@@ -82,25 +82,27 @@ pub fn check(path: &path::Path, bad: &mut bool) {
         !lang_features.contains_key(name)
     }).collect();
 
+    // Library features
     let unstable_lib_feature_names = collect_unstable_feature_names(&lib_features);
     let unstable_book_lib_features_section_file_names =
         collect_unstable_book_lib_features_section_file_names(path);
 
-    // Check for Unstable Book sections that don't have a corresponding unstable feature
-    for feature_name in &unstable_book_lib_features_section_file_names -
-                        &unstable_lib_feature_names {
-        tidy_error!(bad,
-                    "The Unstable Book has a 'library feature' section '{}' which doesn't \
-                     correspond to an unstable library feature",
-                    feature_name)
-    }
-
     // Language features
-
     let unstable_lang_feature_names = collect_unstable_feature_names(&lang_features);
     let unstable_book_lang_features_section_file_names =
         collect_unstable_book_lang_features_section_file_names(path);
 
+    // Check for Unstable Book sections that don't have a corresponding unstable feature
+    for feature_name in &unstable_book_lib_features_section_file_names -
+                        &unstable_lib_feature_names {
+        if !unstable_lang_feature_names.contains(&feature_name) {
+            tidy_error!(bad,
+                        "The Unstable Book has a 'library feature' section '{}' which doesn't \
+                         correspond to an unstable library feature",
+                        feature_name);
+        }
+    }
+
     // Check for Unstable Book sections that don't have a corresponding unstable feature.
     for feature_name in &unstable_book_lang_features_section_file_names -
                         &unstable_lang_feature_names {