1
Fork 0

Reject closures in patterns

This commit is contained in:
Tomasz Miąsko 2021-10-18 00:00:00 +00:00
parent 1af55d19c7
commit c97cf7fed7
5 changed files with 44 additions and 1 deletions

View file

@ -130,6 +130,9 @@ impl<'a, 'tcx> ConstToPat<'a, 'tcx> {
traits::NonStructuralMatchTy::Opaque => {
"opaque types cannot be used in patterns".to_string()
}
traits::NonStructuralMatchTy::Closure => {
"closures cannot be used in patterns".to_string()
}
traits::NonStructuralMatchTy::Generator => {
"generators cannot be used in patterns".to_string()
}