Skip to content

Commit c8a3451

Browse files
committed
Fix check for new and unexpected roots
We track the "roots" in our grammar -- those productions that aren't used in any other production. We want to report when a new root appears or when something that's expected to be a root no longer is one. However, we were reporting the latter case as the former instead of reporting it separately as intended. Let's fix that.
1 parent 1214d68 commit c8a3451

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: mdbook-spec/src/grammar.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,8 @@ fn check_unexpected_roots(grammar: &Grammar, diag: &mut Diagnostics) {
200200
.into_iter()
201201
.collect();
202202
if set != expected {
203-
let new: Vec<_> = set.symmetric_difference(&expected).collect();
204-
let removed: Vec<_> = expected.symmetric_difference(&set).collect();
203+
let new: Vec<_> = set.difference(&expected).collect();
204+
let removed: Vec<_> = expected.difference(&set).collect();
205205
if !new.is_empty() {
206206
warn_or_err!(
207207
diag,

0 commit comments

Comments
 (0)