Rollup merge of #90028 - tmiasko:structural-match-closure, r=spastorino
Reject closures in patterns Fixes #90013.
This commit is contained in:
commit
9ed9025ea9
5 changed files with 44 additions and 1 deletions
|
@ -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()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue