1
Fork 0

Rollup merge of #90028 - tmiasko:structural-match-closure, r=spastorino

Reject closures in patterns

Fixes #90013.
This commit is contained in:
Yuki Okushi 2021-10-22 19:42:48 +09:00 committed by GitHub
commit 9ed9025ea9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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()
}