@@ -786,6 +786,8 @@ impl<'tcx> Constructor<'tcx> {
786
786
}
787
787
788
788
/// This returns one wildcard pattern for each argument to this constructor.
789
+ ///
790
+ /// This must be consistent with `apply`, `specialize_one_pattern` and `arity`.
789
791
fn wildcard_subpatterns < ' a > (
790
792
& self ,
791
793
cx : & MatchCheckCtxt < ' a , ' tcx > ,
@@ -862,6 +864,8 @@ impl<'tcx> Constructor<'tcx> {
862
864
///
863
865
/// For instance, a tuple pattern `(_, 42, Some([]))` has the arity of 3.
864
866
/// A struct pattern's arity is the number of fields it contains, etc.
867
+ ///
868
+ /// This must be consistent with `wildcard_subpatterns`, `specialize_one_pattern` and `apply`.
865
869
fn arity < ' a > ( & self , cx : & MatchCheckCtxt < ' a , ' tcx > , ty : Ty < ' tcx > ) -> u64 {
866
870
debug ! ( "Constructor::arity({:#?}, {:?})" , self , ty) ;
867
871
match self {
@@ -883,6 +887,8 @@ impl<'tcx> Constructor<'tcx> {
883
887
/// Apply a constructor to a list of patterns, yielding a new pattern. `pats`
884
888
/// must have as many elements as this constructor's arity.
885
889
///
890
+ /// This must be consistent with `wildcard_subpatterns`, `specialize_one_pattern` and `arity`.
891
+ ///
886
892
/// Examples:
887
893
/// `self`: `Constructor::Single`
888
894
/// `ty`: `(u32, u32, u32)`
0 commit comments