Give an error instead of panicking on an empty tuple type

This commit is contained in:
Joshua Warner 2024-12-08 10:11:15 -08:00
parent 861f9c5d47
commit cbd6d50584
No known key found for this signature in database
GPG key ID: 89AD497003F93FDD
5 changed files with 35 additions and 25 deletions

View file

@ -705,26 +705,10 @@ mod test_snapshots {
// We should be driving these down to zero over time.
// Adding this protection in now to avoid accidentally adding more.
"all_the_bangs"
| "ann_record_pat_with_comment"
| "comment_indent_in_parens"
| "crazy_annotation_left"
| "crazy_annotation_left2"
| "crazy_pat_ann"
| "import_in_closure_with_curlies_after"
| "inline_import"
| "mega_parens_pat"
| "multiline_str_in_pat"
| "newline_before_import_curlies"
| "pattern_comma_newlines"
| "pattern_record_apply_comment"
| "triple_paren_pat_ann" => true,
| "newline_before_import_curlies" => true,
"annotation_tuple_comment"
| "annotation_tuple_parens_newlines"
| "comment_in_tuple_ext" => {
// These tests all hit `debug_assert!(!elems.is_empty());`
cfg!(debug_assertions)
}
// When adding new snapshot tests, strongly prefer fixing any canonicalization panics
// they may run into rather than adding them to this list.
_ => false,