@@ -82,25 +82,27 @@ pub fn check(path: &path::Path, bad: &mut bool) {
82
82
!lang_features. contains_key ( name)
83
83
} ) . collect ( ) ;
84
84
85
+ // Library features
85
86
let unstable_lib_feature_names = collect_unstable_feature_names ( & lib_features) ;
86
87
let unstable_book_lib_features_section_file_names =
87
88
collect_unstable_book_lib_features_section_file_names ( path) ;
88
89
89
- // Check for Unstable Book sections that don't have a corresponding unstable feature
90
- for feature_name in & unstable_book_lib_features_section_file_names -
91
- & unstable_lib_feature_names {
92
- tidy_error ! ( bad,
93
- "The Unstable Book has a 'library feature' section '{}' which doesn't \
94
- correspond to an unstable library feature",
95
- feature_name)
96
- }
97
-
98
90
// Language features
99
-
100
91
let unstable_lang_feature_names = collect_unstable_feature_names ( & lang_features) ;
101
92
let unstable_book_lang_features_section_file_names =
102
93
collect_unstable_book_lang_features_section_file_names ( path) ;
103
94
95
+ // Check for Unstable Book sections that don't have a corresponding unstable feature
96
+ for feature_name in & unstable_book_lib_features_section_file_names -
97
+ & unstable_lib_feature_names {
98
+ if !unstable_lang_feature_names. contains ( & feature_name) {
99
+ tidy_error ! ( bad,
100
+ "The Unstable Book has a 'library feature' section '{}' which doesn't \
101
+ correspond to an unstable library feature",
102
+ feature_name) ;
103
+ }
104
+ }
105
+
104
106
// Check for Unstable Book sections that don't have a corresponding unstable feature.
105
107
for feature_name in & unstable_book_lang_features_section_file_names -
106
108
& unstable_lang_feature_names {
0 commit comments