Fix tidy check for language and library features

This commit is contained in:
Dan Robertson 2019-02-26 17:02:28 +00:00
parent 4855370740
commit cd56472cc4
No known key found for this signature in database
GPG Key ID: 4DE6EEF84B5C9783

View File

@ -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 {