   }
 
   /// The set of expected-{severity} comments in the file.
-  let expectations: Set<Expectation>
+  let expectations: [Expectation]
 
   /// The set of diagnostics that have been parsed.
   let producedDiagnostics: [(message: Diagnostic.Message, node: Syntax?)]

                                       lineNumber: lineNum + 1) else {
        continue
      }
      expectations.insert(exp)
    }
    return expectations
  }

        continue
      }

      // If any of the as-of-yet unmatched expectations fit this diagnostic,
      // remove it.
      if let idx = unmatched.index(where: { exp in
        return matches(message: message, node: node, expectation: exp)
      }) {
        unmatched.remove(at: idx)
      } else {
        unexpected[loc.line, default: []].append((message, node))
      }
    }
