#[test]
fn parse_allow_rejects_unknown_warning_kind() {
// If the user includes an unknown warning kind alongside a valid one,
// parsing should fail rather than silently dropping the unknown name and
// accepting only the recognized parts. Today the `filter_map(.. .ok())`
// in the `allow` arm hides the typo.
let result = "#[allow(unused_const, not_a_real_warning)]".parse::<AnnotationKind>();
assert!(
result.is_err(),
"expected Err for unknown warning kind, got {result:?} \
(the unknown kind 'not_a_real_warning' was silently dropped)"
);
}
context: #2371
context: #2371